From 9e83d268d6e0bd492fafad823a47cef57b7916c5 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Wed, 22 Apr 2020 20:06:16 +0200 Subject: Fix data corruption regression in QJsonObject::erase() The internal removeAt(index) method was implemented as taking cbor indexes directly, in contrast to the other ...At(index) methods. Fixes: QTBUG-83695 Change-Id: I16597eb6db1cf71e1585c041caa81bf8f7a75303 Reviewed-by: Thiago Macieira --- tests/auto/corelib/serialization/json/tst_qtjson.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/serialization/json/tst_qtjson.cpp b/tests/auto/corelib/serialization/json/tst_qtjson.cpp index 7da20772f8..e5d909b9a7 100644 --- a/tests/auto/corelib/serialization/json/tst_qtjson.cpp +++ b/tests/auto/corelib/serialization/json/tst_qtjson.cpp @@ -927,9 +927,16 @@ void tst_QtJson::testObjectIteration() QCOMPARE(object, object2); QJsonObject::iterator it = object2.find(QString::number(5)); + QJsonValue val = *it; object2.erase(it); QCOMPARE(object.size(), 10); QCOMPARE(object2.size(), 9); + + for (QJsonObject::const_iterator it = object2.constBegin(); it != object2.constEnd(); ++it) { + QJsonValue value = it.value(); + QVERIFY(it.value() != val); + QCOMPARE((double)it.key().toInt(), value.toDouble()); + } } { -- cgit v1.2.3 From 52a2505672cbb1ca8b5b32f7bc1259485c65483b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Apr 2020 13:58:33 -0300 Subject: QCborValue: avoid signed integer oveflows when decoding time_t QDateTime::fromSecsSinceEpoch() multiplies by 1000 but does not check for overflow. That means we must do so in QCborValue validation. We can't use mul_overflow on 32-bit platforms, so we do a compare- and-branch there. For 64-bit platforms, we prefer to do the multiplication with checked overflow, as the common case is that it will not overflow and we'll need the multiplication anyway. Change-Id: Ibdc95e9af7bd456a94ecfffd16060cba6f1c86b8 Reviewed-by: Edward Welbourne --- .../serialization/qcborvalue/tst_qcborvalue.cpp | 109 +++++++++++++++++++++ 1 file changed, 109 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp index 64321c11fa..0b3046fbdc 100644 --- a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp +++ b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp @@ -106,6 +106,8 @@ private slots: void fromCborStreamReaderIODevice(); void validation_data(); void validation(); + void extendedTypeValidation_data(); + void extendedTypeValidation(); void hugeDeviceValidation_data(); void hugeDeviceValidation(); void recursionLimit_data(); @@ -118,6 +120,68 @@ private slots: void streamVariantSerialization(); }; +namespace SimpleEncodeToCbor { +inline size_t lengthOf(int) +{ + return 1; // encode as byte +} + +template inline size_t lengthOf(T) +{ + return sizeof(T); +} + +static void encodeOneAt(char *ptr, int v) +{ + // encode as byte + *ptr = char(v); +} + +template +static typename std::enable_if::value>::type +encodeOneAt(char *ptr, T v) +{ + qToBigEndian(v, ptr); +} + +template +static typename std::enable_if::value || + std::is_same::value>::type +encodeOneAt(char *ptr, T v) +{ + typename QIntegerForSizeof::Unsigned u; + memcpy(&u, &v, sizeof(u)); + qToBigEndian(u, ptr); +} + +static char *encodeAt(char *ptr) +{ + return ptr; +} + +template +static char *encodeAt(char *ptr, Arg0 a0, Args... a) +{ + encodeOneAt(ptr, a0); + return encodeAt(ptr + lengthOf(a0), a...); +} + +} // namespace SimpleEncodetoCbor + +template +static QByteArray encode(Args... a) +{ + // this would be much easier with C++17 fold expressions... + using namespace SimpleEncodeToCbor; + using namespace std; + size_t lengths[] = { lengthOf(a)... }; + size_t total = accumulate(begin(lengths), end(lengths), size_t(0), plus{}); + QByteArray result(QByteArray::size_type(total), Qt::Uninitialized); + char *ptr = result.data(); + encodeAt(ptr, a...); + return result; +} + // Get the validation data from TinyCBOR (see src/3rdparty/tinycbor/tests/parser/data.cpp) #include "data.cpp" @@ -1882,6 +1946,51 @@ void tst_QCborValue::validation() } } +void tst_QCborValue::extendedTypeValidation_data() +{ + QTest::addColumn("data"); + QTest::addColumn("expected"); + + // QDateTime currently stores time in milliseconds, so make sure + // we don't overflow + { + quint64 limit = std::numeric_limits::max() / 1000; + QTest::newRow("UnixTime_t:integer-overflow-positive") + << encode(0xc1, 0x1b, limit + 1) + << QCborValue(QCborKnownTags::UnixTime_t, qint64(limit) + 1); + QTest::newRow("UnixTime_t:integer-overflow-negative") + << encode(0xc1, 0x3b, limit) + << QCborValue(QCborKnownTags::UnixTime_t, -qint64(limit) - 1); + + double fplimit = std::numeric_limits::min() / (-1000.); // 2^63 ms + QTest::newRow("UnixTime_t:fp-overflow-positive") + << encode(0xc1, 0xfb, fplimit) + << QCborValue(QCborKnownTags::UnixTime_t, fplimit); + QTest::newRow("UnixTime_t:fp-overflow-negative") + << encode(0xc1, 0xfb, -fplimit) + << QCborValue(QCborKnownTags::UnixTime_t, -fplimit); + } +} + +void tst_QCborValue::extendedTypeValidation() +{ + QFETCH(QByteArray, data); + QFETCH(QCborValue, expected); + + QCborParserError error; + QCborValue decoded = QCborValue::fromCbor(data, &error); + QVERIFY2(error.error == QCborError(), qPrintable(error.errorString())); + QCOMPARE(error.offset, data.size()); + QCOMPARE(decoded, expected); + + QByteArray encoded = decoded.toCbor(); +#if QT_VERSION < QT_VERSION_CHECK(6,0,0) + // behavior change, see qdatetime.cpp:fromIsoTimeString + QEXPECT_FAIL("DateTime:Null-at-19", "QDateTime parsing fixed, but only in 6.0", Abort); +#endif + QCOMPARE(encoded, data); +} + void tst_QCborValue::hugeDeviceValidation_data() { addValidationHugeDevice(MaxByteArraySize + 1, MaxStringSize + 1); -- cgit v1.2.3 From 2a53017df488b3cedbfbf5a56bf105b9fc5392fa Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Apr 2020 14:00:05 -0300 Subject: QCborValue: add an extra check against producing invalid ISO dates By QCborValue design, we store the textual representation in ISO format, equivalent of CBOR tag 0, which isn't allowed to have negative years or beyond year 10000. Change-Id: Ibdc95e9af7bd456a94ecfffd16060ccff359c296 Reviewed-by: Ulf Hermann --- .../corelib/serialization/qcborvalue/tst_qcborvalue.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp index 0b3046fbdc..d035ca4ee5 100644 --- a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp +++ b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp @@ -1970,6 +1970,21 @@ void tst_QCborValue::extendedTypeValidation_data() << encode(0xc1, 0xfb, -fplimit) << QCborValue(QCborKnownTags::UnixTime_t, -fplimit); } + + // But in fact, QCborValue stores date/times as their ISO textual + // representation, which means it can't represent dates before year 1 or + // after year 9999. + { + QDateTime dt(QDate(-1, 1, 1), QTime(0, 0), Qt::UTC); + QTest::newRow("UnixTime_t:negative-year") + << encode(0xc1, 0x3b, quint64(-dt.toSecsSinceEpoch()) - 1) + << QCborValue(QCborKnownTags::UnixTime_t, dt.toSecsSinceEpoch()); + + dt.setDate(QDate(10000, 1, 1)); + QTest::newRow("UnixTime_t:year10k") + << encode(0xc1, 0x1b, quint64(dt.toSecsSinceEpoch())) + << QCborValue(QCborKnownTags::UnixTime_t, dt.toSecsSinceEpoch()); + } } void tst_QCborValue::extendedTypeValidation() -- cgit v1.2.3 From 8366c06d46f63b12b88abaddb0ff7a6b6dda75a4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Apr 2020 15:13:14 -0300 Subject: QCborValue: add tests of parsing invalid ISO date-time strings We rely on QDateTime::fromString being proper, so this is not extensive testing. Change-Id: Ibdc95e9af7bd456a94ecfffd160610cdac5d62e1 Reviewed-by: Thiago Macieira Reviewed-by: Edward Welbourne --- .../serialization/qcborvalue/tst_qcborvalue.cpp | 76 ++++++++++++++++++++-- 1 file changed, 72 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp index d035ca4ee5..e8acd29bbc 100644 --- a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp +++ b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp @@ -126,20 +126,36 @@ inline size_t lengthOf(int) return 1; // encode as byte } +template inline size_t lengthOf(const char (&)[N]) +{ + return N - 1; +} + + +inline size_t lengthOf(const char *str) +{ + return strlen(str); +} + template inline size_t lengthOf(T) { return sizeof(T); } -static void encodeOneAt(char *ptr, int v) +static void encodeOneAt(char *ptr, int v, size_t) { // encode as byte *ptr = char(v); } +static void encodeOneAt(char *ptr, const char *v, size_t size) +{ + memcpy(ptr, v, size); +} + template static typename std::enable_if::value>::type -encodeOneAt(char *ptr, T v) +encodeOneAt(char *ptr, T v, size_t) { qToBigEndian(v, ptr); } @@ -147,7 +163,7 @@ encodeOneAt(char *ptr, T v) template static typename std::enable_if::value || std::is_same::value>::type -encodeOneAt(char *ptr, T v) +encodeOneAt(char *ptr, T v, size_t) { typename QIntegerForSizeof::Unsigned u; memcpy(&u, &v, sizeof(u)); @@ -162,7 +178,7 @@ static char *encodeAt(char *ptr) template static char *encodeAt(char *ptr, Arg0 a0, Args... a) { - encodeOneAt(ptr, a0); + encodeOneAt(ptr, a0, lengthOf(a0)); return encodeAt(ptr + lengthOf(a0), a...); } @@ -1778,6 +1794,15 @@ void tst_QCborValue::fromCbor_data() QTest::newRow("DateTime:NoMilli") << QCborValue(QDateTime::fromSecsSinceEpoch(1515565477, Qt::UTC)) << raw("\xc0\x74" "2018-01-10T06:24:37Z"); + // date-only is only permitted local time + QTest::newRow("DateTime:NoTime:Local") << QCborValue(QDateTime(QDate(2020, 4, 15), QTime(0, 0), Qt::LocalTime)) + << raw("\xc0\x6a" "2020-04-15"); + QTest::newRow("DateTime:24:00:00") << QCborValue(QDateTime(QDate(2020, 4, 16), QTime(0, 0), Qt::UTC)) + << raw("\xc0\x74" "2020-04-15T24:00:00Z"); + QTest::newRow("DateTime:+00:00") << QCborValue(QDateTime::fromMSecsSinceEpoch(1515565477125, Qt::UTC)) + << raw("\xc0\x78\x1d" "2018-01-10T06:24:37.125+00:00"); + QTest::newRow("DateTime:+01:00") << QCborValue(QDateTime::fromMSecsSinceEpoch(1515565477125, Qt::OffsetFromUTC, 60*60)) + << raw("\xc0\x78\x1d" "2018-01-10T07:24:37.125+01:00"); QTest::newRow("UnixTime_t:Integer") << QCborValue(QDateTime::fromSecsSinceEpoch(1515565477, Qt::UTC)) << raw("\xc1\x1a\x5a\x55\xb1\xa5"); QTest::newRow("UnixTime_t:Double") << QCborValue(QDateTime::fromMSecsSinceEpoch(1515565477125, Qt::UTC)) @@ -1985,6 +2010,49 @@ void tst_QCborValue::extendedTypeValidation_data() << encode(0xc1, 0x1b, quint64(dt.toSecsSinceEpoch())) << QCborValue(QCborKnownTags::UnixTime_t, dt.toSecsSinceEpoch()); } + + // Invalid ISO date/time strings + { + auto add = [](const char *tag, const char *str) { + QByteArray raw; + if (strlen(str) < 0x18) + raw = encode(0xc0, 0x60 + int(strlen(str)), str); + else + raw = encode(0xc0, 0x78, quint8(strlen(str)), str); + QTest::addRow("DateTime:%s", tag) + << raw << QCborValue(QCborKnownTags::DateTimeString, QString(str)); + }; + // tst_QDateTime::fromStringDateFormat has more tests + add("junk", "jjj"); + add("zoned-date-only", "2020-04-15Z"); + add("month-13", "2020-13-01T00:00:00Z"); + add("negative-month", "2020--1-01T00:00:00Z"); + add("jan-32", "2020-01-32T00:00:00Z"); + add("apr-31", "2020-04-31T00:00:00Z"); + add("feb-30", "2020-02-30T00:00:00Z"); + add("feb-29-nonleap", "2021-02-29T00:00:00Z"); + add("negative-day", "2020-01--1T00:00:00Z"); + add("bad-separator", "2020-04-15j13:30:59Z"); + add("hour-25", "2020-04-15T25:00:00Z"); + add("negative-hour", "2020-04-15T-1:00:00Z"); + add("minute-60", "2020-04-15T23:60:00Z"); + add("negative-minute", "2020-04-15T23:-1:00Z"); + add("second-60", "2020-04-15T23:59:60Z"); // not a leap second + add("negative-second", "2020-04-15T23:59:-1Z"); + add("negative-milli", "2020-04-15T23.59:59.-1Z"); + + // walking null + char dt[] = "2020-04-15T17:33:32.125Z"; + quint8 len = strlen(dt); + for (int i = 0; i < int(len); ++i) { + char c = '\0'; + qSwap(c, dt[i]); + QTest::addRow("DateTime:Null-at-%d", i) + << encode(0xc0, 0x78, len) + QByteArray(dt, len) + << QCborValue(QCborKnownTags::DateTimeString, QLatin1String(dt, len)); + qSwap(c, dt[i]); + } + } } void tst_QCborValue::extendedTypeValidation() -- cgit v1.2.3 From 821e71fded090d815b5cd396057ac9823874fe1f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Apr 2020 15:16:06 -0300 Subject: QCborValue: check parsing of invalid URL QUrl will reject invalid URLs for us, so we don't get normalization. The original junk should be retrievable, of course. Change-Id: Ibdc95e9af7bd456a94ecfffd160610f5b2c8e1a2 Reviewed-by: Ulf Hermann Reviewed-by: Edward Welbourne --- tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp index e8acd29bbc..9c1341e252 100644 --- a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp +++ b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp @@ -2053,6 +2053,14 @@ void tst_QCborValue::extendedTypeValidation_data() qSwap(c, dt[i]); } } + + // Improperly-encoded URLs + { + const char badurl[] = "%zz"; + QTest::newRow("Url:Invalid") + << encode(0xd8, int(QCborKnownTags::Url), 0x60 + int(strlen(badurl)), badurl) + << QCborValue(QCborKnownTags::Url, QLatin1String(badurl)); + } } void tst_QCborValue::extendedTypeValidation() -- cgit v1.2.3 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') 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 From f0ea852d4dd6b3139869a952ee92e74cd367866d Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 30 Apr 2020 20:44:11 +0200 Subject: QCommandLineParser: Wrap very long option names to leave room for descriptions Fixes: QTBUG-79926 Change-Id: I3302e0ed5b58949a35ccb001c71b22a6400a6c81 Reviewed-by: Thiago Macieira --- .../testhelper/qcommandlineparser_test_helper.cpp | 7 +++++ .../qcommandlineparser/tst_qcommandlineparser.cpp | 33 ++++++++++++++++++++++ 2 files changed, 40 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp b/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp index 513c811788..88dfdeccab 100644 --- a/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp +++ b/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp @@ -97,6 +97,13 @@ int main(int argc, char *argv[]) parser.process(app); const QString size = parser.value("size"); printf("Resizing %s to %s and saving to %s\n", qPrintable(parser.value("load")), qPrintable(size), qPrintable(parser.value("o"))); + } else if (command == "long") { + // A very long option (QTBUG-79926) + QCommandLineOption longOption(QStringList{QStringLiteral("looooooooooooong-option"), QStringLiteral("looooong-opt-alias")}); + longOption.setDescription(QStringLiteral("Short description")); + longOption.setValueName(QStringLiteral("looooooooooooong-value-name")); + parser.addOption(longOption); + parser.process(app); } else { // Call process again, to handle unknown options this time. parser.process(app); diff --git a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp index 1e87c76d2f..493d8d4982 100644 --- a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp +++ b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp @@ -78,6 +78,7 @@ private slots: void testUnknownOption(); void testHelpAll_data(); void testHelpAll(); + void testVeryLongOptionNames(); }; static char *empty_argv[] = { 0 }; @@ -737,6 +738,38 @@ void tst_QCommandLineParser::testHelpAll() #endif // QT_CONFIG(process) } +void tst_QCommandLineParser::testVeryLongOptionNames() +{ +#if !QT_CONFIG(process) + QSKIP("This test requires QProcess support"); +#else +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) + QSKIP("Deploying executable applications to file system on Android not supported."); +#endif + + QCoreApplication app(empty_argc, empty_argv); + QProcess process; + process.start("testhelper/qcommandlineparser_test_helper", QStringList() << "0" << "long" << "--help"); + QVERIFY(process.waitForFinished(5000)); + QCOMPARE(process.exitStatus(), QProcess::NormalExit); + QString output = process.readAll(); +#ifdef Q_OS_WIN + output.replace(QStringLiteral("\r\n"), QStringLiteral("\n")); +#endif + const QStringList lines = output.split('\n'); + const int last = lines.count() - 1; + // Let's not compare everything, just the final parts. + QCOMPARE(lines.at(last - 7), " cdefghijklmnopqrstuvwxyz"); + QCOMPARE(lines.at(last - 6), " --looooooooooooong-option, --looooong-opt-alias "); + QCOMPARE(lines.at(last - 4), ""); + QCOMPARE(lines.at(last - 3), "Arguments:"); + QCOMPARE(lines.at(last - 2), " parsingMode The parsing mode to test."); + QCOMPARE(lines.at(last - 1), " command The command to execute."); + +#endif // QT_CONFIG(process) +} + QTEST_APPLESS_MAIN(tst_QCommandLineParser) #include "tst_qcommandlineparser.moc" -- cgit v1.2.3