From c78a960198d59fb9a9ddd83ad7098b1db396edfd Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 15 Apr 2020 13:10:31 +0200 Subject: QCOMPARE: treat values as equal if qFuzzyIsNull(each) We hope this shall avoid some flaky failures noticed in quick tests, e.g. tst_QQuickMenu::Material::subMenuPosition(cascading,flip) was recently seen failing with 3.88e-11 != 0. This required some revision to test data in the testlib selftest for floats; the resulting expected output differs in details but not in which tests pass or fail. QEMU, naturally, made life difficult, requiring special-case code in the test-driver. [ChangeLog][QtTestLib][QCOMPARE] QCOMPARE() now treats its values as equal when qFuzzyIsNull() is true for both of them. Change-Id: Icc6ad5164b609937eddbe39cc69120f0abf0f3b4 Reviewed-by: Qt CI Bot Reviewed-by: Mitch Curtis --- .../auto/testlib/selftests/expected_float.junitxml | 26 +- .../auto/testlib/selftests/expected_float.lightxml | 26 +- tests/auto/testlib/selftests/expected_float.tap | 310 ++++++++++----------- .../auto/testlib/selftests/expected_float.teamcity | 16 +- tests/auto/testlib/selftests/expected_float.txt | 26 +- tests/auto/testlib/selftests/expected_float.xml | 26 +- tests/auto/testlib/selftests/float/float.pro | 5 +- tests/auto/testlib/selftests/float/tst_float.cpp | 51 ++-- tests/auto/testlib/selftests/tst_selftests.cpp | 10 +- 9 files changed, 257 insertions(+), 239 deletions(-) (limited to 'tests/auto/testlib/selftests') diff --git a/tests/auto/testlib/selftests/expected_float.junitxml b/tests/auto/testlib/selftests/expected_float.junitxml index 602f9252a4..51a711efb7 100644 --- a/tests/auto/testlib/selftests/expected_float.junitxml +++ b/tests/auto/testlib/selftests/expected_float.junitxml @@ -17,8 +17,8 @@ Actual (operandLeft) : 999999999999 Expected (operandRight): 999999999998" result="fail"/> + Actual (operandLeft) : 1e-12 + Expected (operandRight): 9.99999999999e-13" result="fail"/> @@ -106,14 +106,14 @@ Actual (operandLeft) : 1 Expected (operandRight): 3" result="fail"/> + Actual (operandLeft) : 1e-05 + Expected (operandRight): 3e-05" result="fail"/> + Actual (operandLeft) : 1.00001e-05 + Expected (operandRight): 9.9999e-06" result="fail"/> @@ -201,14 +201,14 @@ Actual (operandLeft) : 1 Expected (operandRight): 3" result="fail"/> + Actual (operandLeft) : 0.000999 + Expected (operandRight): 0.003" result="fail"/> + Actual (operandLeft) : 0.00101 + Expected (operandRight): 0.00099" result="fail"/> @@ -295,9 +295,9 @@ - + diff --git a/tests/auto/testlib/selftests/expected_float.lightxml b/tests/auto/testlib/selftests/expected_float.lightxml index 5f5114bb2e..cf82929fd0 100644 --- a/tests/auto/testlib/selftests/expected_float.lightxml +++ b/tests/auto/testlib/selftests/expected_float.lightxml @@ -38,8 +38,8 @@ + Actual (operandLeft) : 1e-12 + Expected (operandRight): 9.99999999999e-13]]> @@ -230,8 +230,8 @@ + Actual (operandLeft) : 1e-05 + Expected (operandRight): 3e-05]]> @@ -248,8 +248,8 @@ + Actual (operandLeft) : 1.00001e-05 + Expected (operandRight): 9.9999e-06]]> @@ -440,8 +440,8 @@ + Actual (operandLeft) : 0.000999 + Expected (operandRight): 0.003]]> @@ -458,8 +458,8 @@ + Actual (operandLeft) : 0.00101 + Expected (operandRight): 0.00099]]> @@ -645,10 +645,10 @@ Expected (t3): 3]]> - + + Actual (t1): 1e-05 + Expected (t3): 3e-05]]> diff --git a/tests/auto/testlib/selftests/expected_float.tap b/tests/auto/testlib/selftests/expected_float.tap index 9da51b93b3..f5249b8b4e 100644 --- a/tests/auto/testlib/selftests/expected_float.tap +++ b/tests/auto/testlib/selftests/expected_float.tap @@ -44,10 +44,10 @@ not ok 8 - doubleComparisons(should FAIL 4) --- type: QCOMPARE message: Compared doubles are not the same (fuzzy compare) - wanted: 9.99999999997e-311 (operandRight) - found: 9.99999999999e-311 (operandLeft) - expected: 9.99999999997e-311 (operandRight) - actual: 9.99999999999e-311 (operandLeft) + wanted: 9.99999999999e-13 (operandRight) + found: 1e-12 (operandLeft) + expected: 9.99999999999e-13 (operandRight) + actual: 1e-12 (operandLeft) at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp line: 103 @@ -388,22 +388,22 @@ not ok 40 - floatComparisons(should FAIL 1) found: 1 (operandLeft) expected: 3 (operandRight) actual: 1 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... ok 41 - floatComparisons(should PASS 1) not ok 42 - floatComparisons(should FAIL 2) --- type: QCOMPARE message: Compared floats are not the same (fuzzy compare) - wanted: 3e-07 (operandRight) - found: 1e-07 (operandLeft) - expected: 3e-07 (operandRight) - actual: 1e-07 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + wanted: 3e-05 (operandRight) + found: 1e-05 (operandLeft) + expected: 3e-05 (operandRight) + actual: 1e-05 (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... ok 43 - floatComparisons(should PASS 2) not ok 44 - floatComparisons(should FAIL 3) @@ -414,22 +414,22 @@ not ok 44 - floatComparisons(should FAIL 3) found: 99999 (operandLeft) expected: 99998 (operandRight) actual: 99999 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... ok 45 - floatComparisons(should PASS 3) not ok 46 - floatComparisons(should FAIL 4) --- type: QCOMPARE message: Compared floats are not the same (fuzzy compare) - wanted: 9.99971e-40 (operandRight) - found: 9.9999e-40 (operandLeft) - expected: 9.99971e-40 (operandRight) - actual: 9.9999e-40 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + wanted: 9.9999e-06 (operandRight) + found: 1.00001e-05 (operandLeft) + expected: 9.9999e-06 (operandRight) + actual: 1.00001e-05 (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... ok 47 - floatComparisons(should PASS 4) not ok 48 - floatComparisons(should FAIL 5) @@ -440,9 +440,9 @@ not ok 48 - floatComparisons(should FAIL 5) found: 9.9999e+37 (operandLeft) expected: 9.9997e+37 (operandRight) actual: 9.9999e+37 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... ok 49 - floatComparisons(should PASS: NaN == NaN) not ok 50 - floatComparisons(should FAIL: NaN != 0) @@ -453,9 +453,9 @@ not ok 50 - floatComparisons(should FAIL: NaN != 0) found: nan (operandLeft) expected: 0 (operandRight) actual: nan (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 51 - floatComparisons(should FAIL: 0 != NaN) --- @@ -465,9 +465,9 @@ not ok 51 - floatComparisons(should FAIL: 0 != NaN) found: 0 (operandLeft) expected: nan (operandRight) actual: 0 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 52 - floatComparisons(should FAIL: NaN != 1) --- @@ -477,9 +477,9 @@ not ok 52 - floatComparisons(should FAIL: NaN != 1) found: nan (operandLeft) expected: 1 (operandRight) actual: nan (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 53 - floatComparisons(should FAIL: 1 != NaN) --- @@ -489,9 +489,9 @@ not ok 53 - floatComparisons(should FAIL: 1 != NaN) found: 1 (operandLeft) expected: nan (operandRight) actual: 1 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... ok 54 - floatComparisons(should PASS: inf == inf) ok 55 - floatComparisons(should PASS: -inf == -inf) @@ -503,9 +503,9 @@ not ok 56 - floatComparisons(should FAIL: inf != -inf) found: inf (operandLeft) expected: -inf (operandRight) actual: inf (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 57 - floatComparisons(should FAIL: -inf != inf) --- @@ -515,9 +515,9 @@ not ok 57 - floatComparisons(should FAIL: -inf != inf) found: -inf (operandLeft) expected: inf (operandRight) actual: -inf (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 58 - floatComparisons(should FAIL: inf != nan) --- @@ -527,9 +527,9 @@ not ok 58 - floatComparisons(should FAIL: inf != nan) found: inf (operandLeft) expected: nan (operandRight) actual: inf (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 59 - floatComparisons(should FAIL: nan != inf) --- @@ -539,9 +539,9 @@ not ok 59 - floatComparisons(should FAIL: nan != inf) found: nan (operandLeft) expected: inf (operandRight) actual: nan (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 60 - floatComparisons(should FAIL: -inf != nan) --- @@ -551,9 +551,9 @@ not ok 60 - floatComparisons(should FAIL: -inf != nan) found: -inf (operandLeft) expected: nan (operandRight) actual: -inf (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 61 - floatComparisons(should FAIL: nan != -inf) --- @@ -563,9 +563,9 @@ not ok 61 - floatComparisons(should FAIL: nan != -inf) found: nan (operandLeft) expected: -inf (operandRight) actual: nan (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 62 - floatComparisons(should FAIL: inf != 0) --- @@ -575,9 +575,9 @@ not ok 62 - floatComparisons(should FAIL: inf != 0) found: inf (operandLeft) expected: 0 (operandRight) actual: inf (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 63 - floatComparisons(should FAIL: 0 != inf) --- @@ -587,9 +587,9 @@ not ok 63 - floatComparisons(should FAIL: 0 != inf) found: 0 (operandLeft) expected: inf (operandRight) actual: 0 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 64 - floatComparisons(should FAIL: -inf != 0) --- @@ -599,9 +599,9 @@ not ok 64 - floatComparisons(should FAIL: -inf != 0) found: -inf (operandLeft) expected: 0 (operandRight) actual: -inf (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 65 - floatComparisons(should FAIL: 0 != -inf) --- @@ -611,9 +611,9 @@ not ok 65 - floatComparisons(should FAIL: 0 != -inf) found: 0 (operandLeft) expected: -inf (operandRight) actual: 0 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 66 - floatComparisons(should FAIL: inf != 1) --- @@ -623,9 +623,9 @@ not ok 66 - floatComparisons(should FAIL: inf != 1) found: inf (operandLeft) expected: 1 (operandRight) actual: inf (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 67 - floatComparisons(should FAIL: 1 != inf) --- @@ -635,9 +635,9 @@ not ok 67 - floatComparisons(should FAIL: 1 != inf) found: 1 (operandLeft) expected: inf (operandRight) actual: 1 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 68 - floatComparisons(should FAIL: -inf != 1) --- @@ -647,9 +647,9 @@ not ok 68 - floatComparisons(should FAIL: -inf != 1) found: -inf (operandLeft) expected: 1 (operandRight) actual: -inf (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 69 - floatComparisons(should FAIL: 1 != -inf) --- @@ -659,9 +659,9 @@ not ok 69 - floatComparisons(should FAIL: 1 != -inf) found: 1 (operandLeft) expected: -inf (operandRight) actual: 1 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 70 - floatComparisons(should FAIL: inf != max) --- @@ -671,9 +671,9 @@ not ok 70 - floatComparisons(should FAIL: inf != max) found: inf (operandLeft) expected: 3.40282e+38 (operandRight) actual: inf (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 71 - floatComparisons(should FAIL: inf != -max) --- @@ -683,9 +683,9 @@ not ok 71 - floatComparisons(should FAIL: inf != -max) found: inf (operandLeft) expected: -3.40282e+38 (operandRight) actual: inf (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 72 - floatComparisons(should FAIL: max != inf) --- @@ -695,9 +695,9 @@ not ok 72 - floatComparisons(should FAIL: max != inf) found: 3.40282e+38 (operandLeft) expected: inf (operandRight) actual: 3.40282e+38 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 73 - floatComparisons(should FAIL: -max != inf) --- @@ -707,9 +707,9 @@ not ok 73 - floatComparisons(should FAIL: -max != inf) found: -3.40282e+38 (operandLeft) expected: inf (operandRight) actual: -3.40282e+38 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 74 - floatComparisons(should FAIL: -inf != max) --- @@ -719,9 +719,9 @@ not ok 74 - floatComparisons(should FAIL: -inf != max) found: -inf (operandLeft) expected: 3.40282e+38 (operandRight) actual: -inf (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 75 - floatComparisons(should FAIL: -inf != -max) --- @@ -731,9 +731,9 @@ not ok 75 - floatComparisons(should FAIL: -inf != -max) found: -inf (operandLeft) expected: -3.40282e+38 (operandRight) actual: -inf (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 76 - floatComparisons(should FAIL: max != -inf) --- @@ -743,9 +743,9 @@ not ok 76 - floatComparisons(should FAIL: max != -inf) found: 3.40282e+38 (operandLeft) expected: -inf (operandRight) actual: 3.40282e+38 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 77 - floatComparisons(should FAIL: -max != -inf) --- @@ -755,9 +755,9 @@ not ok 77 - floatComparisons(should FAIL: -max != -inf) found: -3.40282e+38 (operandLeft) expected: -inf (operandRight) actual: -3.40282e+38 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:139) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 137 + line: 139 ... not ok 78 - float16Comparisons(should FAIL 1) --- @@ -767,22 +767,22 @@ not ok 78 - float16Comparisons(should FAIL 1) found: 1 (operandLeft) expected: 3 (operandRight) actual: 1 (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... ok 79 - float16Comparisons(should PASS 1) not ok 80 - float16Comparisons(should FAIL 2) --- type: QCOMPARE message: Compared qfloat16s are not the same (fuzzy compare) - wanted: 0.0003 (operandRight) - found: 0.0001 (operandLeft) - expected: 0.0003 (operandRight) - actual: 0.0001 (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + wanted: 0.003 (operandRight) + found: 0.000999 (operandLeft) + expected: 0.003 (operandRight) + actual: 0.000999 (operandLeft) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... ok 81 - float16Comparisons(should PASS 2) not ok 82 - float16Comparisons(should FAIL 3) @@ -793,22 +793,22 @@ not ok 82 - float16Comparisons(should FAIL 3) found: 98 (operandLeft) expected: 99 (operandRight) actual: 98 (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... ok 83 - float16Comparisons(should PASS 3) not ok 84 - float16Comparisons(should FAIL 4) --- type: QCOMPARE message: Compared qfloat16s are not the same (fuzzy compare) - wanted: 5.87e-05 (operandRight) - found: 5.93e-05 (operandLeft) - expected: 5.87e-05 (operandRight) - actual: 5.93e-05 (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + wanted: 0.00099 (operandRight) + found: 0.00101 (operandLeft) + expected: 0.00099 (operandRight) + actual: 0.00101 (operandLeft) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... ok 85 - float16Comparisons(should PASS 4) not ok 86 - float16Comparisons(should FAIL 5) @@ -819,9 +819,9 @@ not ok 86 - float16Comparisons(should FAIL 5) found: 5.94e+04 (operandLeft) expected: 5.88e+04 (operandRight) actual: 5.94e+04 (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... ok 87 - float16Comparisons(should PASS: NaN == NaN) not ok 88 - float16Comparisons(should FAIL: NaN != 0) @@ -832,9 +832,9 @@ not ok 88 - float16Comparisons(should FAIL: NaN != 0) found: nan (operandLeft) expected: 0 (operandRight) actual: nan (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 89 - float16Comparisons(should FAIL: 0 != NaN) --- @@ -844,9 +844,9 @@ not ok 89 - float16Comparisons(should FAIL: 0 != NaN) found: 0 (operandLeft) expected: nan (operandRight) actual: 0 (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 90 - float16Comparisons(should FAIL: NaN != 1) --- @@ -856,9 +856,9 @@ not ok 90 - float16Comparisons(should FAIL: NaN != 1) found: nan (operandLeft) expected: 1 (operandRight) actual: nan (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 91 - float16Comparisons(should FAIL: 1 != NaN) --- @@ -868,9 +868,9 @@ not ok 91 - float16Comparisons(should FAIL: 1 != NaN) found: 1 (operandLeft) expected: nan (operandRight) actual: 1 (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... ok 92 - float16Comparisons(should PASS: inf == inf) ok 93 - float16Comparisons(should PASS: -inf == -inf) @@ -882,9 +882,9 @@ not ok 94 - float16Comparisons(should FAIL: inf != -inf) found: inf (operandLeft) expected: -inf (operandRight) actual: inf (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 95 - float16Comparisons(should FAIL: -inf != inf) --- @@ -894,9 +894,9 @@ not ok 95 - float16Comparisons(should FAIL: -inf != inf) found: -inf (operandLeft) expected: inf (operandRight) actual: -inf (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 96 - float16Comparisons(should FAIL: inf != nan) --- @@ -906,9 +906,9 @@ not ok 96 - float16Comparisons(should FAIL: inf != nan) found: inf (operandLeft) expected: nan (operandRight) actual: inf (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 97 - float16Comparisons(should FAIL: nan != inf) --- @@ -918,9 +918,9 @@ not ok 97 - float16Comparisons(should FAIL: nan != inf) found: nan (operandLeft) expected: inf (operandRight) actual: nan (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 98 - float16Comparisons(should FAIL: -inf != nan) --- @@ -930,9 +930,9 @@ not ok 98 - float16Comparisons(should FAIL: -inf != nan) found: -inf (operandLeft) expected: nan (operandRight) actual: -inf (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 99 - float16Comparisons(should FAIL: nan != -inf) --- @@ -942,9 +942,9 @@ not ok 99 - float16Comparisons(should FAIL: nan != -inf) found: nan (operandLeft) expected: -inf (operandRight) actual: nan (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 100 - float16Comparisons(should FAIL: inf != 0) --- @@ -954,9 +954,9 @@ not ok 100 - float16Comparisons(should FAIL: inf != 0) found: inf (operandLeft) expected: 0 (operandRight) actual: inf (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 101 - float16Comparisons(should FAIL: 0 != inf) --- @@ -966,9 +966,9 @@ not ok 101 - float16Comparisons(should FAIL: 0 != inf) found: 0 (operandLeft) expected: inf (operandRight) actual: 0 (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 102 - float16Comparisons(should FAIL: -inf != 0) --- @@ -978,9 +978,9 @@ not ok 102 - float16Comparisons(should FAIL: -inf != 0) found: -inf (operandLeft) expected: 0 (operandRight) actual: -inf (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 103 - float16Comparisons(should FAIL: 0 != -inf) --- @@ -990,9 +990,9 @@ not ok 103 - float16Comparisons(should FAIL: 0 != -inf) found: 0 (operandLeft) expected: -inf (operandRight) actual: 0 (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 104 - float16Comparisons(should FAIL: inf != 1) --- @@ -1002,9 +1002,9 @@ not ok 104 - float16Comparisons(should FAIL: inf != 1) found: inf (operandLeft) expected: 1 (operandRight) actual: inf (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 105 - float16Comparisons(should FAIL: 1 != inf) --- @@ -1014,9 +1014,9 @@ not ok 105 - float16Comparisons(should FAIL: 1 != inf) found: 1 (operandLeft) expected: inf (operandRight) actual: 1 (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 106 - float16Comparisons(should FAIL: -inf != 1) --- @@ -1026,9 +1026,9 @@ not ok 106 - float16Comparisons(should FAIL: -inf != 1) found: -inf (operandLeft) expected: 1 (operandRight) actual: -inf (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 107 - float16Comparisons(should FAIL: 1 != -inf) --- @@ -1038,9 +1038,9 @@ not ok 107 - float16Comparisons(should FAIL: 1 != -inf) found: 1 (operandLeft) expected: -inf (operandRight) actual: 1 (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 108 - float16Comparisons(should FAIL: inf != max) --- @@ -1050,9 +1050,9 @@ not ok 108 - float16Comparisons(should FAIL: inf != max) found: inf (operandLeft) expected: 6.55e+04 (operandRight) actual: inf (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 109 - float16Comparisons(should FAIL: inf != -max) --- @@ -1062,9 +1062,9 @@ not ok 109 - float16Comparisons(should FAIL: inf != -max) found: inf (operandLeft) expected: -6.55e+04 (operandRight) actual: inf (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 110 - float16Comparisons(should FAIL: max != inf) --- @@ -1074,9 +1074,9 @@ not ok 110 - float16Comparisons(should FAIL: max != inf) found: 6.55e+04 (operandLeft) expected: inf (operandRight) actual: 6.55e+04 (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 111 - float16Comparisons(should FAIL: -max != inf) --- @@ -1086,9 +1086,9 @@ not ok 111 - float16Comparisons(should FAIL: -max != inf) found: -6.55e+04 (operandLeft) expected: inf (operandRight) actual: -6.55e+04 (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 112 - float16Comparisons(should FAIL: -inf != max) --- @@ -1098,9 +1098,9 @@ not ok 112 - float16Comparisons(should FAIL: -inf != max) found: -inf (operandLeft) expected: 6.55e+04 (operandRight) actual: -inf (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 113 - float16Comparisons(should FAIL: -inf != -max) --- @@ -1110,9 +1110,9 @@ not ok 113 - float16Comparisons(should FAIL: -inf != -max) found: -inf (operandLeft) expected: -6.55e+04 (operandRight) actual: -inf (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 114 - float16Comparisons(should FAIL: max != -inf) --- @@ -1122,9 +1122,9 @@ not ok 114 - float16Comparisons(should FAIL: max != -inf) found: 6.55e+04 (operandLeft) expected: -inf (operandRight) actual: 6.55e+04 (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 115 - float16Comparisons(should FAIL: -max != -inf) --- @@ -1134,9 +1134,9 @@ not ok 115 - float16Comparisons(should FAIL: -max != -inf) found: -6.55e+04 (operandLeft) expected: -inf (operandRight) actual: -6.55e+04 (operandLeft) - at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:174) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 171 + line: 174 ... not ok 116 - compareFloatTests(1e0) --- @@ -1146,21 +1146,21 @@ not ok 116 - compareFloatTests(1e0) found: 1 (t1) expected: 3 (t3) actual: 1 (t1) - at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:210) + at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:215) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 210 + line: 215 ... -not ok 117 - compareFloatTests(1e-7) +not ok 117 - compareFloatTests(1e-5) --- type: QCOMPARE message: Compared floats are not the same (fuzzy compare) - wanted: 3e-07 (t3) - found: 1e-07 (t1) - expected: 3e-07 (t3) - actual: 1e-07 (t1) - at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:210) + wanted: 3e-05 (t3) + found: 1e-05 (t1) + expected: 3e-05 (t3) + actual: 1e-05 (t1) + at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:215) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 210 + line: 215 ... not ok 118 - compareFloatTests(1e+7) --- @@ -1170,9 +1170,9 @@ not ok 118 - compareFloatTests(1e+7) found: 1e+07 (t1) expected: 3e+07 (t3) actual: 1e+07 (t1) - at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:210) + at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:215) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 210 + line: 215 ... ok 119 - cleanupTestCase() 1..119 diff --git a/tests/auto/testlib/selftests/expected_float.teamcity b/tests/auto/testlib/selftests/expected_float.teamcity index af81296c42..f8d65a71c7 100644 --- a/tests/auto/testlib/selftests/expected_float.teamcity +++ b/tests/auto/testlib/selftests/expected_float.teamcity @@ -17,7 +17,7 @@ ##teamcity[testStarted name='doubleComparisons(should PASS 3)' flowId='tst_float'] ##teamcity[testFinished name='doubleComparisons(should PASS 3)' flowId='tst_float'] ##teamcity[testStarted name='doubleComparisons(should FAIL 4)' flowId='tst_float'] -##teamcity[testFailed name='doubleComparisons(should FAIL 4)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 9.99999999999e-311|n Expected (operandRight): 9.99999999997e-311' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL 4)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 1e-12|n Expected (operandRight): 9.99999999999e-13' flowId='tst_float'] ##teamcity[testFinished name='doubleComparisons(should FAIL 4)' flowId='tst_float'] ##teamcity[testStarted name='doubleComparisons(should PASS 4)' flowId='tst_float'] ##teamcity[testFinished name='doubleComparisons(should PASS 4)' flowId='tst_float'] @@ -114,7 +114,7 @@ ##teamcity[testStarted name='floatComparisons(should PASS 1)' flowId='tst_float'] ##teamcity[testFinished name='floatComparisons(should PASS 1)' flowId='tst_float'] ##teamcity[testStarted name='floatComparisons(should FAIL 2)' flowId='tst_float'] -##teamcity[testFailed name='floatComparisons(should FAIL 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 1e-07|n Expected (operandRight): 3e-07' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 1e-05|n Expected (operandRight): 3e-05' flowId='tst_float'] ##teamcity[testFinished name='floatComparisons(should FAIL 2)' flowId='tst_float'] ##teamcity[testStarted name='floatComparisons(should PASS 2)' flowId='tst_float'] ##teamcity[testFinished name='floatComparisons(should PASS 2)' flowId='tst_float'] @@ -124,7 +124,7 @@ ##teamcity[testStarted name='floatComparisons(should PASS 3)' flowId='tst_float'] ##teamcity[testFinished name='floatComparisons(should PASS 3)' flowId='tst_float'] ##teamcity[testStarted name='floatComparisons(should FAIL 4)' flowId='tst_float'] -##teamcity[testFailed name='floatComparisons(should FAIL 4)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 9.9999e-40|n Expected (operandRight): 9.99971e-40' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL 4)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 1.00001e-05|n Expected (operandRight): 9.9999e-06' flowId='tst_float'] ##teamcity[testFinished name='floatComparisons(should FAIL 4)' flowId='tst_float'] ##teamcity[testStarted name='floatComparisons(should PASS 4)' flowId='tst_float'] ##teamcity[testFinished name='floatComparisons(should PASS 4)' flowId='tst_float'] @@ -221,7 +221,7 @@ ##teamcity[testStarted name='float16Comparisons(should PASS 1)' flowId='tst_float'] ##teamcity[testFinished name='float16Comparisons(should PASS 1)' flowId='tst_float'] ##teamcity[testStarted name='float16Comparisons(should FAIL 2)' flowId='tst_float'] -##teamcity[testFailed name='float16Comparisons(should FAIL 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 0.0001|n Expected (operandRight): 0.0003' flowId='tst_float'] +##teamcity[testFailed name='float16Comparisons(should FAIL 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 0.000999|n Expected (operandRight): 0.003' flowId='tst_float'] ##teamcity[testFinished name='float16Comparisons(should FAIL 2)' flowId='tst_float'] ##teamcity[testStarted name='float16Comparisons(should PASS 2)' flowId='tst_float'] ##teamcity[testFinished name='float16Comparisons(should PASS 2)' flowId='tst_float'] @@ -231,7 +231,7 @@ ##teamcity[testStarted name='float16Comparisons(should PASS 3)' flowId='tst_float'] ##teamcity[testFinished name='float16Comparisons(should PASS 3)' flowId='tst_float'] ##teamcity[testStarted name='float16Comparisons(should FAIL 4)' flowId='tst_float'] -##teamcity[testFailed name='float16Comparisons(should FAIL 4)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 5.93e-05|n Expected (operandRight): 5.87e-05' flowId='tst_float'] +##teamcity[testFailed name='float16Comparisons(should FAIL 4)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 0.00101|n Expected (operandRight): 0.00099' flowId='tst_float'] ##teamcity[testFinished name='float16Comparisons(should FAIL 4)' flowId='tst_float'] ##teamcity[testStarted name='float16Comparisons(should PASS 4)' flowId='tst_float'] ##teamcity[testFinished name='float16Comparisons(should PASS 4)' flowId='tst_float'] @@ -325,9 +325,9 @@ ##teamcity[testStarted name='compareFloatTests(1e0)' flowId='tst_float'] ##teamcity[testFailed name='compareFloatTests(1e0)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (t1): 1|n Expected (t3): 3' flowId='tst_float'] ##teamcity[testFinished name='compareFloatTests(1e0)' flowId='tst_float'] -##teamcity[testStarted name='compareFloatTests(1e-7)' flowId='tst_float'] -##teamcity[testFailed name='compareFloatTests(1e-7)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (t1): 1e-07|n Expected (t3): 3e-07' flowId='tst_float'] -##teamcity[testFinished name='compareFloatTests(1e-7)' flowId='tst_float'] +##teamcity[testStarted name='compareFloatTests(1e-5)' flowId='tst_float'] +##teamcity[testFailed name='compareFloatTests(1e-5)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (t1): 1e-05|n Expected (t3): 3e-05' flowId='tst_float'] +##teamcity[testFinished name='compareFloatTests(1e-5)' flowId='tst_float'] ##teamcity[testStarted name='compareFloatTests(1e+7)' flowId='tst_float'] ##teamcity[testFailed name='compareFloatTests(1e+7)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (t1): 1e+07|n Expected (t3): 3e+07' flowId='tst_float'] ##teamcity[testFinished name='compareFloatTests(1e+7)' flowId='tst_float'] diff --git a/tests/auto/testlib/selftests/expected_float.txt b/tests/auto/testlib/selftests/expected_float.txt index d22a52a63d..25c8c6b6de 100644 --- a/tests/auto/testlib/selftests/expected_float.txt +++ b/tests/auto/testlib/selftests/expected_float.txt @@ -17,8 +17,8 @@ FAIL! : tst_float::doubleComparisons(should FAIL 3) Compared doubles are not th Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] PASS : tst_float::doubleComparisons(should PASS 3) FAIL! : tst_float::doubleComparisons(should FAIL 4) Compared doubles are not the same (fuzzy compare) - Actual (operandLeft) : 9.99999999999e-311 - Expected (operandRight): 9.99999999997e-311 + Actual (operandLeft) : 1e-12 + Expected (operandRight): 9.99999999999e-13 Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] PASS : tst_float::doubleComparisons(should PASS 4) FAIL! : tst_float::doubleComparisons(should FAIL 5) Compared doubles are not the same (fuzzy compare) @@ -138,8 +138,8 @@ FAIL! : tst_float::floatComparisons(should FAIL 1) Compared floats are not the Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] PASS : tst_float::floatComparisons(should PASS 1) FAIL! : tst_float::floatComparisons(should FAIL 2) Compared floats are not the same (fuzzy compare) - Actual (operandLeft) : 1e-07 - Expected (operandRight): 3e-07 + Actual (operandLeft) : 1e-05 + Expected (operandRight): 3e-05 Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] PASS : tst_float::floatComparisons(should PASS 2) FAIL! : tst_float::floatComparisons(should FAIL 3) Compared floats are not the same (fuzzy compare) @@ -148,8 +148,8 @@ FAIL! : tst_float::floatComparisons(should FAIL 3) Compared floats are not the Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] PASS : tst_float::floatComparisons(should PASS 3) FAIL! : tst_float::floatComparisons(should FAIL 4) Compared floats are not the same (fuzzy compare) - Actual (operandLeft) : 9.9999e-40 - Expected (operandRight): 9.99971e-40 + Actual (operandLeft) : 1.00001e-05 + Expected (operandRight): 9.9999e-06 Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] PASS : tst_float::floatComparisons(should PASS 4) FAIL! : tst_float::floatComparisons(should FAIL 5) Compared floats are not the same (fuzzy compare) @@ -269,8 +269,8 @@ FAIL! : tst_float::float16Comparisons(should FAIL 1) Compared qfloat16s are not Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] PASS : tst_float::float16Comparisons(should PASS 1) FAIL! : tst_float::float16Comparisons(should FAIL 2) Compared qfloat16s are not the same (fuzzy compare) - Actual (operandLeft) : 0.0001 - Expected (operandRight): 0.0003 + Actual (operandLeft) : 0.000999 + Expected (operandRight): 0.003 Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] PASS : tst_float::float16Comparisons(should PASS 2) FAIL! : tst_float::float16Comparisons(should FAIL 3) Compared qfloat16s are not the same (fuzzy compare) @@ -279,8 +279,8 @@ FAIL! : tst_float::float16Comparisons(should FAIL 3) Compared qfloat16s are not Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] PASS : tst_float::float16Comparisons(should PASS 3) FAIL! : tst_float::float16Comparisons(should FAIL 4) Compared qfloat16s are not the same (fuzzy compare) - Actual (operandLeft) : 5.93e-05 - Expected (operandRight): 5.87e-05 + Actual (operandLeft) : 0.00101 + Expected (operandRight): 0.00099 Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] PASS : tst_float::float16Comparisons(should PASS 4) FAIL! : tst_float::float16Comparisons(should FAIL 5) Compared qfloat16s are not the same (fuzzy compare) @@ -398,9 +398,9 @@ FAIL! : tst_float::compareFloatTests(1e0) Compared floats are not the same (fuz Actual (t1): 1 Expected (t3): 3 Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] -FAIL! : tst_float::compareFloatTests(1e-7) Compared floats are not the same (fuzzy compare) - Actual (t1): 1e-07 - Expected (t3): 3e-07 +FAIL! : tst_float::compareFloatTests(1e-5) Compared floats are not the same (fuzzy compare) + Actual (t1): 1e-05 + Expected (t3): 3e-05 Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] FAIL! : tst_float::compareFloatTests(1e+7) Compared floats are not the same (fuzzy compare) Actual (t1): 1e+07 diff --git a/tests/auto/testlib/selftests/expected_float.xml b/tests/auto/testlib/selftests/expected_float.xml index 247bce9577..8ddc72a917 100644 --- a/tests/auto/testlib/selftests/expected_float.xml +++ b/tests/auto/testlib/selftests/expected_float.xml @@ -40,8 +40,8 @@ + Actual (operandLeft) : 1e-12 + Expected (operandRight): 9.99999999999e-13]]> @@ -232,8 +232,8 @@ + Actual (operandLeft) : 1e-05 + Expected (operandRight): 3e-05]]> @@ -250,8 +250,8 @@ + Actual (operandLeft) : 1.00001e-05 + Expected (operandRight): 9.9999e-06]]> @@ -442,8 +442,8 @@ + Actual (operandLeft) : 0.000999 + Expected (operandRight): 0.003]]> @@ -460,8 +460,8 @@ + Actual (operandLeft) : 0.00101 + Expected (operandRight): 0.00099]]> @@ -647,10 +647,10 @@ Expected (t3): 3]]> - + + Actual (t1): 1e-05 + Expected (t3): 3e-05]]> diff --git a/tests/auto/testlib/selftests/float/float.pro b/tests/auto/testlib/selftests/float/float.pro index 479eb152c5..8f169921c3 100644 --- a/tests/auto/testlib/selftests/float/float.pro +++ b/tests/auto/testlib/selftests/float/float.pro @@ -1,9 +1,10 @@ -SOURCES += tst_float.cpp QT = core testlib - mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target +INCLUDEPATH += ../../../../shared/ +HEADERS = ../../../../shared/emulationdetector.h +SOURCES += tst_float.cpp TARGET = float include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/float/tst_float.cpp b/tests/auto/testlib/selftests/float/tst_float.cpp index cefd8a57c4..823495f863 100644 --- a/tests/auto/testlib/selftests/float/tst_float.cpp +++ b/tests/auto/testlib/selftests/float/tst_float.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -31,6 +31,8 @@ #include #include +#include "emulationdetector.h" + // Test proper handling of floating-point types class tst_float: public QObject { @@ -113,16 +115,18 @@ void tst_float::doubleComparisons_data() const QTest::newRow("should PASS 1") << zero << zero; QTest::newRow("should FAIL 2") << 1.e-7 << 3.e-7; - // QCOMPARE for doubles uses qFuzzyCompare(), which succeeds if the numbers - // differ by no more than 1e-12 times the smaller value. Thus - // QCOMPARE(1e12-2, 1e12-1) should fail, while QCOMPARE(1e12+1, 1e12+2) - // should pass. + // QCOMPARE() uses qFuzzyCompare(), which succeeds if doubles differ by no + // more than 1e-12 times the smaller value; but QCOMPARE() also considers + // values equal if qFuzzyIsNull() is true for both, so all doubles smaller + // than 1e-12 are equal. Thus QCOMPARE(1e12-2, 1e12-1) should fail, while + // QCOMPARE(1e12+1, 1e12+2) should pass, as should QCOMPARE(1e-12-2e-24, + // 1e-12-1e-24), despite the values differing by more than one part in 1e12. QTest::newRow("should PASS 2") << 1e12 + one << 1e12 + 2.; QTest::newRow("should FAIL 3") << 1e12 - one << 1e12 - 2.; + QTest::newRow("should PASS 3") << 1e-12 << -1e-12; // ... but rounding makes that a bit unrelaible when scaled close to the bounds. - QTest::newRow("should PASS 3") << 1e-310 + 1e-322 << 1e-310 + 2e-322; - QTest::newRow("should FAIL 4") << 1e-310 - 1e-322 << 1e-310 - 3e-322; + QTest::newRow("should FAIL 4") << 1e-12 + 1e-24 << 1e-12 - 1e-24; QTest::newRow("should PASS 4") << 1e307 + 1e295 << 1e307 + 2e295; QTest::newRow("should FAIL 5") << 1e307 - 1e295 << 1e307 - 3e295; @@ -145,18 +149,20 @@ void tst_float::floatComparisons_data() const QTest::newRow("should FAIL 1") << one << 3.f; QTest::newRow("should PASS 1") << zero << zero; - QTest::newRow("should FAIL 2") << 1.e-7f << 3.e-7f; + QTest::newRow("should FAIL 2") << 1.e-5f << 3.e-5f; - // QCOMPARE for floats uses qFuzzyCompare(), which succeeds if the numbers - // differ by no more than 1e-5 times the smaller value. Thus - // QCOMPARE(1e5-2, 1e5-1) should fail, while QCOMPARE(1e5+1, 1e5+2) - // should pass. + // QCOMPARE() uses qFuzzyCompare(), which succeeds if the floats differ by + // no more than 1e-5 times the smaller value; but QCOMPARE() also considers + // values equal if qFuzzyIsNull is true for both, so all floats smaller than + // 1e-5 are equal. Thus QCOMPARE(1e5-2, 1e5-1) should fail, while + // QCOMPARE(1e5+1, 1e5+2) should pass, as should QCOMPARE(1e-5-2e-10, + // 1e-5-1e-10), despite the values differing by more than one part in 1e5. QTest::newRow("should PASS 2") << 1e5f + one << 1e5f + 2.f; QTest::newRow("should FAIL 3") << 1e5f - one << 1e5f - 2.f; + QTest::newRow("should PASS 3") << 1e-5f << -1e-5f; // ... but rounding makes that a bit unrelaible when scaled close to the bounds. - QTest::newRow("should PASS 3") << 1e-39f + 1e-44f << 1e-39f + 2e-44f; - QTest::newRow("should FAIL 4") << 1e-39f - 1e-44f << 1e-39f - 3e-44f; + QTest::newRow("should FAIL 4") << 1e-5f + 1e-10f << 1e-5f - 1e-10f; QTest::newRow("should PASS 4") << 1e38f + 1e33f << 1e38f + 2e33f; QTest::newRow("should FAIL 5") << 1e38f - 1e33f << 1e38f - 3e33f; @@ -175,18 +181,21 @@ void tst_float::float16Comparisons_data() const { QTest::addColumn("operandLeft"); QTest::addColumn("operandRight"); - qfloat16 zero(0), one(1); + const qfloat16 zero(0), one(1); + const qfloat16 tiny(EmulationDetector::isRunningArmOnX86() ? 0.00099f : 0.001f); QTest::newRow("should FAIL 1") << one << qfloat16(3); QTest::newRow("should PASS 1") << zero << zero; - QTest::newRow("should FAIL 2") << qfloat16(1e-4f) << qfloat16(3e-4f); + QTest::newRow("should FAIL 2") << qfloat16(1e-3f) << qfloat16(3e-3f); - // QCOMPARE for qfloat16s uses qFuzzyCompare() + // QCOMPARE for uses qFuzzyCompare(), which ignores differences of one part + // in 102.5 and considers any two qFuzzyIsNull() values, i.e. values smaller + // than 1e-3, equal QTest::newRow("should PASS 2") << qfloat16(1001) << qfloat16(1002); QTest::newRow("should FAIL 3") << qfloat16(98) << qfloat16(99); + QTest::newRow("should PASS 3") << tiny << -tiny; // ... which gets a bit unreliable near to the type's bounds - QTest::newRow("should PASS 3") << qfloat16(6e-5f) + qfloat16(6e-7f) << qfloat16(6e-5f) + qfloat16(11e-7f); - QTest::newRow("should FAIL 4") << qfloat16(6e-5f) - qfloat16(7e-7f) << qfloat16(6e-5f) - qfloat16(13e-7f); + QTest::newRow("should FAIL 4") << qfloat16(1.01e-3f) << qfloat16(0.99e-3f); QTest::newRow("should PASS 4") << qfloat16(6e4) + qfloat16(700) << qfloat16(6e4) + qfloat16(1200); QTest::newRow("should FAIL 5") << qfloat16(6e4) - qfloat16(600) << qfloat16(6e4) - qfloat16(1200); @@ -200,7 +209,7 @@ void tst_float::compareFloatTests() const // Create two more values // t2 differs from t1 by 1 ppm (part per million) // t3 differs from t1 by 200% - // we should consider that t1 == t2 and t1 != t3 + // We should consider that t1 == t2 and t1 != t3 (provided at least one is > 1e-5) const float t2 = t1 + (t1 / 1e6); const float t3 = 3 * t1; @@ -214,7 +223,7 @@ void tst_float::compareFloatTests_data() const { QTest::addColumn("t1"); QTest::newRow("1e0") << 1e0f; - QTest::newRow("1e-7") << 1e-7f; + QTest::newRow("1e-5") << 1e-5f; QTest::newRow("1e+7") << 1e+7f; } diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index cab6589984..84090c22ca 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** @@ -940,6 +940,14 @@ bool tst_Selftests::compareLine(const QString &logger, const QString &subdir, return true; } + if (EmulationDetector::isRunningArmOnX86() && subdir == QLatin1String("float")) { + // QEMU cheats at qfloat16, so outputs it as if it were a float. + if (actualLine.endsWith(QLatin1String("Actual (operandLeft) : 0.001")) + && expectedLine.endsWith(QLatin1String("Actual (operandLeft) : 0.000999"))) { + return true; + } + } + *errorMessage = msgMismatch(actualLine, expectedLine); return false; } -- cgit v1.2.3