diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2019-02-21 20:53:15 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-03-04 10:01:35 +0000 |
commit | ab53f0f24e6ed01124b189a285686087a337b31b (patch) | |
tree | 4b3d0de35ea34f079d978edce367e0c51769dad7 /tests/auto/testlib/selftests/expected_float.xml | |
parent | fa1b8442b8e6d01d0352a062a6aa8df6956f77f9 (diff) |
QtTestLib: unify handling of float and double using suitable templates
The QTest::qCompare() implementations were almost duplicates; pull the
common code out into a templated version. Tweaked the
QTest::toString() specialization for float and double (a macro) and
fixed a bous modifier in double's format.
The doubleComparisons and floatComparisons tests in the tst_float.cpp
selftest shared a large block of tests in common, aside from the
difference of type. Break this out into a templated static function
to save duplication.
This prepares the way for using the same templated code for qfloat16.
Change-Id: I2823fd006910c5ff88335d625d1fa05cb7753513
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/testlib/selftests/expected_float.xml')
-rw-r--r-- | tests/auto/testlib/selftests/expected_float.xml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/testlib/selftests/expected_float.xml b/tests/auto/testlib/selftests/expected_float.xml index 65d2c5ad96..b8e1a23616 100644 --- a/tests/auto/testlib/selftests/expected_float.xml +++ b/tests/auto/testlib/selftests/expected_float.xml @@ -10,15 +10,15 @@ <Duration msecs="0"/> </TestFunction> <TestFunction name="doubleComparisons"> -<Incident type="pass" file="" line="0"> - <DataTag><![CDATA[should PASS 1]]></DataTag> -</Incident> <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0"> <DataTag><![CDATA[should FAIL 1]]></DataTag> <Description><![CDATA[Compared doubles are not the same (fuzzy compare) Actual (operandLeft) : 1 Expected (operandRight): 3]]></Description> </Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[should PASS 1]]></DataTag> +</Incident> <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0"> <DataTag><![CDATA[should FAIL 2]]></DataTag> <Description><![CDATA[Compared doubles are not the same (fuzzy compare) |