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>
This commit is contained in:
parent
fa1b8442b8
commit
ab53f0f24e
@ -2485,6 +2485,20 @@ bool QTest::compare_helper(bool success, const char *failureMsg,
|
||||
return QTestResult::compare(success, failureMsg, val1, val2, actual, expected, file, line);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static bool floatingCompare(const T &t1, const T &t2)
|
||||
{
|
||||
switch (std::fpclassify(t1))
|
||||
{
|
||||
case FP_INFINITE:
|
||||
return (t1 < 0) == (t2 < 0) && std::fpclassify(t2) == FP_INFINITE;
|
||||
case FP_NAN:
|
||||
return std::fpclassify(t2) == FP_NAN;
|
||||
default:
|
||||
return qFuzzyCompare(t1, t2);
|
||||
}
|
||||
}
|
||||
|
||||
/*! \fn bool QTest::qCompare(const qfloat16 &t1, const qfloat16 &t2, const char *actual, const char *expected, const char *file, int line)
|
||||
\internal
|
||||
*/
|
||||
@ -2501,16 +2515,8 @@ bool QTest::qCompare(qfloat16 const &t1, qfloat16 const &t2, const char *actual,
|
||||
bool QTest::qCompare(float const &t1, float const &t2, const char *actual, const char *expected,
|
||||
const char *file, int line)
|
||||
{
|
||||
bool equal = false;
|
||||
int cl1 = std::fpclassify(t1);
|
||||
int cl2 = std::fpclassify(t2);
|
||||
if (cl1 == FP_INFINITE)
|
||||
equal = ((t1 < 0) == (t2 < 0)) && cl2 == FP_INFINITE;
|
||||
else if (cl1 == FP_NAN)
|
||||
equal = (cl2 == FP_NAN);
|
||||
else
|
||||
equal = qFuzzyCompare(t1, t2);
|
||||
return compare_helper(equal, "Compared floats are not the same (fuzzy compare)",
|
||||
return compare_helper(floatingCompare(t1, t2),
|
||||
"Compared floats are not the same (fuzzy compare)",
|
||||
toString(t1), toString(t2), actual, expected, file, line);
|
||||
}
|
||||
|
||||
@ -2520,16 +2526,8 @@ bool QTest::qCompare(float const &t1, float const &t2, const char *actual, const
|
||||
bool QTest::qCompare(double const &t1, double const &t2, const char *actual, const char *expected,
|
||||
const char *file, int line)
|
||||
{
|
||||
bool equal = false;
|
||||
int cl1 = std::fpclassify(t1);
|
||||
int cl2 = std::fpclassify(t2);
|
||||
if (cl1 == FP_INFINITE)
|
||||
equal = ((t1 < 0) == (t2 < 0)) && cl2 == FP_INFINITE;
|
||||
else if (cl1 == FP_NAN)
|
||||
equal = (cl2 == FP_NAN);
|
||||
else
|
||||
equal = qFuzzyCompare(t1, t2);
|
||||
return compare_helper(equal, "Compared doubles are not the same (fuzzy compare)",
|
||||
return compare_helper(floatingCompare(t1, t2),
|
||||
"Compared doubles are not the same (fuzzy compare)",
|
||||
toString(t1), toString(t2), actual, expected, file, line);
|
||||
}
|
||||
|
||||
@ -2607,7 +2605,7 @@ template <> Q_TESTLIB_EXPORT char *QTest::toString<TYPE>(const TYPE &t) \
|
||||
qstrncpy(msg, "nan", 128); \
|
||||
break; \
|
||||
default: \
|
||||
qsnprintf(msg, 128, #FORMAT, t); \
|
||||
qsnprintf(msg, 128, #FORMAT, double(t)); \
|
||||
massageExponent(msg); \
|
||||
break; \
|
||||
} \
|
||||
@ -2615,7 +2613,7 @@ template <> Q_TESTLIB_EXPORT char *QTest::toString<TYPE>(const TYPE &t) \
|
||||
}
|
||||
|
||||
TO_STRING_FLOAT(float, %g)
|
||||
TO_STRING_FLOAT(double, %.12lg)
|
||||
TO_STRING_FLOAT(double, %.12g)
|
||||
|
||||
template <> Q_TESTLIB_EXPORT char *QTest::toString<qfloat16>(const qfloat16 &t)
|
||||
{
|
||||
|
@ -8,15 +8,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)
|
||||
|
@ -1,8 +1,7 @@
|
||||
TAP version 13
|
||||
# tst_float
|
||||
ok 1 - initTestCase()
|
||||
ok 2 - doubleComparisons(should PASS 1)
|
||||
not ok 3 - doubleComparisons(should FAIL 1)
|
||||
not ok 2 - doubleComparisons(should FAIL 1)
|
||||
---
|
||||
type: QCOMPARE
|
||||
message: Compared doubles are not the same (fuzzy compare)
|
||||
@ -10,10 +9,11 @@ not ok 3 - doubleComparisons(should FAIL 1)
|
||||
found: 1 (operandLeft)
|
||||
expected: 3 (operandRight)
|
||||
actual: 1 (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
ok 3 - doubleComparisons(should PASS 1)
|
||||
not ok 4 - doubleComparisons(should FAIL 2)
|
||||
---
|
||||
type: QCOMPARE
|
||||
@ -22,9 +22,9 @@ not ok 4 - doubleComparisons(should FAIL 2)
|
||||
found: 1e-07 (operandLeft)
|
||||
expected: 3e-07 (operandRight)
|
||||
actual: 1e-07 (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
ok 5 - doubleComparisons(should PASS 2)
|
||||
not ok 6 - doubleComparisons(should FAIL 3)
|
||||
@ -35,9 +35,9 @@ not ok 6 - doubleComparisons(should FAIL 3)
|
||||
found: 999999999999 (operandLeft)
|
||||
expected: 999999999998 (operandRight)
|
||||
actual: 999999999999 (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
ok 7 - doubleComparisons(should PASS 3)
|
||||
not ok 8 - doubleComparisons(should FAIL 4)
|
||||
@ -48,9 +48,9 @@ not ok 8 - doubleComparisons(should FAIL 4)
|
||||
found: 9.99999999999e-311 (operandLeft)
|
||||
expected: 9.99999999997e-311 (operandRight)
|
||||
actual: 9.99999999999e-311 (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
ok 9 - doubleComparisons(should PASS 4)
|
||||
not ok 10 - doubleComparisons(should FAIL 5)
|
||||
@ -61,9 +61,9 @@ not ok 10 - doubleComparisons(should FAIL 5)
|
||||
found: 9.99999999999e+306 (operandLeft)
|
||||
expected: 9.99999999997e+306 (operandRight)
|
||||
actual: 9.99999999999e+306 (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
ok 11 - doubleComparisons(should PASS: NaN == NaN)
|
||||
not ok 12 - doubleComparisons(should FAIL: NaN != 0)
|
||||
@ -74,9 +74,9 @@ not ok 12 - doubleComparisons(should FAIL: NaN != 0)
|
||||
found: nan (operandLeft)
|
||||
expected: 0 (operandRight)
|
||||
actual: nan (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 13 - doubleComparisons(should FAIL: 0 != NaN)
|
||||
---
|
||||
@ -86,9 +86,9 @@ not ok 13 - doubleComparisons(should FAIL: 0 != NaN)
|
||||
found: 0 (operandLeft)
|
||||
expected: nan (operandRight)
|
||||
actual: 0 (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 14 - doubleComparisons(should FAIL: NaN != 1)
|
||||
---
|
||||
@ -98,9 +98,9 @@ not ok 14 - doubleComparisons(should FAIL: NaN != 1)
|
||||
found: nan (operandLeft)
|
||||
expected: 1 (operandRight)
|
||||
actual: nan (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 15 - doubleComparisons(should FAIL: 1 != NaN)
|
||||
---
|
||||
@ -110,9 +110,9 @@ not ok 15 - doubleComparisons(should FAIL: 1 != NaN)
|
||||
found: 1 (operandLeft)
|
||||
expected: nan (operandRight)
|
||||
actual: 1 (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
ok 16 - doubleComparisons(should PASS: inf == inf)
|
||||
ok 17 - doubleComparisons(should PASS: -inf == -inf)
|
||||
@ -124,9 +124,9 @@ not ok 18 - doubleComparisons(should FAIL: inf != -inf)
|
||||
found: inf (operandLeft)
|
||||
expected: -inf (operandRight)
|
||||
actual: inf (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 19 - doubleComparisons(should FAIL: -inf != inf)
|
||||
---
|
||||
@ -136,9 +136,9 @@ not ok 19 - doubleComparisons(should FAIL: -inf != inf)
|
||||
found: -inf (operandLeft)
|
||||
expected: inf (operandRight)
|
||||
actual: -inf (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 20 - doubleComparisons(should FAIL: inf != nan)
|
||||
---
|
||||
@ -148,9 +148,9 @@ not ok 20 - doubleComparisons(should FAIL: inf != nan)
|
||||
found: inf (operandLeft)
|
||||
expected: nan (operandRight)
|
||||
actual: inf (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 21 - doubleComparisons(should FAIL: nan != inf)
|
||||
---
|
||||
@ -160,9 +160,9 @@ not ok 21 - doubleComparisons(should FAIL: nan != inf)
|
||||
found: nan (operandLeft)
|
||||
expected: inf (operandRight)
|
||||
actual: nan (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 22 - doubleComparisons(should FAIL: -inf != nan)
|
||||
---
|
||||
@ -172,9 +172,9 @@ not ok 22 - doubleComparisons(should FAIL: -inf != nan)
|
||||
found: -inf (operandLeft)
|
||||
expected: nan (operandRight)
|
||||
actual: -inf (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 23 - doubleComparisons(should FAIL: nan != -inf)
|
||||
---
|
||||
@ -184,9 +184,9 @@ not ok 23 - doubleComparisons(should FAIL: nan != -inf)
|
||||
found: nan (operandLeft)
|
||||
expected: -inf (operandRight)
|
||||
actual: nan (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 24 - doubleComparisons(should FAIL: inf != 0)
|
||||
---
|
||||
@ -196,9 +196,9 @@ not ok 24 - doubleComparisons(should FAIL: inf != 0)
|
||||
found: inf (operandLeft)
|
||||
expected: 0 (operandRight)
|
||||
actual: inf (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 25 - doubleComparisons(should FAIL: 0 != inf)
|
||||
---
|
||||
@ -208,9 +208,9 @@ not ok 25 - doubleComparisons(should FAIL: 0 != inf)
|
||||
found: 0 (operandLeft)
|
||||
expected: inf (operandRight)
|
||||
actual: 0 (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 26 - doubleComparisons(should FAIL: -inf != 0)
|
||||
---
|
||||
@ -220,9 +220,9 @@ not ok 26 - doubleComparisons(should FAIL: -inf != 0)
|
||||
found: -inf (operandLeft)
|
||||
expected: 0 (operandRight)
|
||||
actual: -inf (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 27 - doubleComparisons(should FAIL: 0 != -inf)
|
||||
---
|
||||
@ -232,9 +232,9 @@ not ok 27 - doubleComparisons(should FAIL: 0 != -inf)
|
||||
found: 0 (operandLeft)
|
||||
expected: -inf (operandRight)
|
||||
actual: 0 (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 28 - doubleComparisons(should FAIL: inf != 1)
|
||||
---
|
||||
@ -244,9 +244,9 @@ not ok 28 - doubleComparisons(should FAIL: inf != 1)
|
||||
found: inf (operandLeft)
|
||||
expected: 1 (operandRight)
|
||||
actual: inf (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 29 - doubleComparisons(should FAIL: 1 != inf)
|
||||
---
|
||||
@ -256,9 +256,9 @@ not ok 29 - doubleComparisons(should FAIL: 1 != inf)
|
||||
found: 1 (operandLeft)
|
||||
expected: inf (operandRight)
|
||||
actual: 1 (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 30 - doubleComparisons(should FAIL: -inf != 1)
|
||||
---
|
||||
@ -268,9 +268,9 @@ not ok 30 - doubleComparisons(should FAIL: -inf != 1)
|
||||
found: -inf (operandLeft)
|
||||
expected: 1 (operandRight)
|
||||
actual: -inf (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 31 - doubleComparisons(should FAIL: 1 != -inf)
|
||||
---
|
||||
@ -280,9 +280,9 @@ not ok 31 - doubleComparisons(should FAIL: 1 != -inf)
|
||||
found: 1 (operandLeft)
|
||||
expected: -inf (operandRight)
|
||||
actual: 1 (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 32 - doubleComparisons(should FAIL: inf != max)
|
||||
---
|
||||
@ -292,9 +292,9 @@ not ok 32 - doubleComparisons(should FAIL: inf != max)
|
||||
found: inf (operandLeft)
|
||||
expected: 1.79769313486e+308 (operandRight)
|
||||
actual: inf (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 33 - doubleComparisons(should FAIL: inf != -max)
|
||||
---
|
||||
@ -304,9 +304,9 @@ not ok 33 - doubleComparisons(should FAIL: inf != -max)
|
||||
found: inf (operandLeft)
|
||||
expected: -1.79769313486e+308 (operandRight)
|
||||
actual: inf (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 34 - doubleComparisons(should FAIL: max != inf)
|
||||
---
|
||||
@ -316,9 +316,9 @@ not ok 34 - doubleComparisons(should FAIL: max != inf)
|
||||
found: 1.79769313486e+308 (operandLeft)
|
||||
expected: inf (operandRight)
|
||||
actual: 1.79769313486e+308 (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 35 - doubleComparisons(should FAIL: -max != inf)
|
||||
---
|
||||
@ -328,9 +328,9 @@ not ok 35 - doubleComparisons(should FAIL: -max != inf)
|
||||
found: -1.79769313486e+308 (operandLeft)
|
||||
expected: inf (operandRight)
|
||||
actual: -1.79769313486e+308 (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 36 - doubleComparisons(should FAIL: -inf != max)
|
||||
---
|
||||
@ -340,9 +340,9 @@ not ok 36 - doubleComparisons(should FAIL: -inf != max)
|
||||
found: -inf (operandLeft)
|
||||
expected: 1.79769313486e+308 (operandRight)
|
||||
actual: -inf (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 37 - doubleComparisons(should FAIL: -inf != -max)
|
||||
---
|
||||
@ -352,9 +352,9 @@ not ok 37 - doubleComparisons(should FAIL: -inf != -max)
|
||||
found: -inf (operandLeft)
|
||||
expected: -1.79769313486e+308 (operandRight)
|
||||
actual: -inf (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 38 - doubleComparisons(should FAIL: max != -inf)
|
||||
---
|
||||
@ -364,9 +364,9 @@ not ok 38 - doubleComparisons(should FAIL: max != -inf)
|
||||
found: 1.79769313486e+308 (operandLeft)
|
||||
expected: -inf (operandRight)
|
||||
actual: 1.79769313486e+308 (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 39 - doubleComparisons(should FAIL: -max != -inf)
|
||||
---
|
||||
@ -376,9 +376,9 @@ not ok 39 - doubleComparisons(should FAIL: -max != -inf)
|
||||
found: -1.79769313486e+308 (operandLeft)
|
||||
expected: -inf (operandRight)
|
||||
actual: -1.79769313486e+308 (operandLeft)
|
||||
at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
|
||||
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: 54
|
||||
line: 103
|
||||
...
|
||||
not ok 40 - floatComparisons(should FAIL 1)
|
||||
---
|
||||
@ -388,9 +388,9 @@ 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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
ok 41 - floatComparisons(should PASS 1)
|
||||
not ok 42 - floatComparisons(should FAIL 2)
|
||||
@ -401,9 +401,9 @@ not ok 42 - floatComparisons(should FAIL 2)
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
ok 43 - floatComparisons(should PASS 2)
|
||||
not ok 44 - floatComparisons(should FAIL 3)
|
||||
@ -414,9 +414,9 @@ 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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
ok 45 - floatComparisons(should PASS 3)
|
||||
not ok 46 - floatComparisons(should FAIL 4)
|
||||
@ -427,9 +427,9 @@ not ok 46 - floatComparisons(should FAIL 4)
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
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:127)
|
||||
at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 127
|
||||
line: 137
|
||||
...
|
||||
ok 78 - float16Comparisons(should SUCCEED 1)
|
||||
not ok 79 - float16Comparisons(should FAIL 1)
|
||||
@ -768,9 +768,9 @@ not ok 79 - 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:200)
|
||||
at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 200
|
||||
line: 171
|
||||
...
|
||||
not ok 80 - float16Comparisons(should FAIL 2)
|
||||
---
|
||||
@ -780,9 +780,9 @@ not ok 80 - float16Comparisons(should FAIL 2)
|
||||
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:200)
|
||||
at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 200
|
||||
line: 171
|
||||
...
|
||||
not ok 81 - float16Comparisons(should FAIL 3)
|
||||
---
|
||||
@ -792,9 +792,9 @@ not ok 81 - 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:200)
|
||||
at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 200
|
||||
line: 171
|
||||
...
|
||||
ok 82 - float16Comparisons(should SUCCEED 2)
|
||||
not ok 83 - compareFloatTests(1e0)
|
||||
@ -805,9 +805,9 @@ not ok 83 - compareFloatTests(1e0)
|
||||
found: 1 (t1)
|
||||
expected: 3 (t3)
|
||||
actual: 1 (t1)
|
||||
at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:245)
|
||||
at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:216)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 245
|
||||
line: 216
|
||||
...
|
||||
not ok 84 - compareFloatTests(1e-7)
|
||||
---
|
||||
@ -817,9 +817,9 @@ not ok 84 - 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:245)
|
||||
at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:216)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 245
|
||||
line: 216
|
||||
...
|
||||
not ok 85 - compareFloatTests(1e+7)
|
||||
---
|
||||
@ -829,9 +829,9 @@ not ok 85 - 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:245)
|
||||
at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:216)
|
||||
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
|
||||
line: 245
|
||||
line: 216
|
||||
...
|
||||
ok 86 - cleanupTestCase()
|
||||
1..86
|
||||
|
@ -1,11 +1,11 @@
|
||||
##teamcity[testSuiteStarted name='tst_float' flowId='tst_float']
|
||||
##teamcity[testStarted name='initTestCase()' flowId='tst_float']
|
||||
##teamcity[testFinished name='initTestCase()' flowId='tst_float']
|
||||
##teamcity[testStarted name='doubleComparisons(should PASS 1)' flowId='tst_float']
|
||||
##teamcity[testFinished name='doubleComparisons(should PASS 1)' flowId='tst_float']
|
||||
##teamcity[testStarted name='doubleComparisons(should FAIL 1)' flowId='tst_float']
|
||||
##teamcity[testFailed name='doubleComparisons(should FAIL 1)' 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) : 1|n Expected (operandRight): 3' flowId='tst_float']
|
||||
##teamcity[testFinished name='doubleComparisons(should FAIL 1)' flowId='tst_float']
|
||||
##teamcity[testStarted name='doubleComparisons(should PASS 1)' flowId='tst_float']
|
||||
##teamcity[testFinished name='doubleComparisons(should PASS 1)' flowId='tst_float']
|
||||
##teamcity[testStarted name='doubleComparisons(should FAIL 2)' flowId='tst_float']
|
||||
##teamcity[testFailed name='doubleComparisons(should FAIL 2)' 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-07|n Expected (operandRight): 3e-07' flowId='tst_float']
|
||||
##teamcity[testFinished name='doubleComparisons(should FAIL 2)' flowId='tst_float']
|
||||
|
@ -1,11 +1,11 @@
|
||||
********* Start testing of tst_float *********
|
||||
Config: Using QtTest library
|
||||
PASS : tst_float::initTestCase()
|
||||
PASS : tst_float::doubleComparisons(should PASS 1)
|
||||
FAIL! : tst_float::doubleComparisons(should FAIL 1) Compared doubles are not the same (fuzzy compare)
|
||||
Actual (operandLeft) : 1
|
||||
Expected (operandRight): 3
|
||||
Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
|
||||
PASS : tst_float::doubleComparisons(should PASS 1)
|
||||
FAIL! : tst_float::doubleComparisons(should FAIL 2) Compared doubles are not the same (fuzzy compare)
|
||||
Actual (operandLeft) : 1e-07
|
||||
Expected (operandRight): 3e-07
|
||||
|
@ -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)
|
||||
|
@ -46,6 +46,55 @@ private slots:
|
||||
void compareFloatTests_data() const;
|
||||
};
|
||||
|
||||
template<typename F>
|
||||
static void nonFinite_data(F zero, F one)
|
||||
{
|
||||
using Bounds = std::numeric_limits<F>;
|
||||
|
||||
// QCOMPARE special-cases non-finite values
|
||||
if (Bounds::has_quiet_NaN) {
|
||||
const F nan = Bounds::quiet_NaN();
|
||||
QTest::newRow("should PASS: NaN == NaN") << nan << nan;
|
||||
QTest::newRow("should FAIL: NaN != 0") << nan << zero;
|
||||
QTest::newRow("should FAIL: 0 != NaN") << zero << nan;
|
||||
QTest::newRow("should FAIL: NaN != 1") << nan << one;
|
||||
QTest::newRow("should FAIL: 1 != NaN") << one << nan;
|
||||
}
|
||||
|
||||
if (Bounds::has_infinity) {
|
||||
const F uge = Bounds::infinity();
|
||||
QTest::newRow("should PASS: inf == inf") << uge << uge;
|
||||
QTest::newRow("should PASS: -inf == -inf") << -uge << -uge;
|
||||
QTest::newRow("should FAIL: inf != -inf") << uge << -uge;
|
||||
QTest::newRow("should FAIL: -inf != inf") << -uge << uge;
|
||||
if (Bounds::has_quiet_NaN) {
|
||||
const F nan = Bounds::quiet_NaN();
|
||||
QTest::newRow("should FAIL: inf != nan") << uge << nan;
|
||||
QTest::newRow("should FAIL: nan != inf") << nan << uge;
|
||||
QTest::newRow("should FAIL: -inf != nan") << -uge << nan;
|
||||
QTest::newRow("should FAIL: nan != -inf") << nan << -uge;
|
||||
}
|
||||
QTest::newRow("should FAIL: inf != 0") << uge << zero;
|
||||
QTest::newRow("should FAIL: 0 != inf") << zero << uge;
|
||||
QTest::newRow("should FAIL: -inf != 0") << -uge << zero;
|
||||
QTest::newRow("should FAIL: 0 != -inf") << zero << -uge;
|
||||
QTest::newRow("should FAIL: inf != 1") << uge << one;
|
||||
QTest::newRow("should FAIL: 1 != inf") << one << uge;
|
||||
QTest::newRow("should FAIL: -inf != 1") << -uge << one;
|
||||
QTest::newRow("should FAIL: 1 != -inf") << one << -uge;
|
||||
|
||||
const F big = Bounds::max();
|
||||
QTest::newRow("should FAIL: inf != max") << uge << big;
|
||||
QTest::newRow("should FAIL: inf != -max") << uge << -big;
|
||||
QTest::newRow("should FAIL: max != inf") << big << uge;
|
||||
QTest::newRow("should FAIL: -max != inf") << -big << uge;
|
||||
QTest::newRow("should FAIL: -inf != max") << -uge << big;
|
||||
QTest::newRow("should FAIL: -inf != -max") << -uge << -big;
|
||||
QTest::newRow("should FAIL: max != -inf") << big << -uge;
|
||||
QTest::newRow("should FAIL: -max != -inf") << -big << -uge;
|
||||
}
|
||||
}
|
||||
|
||||
void tst_float::doubleComparisons() const
|
||||
{
|
||||
QFETCH(double, operandLeft);
|
||||
@ -58,65 +107,26 @@ void tst_float::doubleComparisons_data() const
|
||||
{
|
||||
QTest::addColumn<double>("operandLeft");
|
||||
QTest::addColumn<double>("operandRight");
|
||||
double zero(0.), one(1.);
|
||||
|
||||
QTest::newRow("should PASS 1") << 0. << 0.;
|
||||
QTest::newRow("should FAIL 1") << 1.00000 << 3.00000;
|
||||
QTest::newRow("should FAIL 2") << 1.00000e-7 << 3.00000e-7;
|
||||
QTest::newRow("should FAIL 1") << one << 3.;
|
||||
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.
|
||||
|
||||
QTest::newRow("should PASS 2") << 1e12 + 1. << 1e12 + 2.;
|
||||
QTest::newRow("should FAIL 3") << 1e12 - 1. << 1e12 - 2.;
|
||||
QTest::newRow("should PASS 2") << 1e12 + one << 1e12 + 2.;
|
||||
QTest::newRow("should FAIL 3") << 1e12 - one << 1e12 - 2.;
|
||||
// ... 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 PASS 4") << 1e307 + 1e295 << 1e307 + 2e295;
|
||||
QTest::newRow("should FAIL 5") << 1e307 - 1e295 << 1e307 - 3e295;
|
||||
|
||||
// QCOMPARE special-cases non-finite values
|
||||
if (std::numeric_limits<double>::has_quiet_NaN) {
|
||||
const double nan = std::numeric_limits<double>::quiet_NaN();
|
||||
QTest::newRow("should PASS: NaN == NaN") << nan << nan;
|
||||
QTest::newRow("should FAIL: NaN != 0") << nan << 0.;
|
||||
QTest::newRow("should FAIL: 0 != NaN") << 0. << nan;
|
||||
QTest::newRow("should FAIL: NaN != 1") << nan << 1.;
|
||||
QTest::newRow("should FAIL: 1 != NaN") << 1. << nan;
|
||||
}
|
||||
if (std::numeric_limits<double>::has_infinity) {
|
||||
const double uge = std::numeric_limits<double>::infinity();
|
||||
QTest::newRow("should PASS: inf == inf") << uge << uge;
|
||||
QTest::newRow("should PASS: -inf == -inf") << -uge << -uge;
|
||||
QTest::newRow("should FAIL: inf != -inf") << uge << -uge;
|
||||
QTest::newRow("should FAIL: -inf != inf") << -uge << uge;
|
||||
if (std::numeric_limits<double>::has_quiet_NaN) {
|
||||
const double nan = std::numeric_limits<double>::quiet_NaN();
|
||||
QTest::newRow("should FAIL: inf != nan") << uge << nan;
|
||||
QTest::newRow("should FAIL: nan != inf") << nan << uge;
|
||||
QTest::newRow("should FAIL: -inf != nan") << -uge << nan;
|
||||
QTest::newRow("should FAIL: nan != -inf") << nan << -uge;
|
||||
}
|
||||
QTest::newRow("should FAIL: inf != 0") << uge << 0.;
|
||||
QTest::newRow("should FAIL: 0 != inf") << 0. << uge;
|
||||
QTest::newRow("should FAIL: -inf != 0") << -uge << 0.;
|
||||
QTest::newRow("should FAIL: 0 != -inf") << 0. << -uge;
|
||||
QTest::newRow("should FAIL: inf != 1") << uge << 1.;
|
||||
QTest::newRow("should FAIL: 1 != inf") << 1. << uge;
|
||||
QTest::newRow("should FAIL: -inf != 1") << -uge << 1.;
|
||||
QTest::newRow("should FAIL: 1 != -inf") << 1. << -uge;
|
||||
|
||||
const double big = std::numeric_limits<double>::max();
|
||||
QTest::newRow("should FAIL: inf != max") << uge << big;
|
||||
QTest::newRow("should FAIL: inf != -max") << uge << -big;
|
||||
QTest::newRow("should FAIL: max != inf") << big << uge;
|
||||
QTest::newRow("should FAIL: -max != inf") << -big << uge;
|
||||
QTest::newRow("should FAIL: -inf != max") << -uge << big;
|
||||
QTest::newRow("should FAIL: -inf != -max") << -uge << -big;
|
||||
QTest::newRow("should FAIL: max != -inf") << big << -uge;
|
||||
QTest::newRow("should FAIL: -max != -inf") << -big << -uge;
|
||||
}
|
||||
nonFinite_data(zero, one);
|
||||
}
|
||||
|
||||
void tst_float::floatComparisons() const
|
||||
@ -131,65 +141,26 @@ void tst_float::floatComparisons_data() const
|
||||
{
|
||||
QTest::addColumn<float>("operandLeft");
|
||||
QTest::addColumn<float>("operandRight");
|
||||
float zero(0.f), one(1.f);
|
||||
|
||||
QTest::newRow("should FAIL 1") << 1.00000f << 3.00000f;
|
||||
QTest::newRow("should PASS 1") << 0.f << 0.f;
|
||||
QTest::newRow("should FAIL 2") << 1.00000e-7f << 3.00000e-7f;
|
||||
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;
|
||||
|
||||
// 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.
|
||||
|
||||
QTest::newRow("should PASS 2") << 1e5f + 1.f << 1e5f + 2.f;
|
||||
QTest::newRow("should FAIL 3") << 1e5f - 1.f << 1e5f - 2.f;
|
||||
QTest::newRow("should PASS 2") << 1e5f + one << 1e5f + 2.f;
|
||||
QTest::newRow("should FAIL 3") << 1e5f - one << 1e5f - 2.f;
|
||||
// ... 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 PASS 4") << 1e38f + 1e33f << 1e38f + 2e33f;
|
||||
QTest::newRow("should FAIL 5") << 1e38f - 1e33f << 1e38f - 3e33f;
|
||||
|
||||
// QCOMPARE special-cases non-finite values
|
||||
if (std::numeric_limits<float>::has_quiet_NaN) {
|
||||
const float nan = std::numeric_limits<float>::quiet_NaN();
|
||||
QTest::newRow("should PASS: NaN == NaN") << nan << nan;
|
||||
QTest::newRow("should FAIL: NaN != 0") << nan << 0.f;
|
||||
QTest::newRow("should FAIL: 0 != NaN") << 0.f << nan;
|
||||
QTest::newRow("should FAIL: NaN != 1") << nan << 1.f;
|
||||
QTest::newRow("should FAIL: 1 != NaN") << 1.f << nan;
|
||||
}
|
||||
if (std::numeric_limits<float>::has_infinity) {
|
||||
const float uge = std::numeric_limits<float>::infinity();
|
||||
QTest::newRow("should PASS: inf == inf") << uge << uge;
|
||||
QTest::newRow("should PASS: -inf == -inf") << -uge << -uge;
|
||||
QTest::newRow("should FAIL: inf != -inf") << uge << -uge;
|
||||
QTest::newRow("should FAIL: -inf != inf") << -uge << uge;
|
||||
if (std::numeric_limits<float>::has_quiet_NaN) {
|
||||
const float nan = std::numeric_limits<float>::quiet_NaN();
|
||||
QTest::newRow("should FAIL: inf != nan") << uge << nan;
|
||||
QTest::newRow("should FAIL: nan != inf") << nan << uge;
|
||||
QTest::newRow("should FAIL: -inf != nan") << -uge << nan;
|
||||
QTest::newRow("should FAIL: nan != -inf") << nan << -uge;
|
||||
}
|
||||
QTest::newRow("should FAIL: inf != 0") << uge << 0.f;
|
||||
QTest::newRow("should FAIL: 0 != inf") << 0.f << uge;
|
||||
QTest::newRow("should FAIL: -inf != 0") << -uge << 0.f;
|
||||
QTest::newRow("should FAIL: 0 != -inf") << 0.f << -uge;
|
||||
QTest::newRow("should FAIL: inf != 1") << uge << 1.f;
|
||||
QTest::newRow("should FAIL: 1 != inf") << 1.f << uge;
|
||||
QTest::newRow("should FAIL: -inf != 1") << -uge << 1.f;
|
||||
QTest::newRow("should FAIL: 1 != -inf") << 1.f << -uge;
|
||||
|
||||
const float big = std::numeric_limits<float>::max();
|
||||
QTest::newRow("should FAIL: inf != max") << uge << big;
|
||||
QTest::newRow("should FAIL: inf != -max") << uge << -big;
|
||||
QTest::newRow("should FAIL: max != inf") << big << uge;
|
||||
QTest::newRow("should FAIL: -max != inf") << -big << uge;
|
||||
QTest::newRow("should FAIL: -inf != max") << -uge << big;
|
||||
QTest::newRow("should FAIL: -inf != -max") << -uge << -big;
|
||||
QTest::newRow("should FAIL: max != -inf") << big << -uge;
|
||||
QTest::newRow("should FAIL: -max != -inf") << -big << -uge;
|
||||
}
|
||||
nonFinite_data(zero, one);
|
||||
}
|
||||
|
||||
void tst_float::float16Comparisons() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user