summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/expected_float.txt
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2012-02-03 15:43:28 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-09 04:07:50 +0100
commit52744f505381c2840efbe1dc4858d422d32d9f32 (patch)
tree273b2cfda689912de42cc1cfa09f1b5822cfabb4 /tests/auto/testlib/selftests/expected_float.txt
parent7b7b58ae095e1f098a401f584aeefeb6e2a2fd43 (diff)
Improve float selftest
Correct a bug in the test and use unique names for data rows. The bug was that the test assumed that QCOMPARE for float values 100001 and 100002 would fail, but it actually succeeds. QCOMPARE for floats uses qFuzzyCompare(), which succeeds if the numbers differ by no more than 1/100,000th of the smaller value. Thus QCOMPARE(100001, 100002) passes, while QCOMPARE(99998, 99999) fails. Change-Id: Ia35d3126c2e3ebe91d64daa309048514a365d9fb Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/testlib/selftests/expected_float.txt')
-rw-r--r--tests/auto/testlib/selftests/expected_float.txt16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/auto/testlib/selftests/expected_float.txt b/tests/auto/testlib/selftests/expected_float.txt
index acd0aaa54a..81e4d7b067 100644
--- a/tests/auto/testlib/selftests/expected_float.txt
+++ b/tests/auto/testlib/selftests/expected_float.txt
@@ -1,26 +1,30 @@
********* Start testing of tst_float *********
Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
PASS : tst_float::initTestCase()
-FAIL! : tst_float::floatComparisons(should FAIL) Compared floats are not the same (fuzzy compare)
+FAIL! : tst_float::floatComparisons(should FAIL 1) Compared floats are not the same (fuzzy compare)
Actual (operandLeft): 1
Expected (operandRight): 3
Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(61)]
-FAIL! : tst_float::floatComparisons(should FAIL) Compared floats are not the same (fuzzy compare)
+FAIL! : tst_float::floatComparisons(should FAIL 2) Compared floats are not the same (fuzzy compare)
Actual (operandLeft): 1e-07
Expected (operandRight): 3e-07
Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(61)]
+FAIL! : tst_float::floatComparisons(should FAIL 3) Compared floats are not the same (fuzzy compare)
+ Actual (operandLeft): 99998
+ Expected (operandRight): 99999
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(61)]
FAIL! : tst_float::compareFloatTests(1e0) Compared floats are not the same (fuzzy compare)
Actual (t1): 1
Expected (t3): 3
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(100)]
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(104)]
FAIL! : tst_float::compareFloatTests(1e-7) Compared floats are not the same (fuzzy compare)
Actual (t1): 1e-07
Expected (t3): 3e-07
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(100)]
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(104)]
FAIL! : tst_float::compareFloatTests(1e+7) Compared floats are not the same (fuzzy compare)
Actual (t1): 1e+07
Expected (t3): 3e+07
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(100)]
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(104)]
PASS : tst_float::cleanupTestCase()
-Totals: 2 passed, 5 failed, 0 skipped
+Totals: 2 passed, 6 failed, 0 skipped
********* Finished testing of tst_float *********