From 3489ab60a992f060c3e737838cc78ac79f79cc31 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Tue, 3 May 2016 23:04:28 +0200 Subject: QTestLib: support explicit bool conversions in QVERIFY [ChangeLog][QTestLib] It is now possible to use variables of types with an explicit operator bool in the QVERIFY macro. Change-Id: I2685df164a616f6a065d689867daa9ea1de78e08 Reviewed-by: Friedemann Kleint --- src/testlib/qtestcase.h | 2 +- .../auto/testlib/selftests/cmptest/tst_cmptest.cpp | 17 ++++++ .../testlib/selftests/expected_cmptest.lightxml | 60 ++++++++++++---------- .../testlib/selftests/expected_cmptest.teamcity | 58 +++++++++++---------- tests/auto/testlib/selftests/expected_cmptest.txt | 59 ++++++++++----------- tests/auto/testlib/selftests/expected_cmptest.xml | 60 ++++++++++++---------- .../testlib/selftests/expected_cmptest.xunitxml | 3 +- 7 files changed, 144 insertions(+), 115 deletions(-) diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index 0395875cb3..3ef9fd148f 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -63,7 +63,7 @@ class QRegularExpression; #define QVERIFY(statement) \ do {\ - if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__))\ + if (!QTest::qVerify(static_cast(statement), #statement, "", __FILE__, __LINE__))\ return;\ } while (0) diff --git a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp index 9ada718682..3a8d27631e 100644 --- a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp +++ b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp @@ -147,6 +147,7 @@ private slots: void verify2(); void tryVerify(); void tryVerify2(); + void verifyExplicitOperatorBool(); }; enum MyUnregisteredEnum { MyUnregisteredEnumValue1, MyUnregisteredEnumValue2 }; @@ -458,5 +459,21 @@ void tst_Cmptest::tryVerify2() QTRY_VERIFY2_WITH_TIMEOUT(opaqueFunc() < 2, QByteArray::number(opaqueFunc()).constData(), 1); } +void tst_Cmptest::verifyExplicitOperatorBool() +{ + struct ExplicitOperatorBool { + int m_i; + explicit ExplicitOperatorBool(int i) : m_i(i) {} + explicit operator bool() const { return m_i > 0; } + bool operator !() const { return !bool(*this); } + }; + + ExplicitOperatorBool val1(42); + QVERIFY(val1); + + ExplicitOperatorBool val2(-273); + QVERIFY(!val2); +} + QTEST_MAIN(tst_Cmptest) #include "tst_cmptest.moc" diff --git a/tests/auto/testlib/selftests/expected_cmptest.lightxml b/tests/auto/testlib/selftests/expected_cmptest.lightxml index d4ba020000..73ef7be9f7 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.lightxml +++ b/tests/auto/testlib/selftests/expected_cmptest.lightxml @@ -8,13 +8,13 @@ - + - + @@ -22,7 +22,7 @@ - + @@ -42,7 +42,7 @@ - + - + - + - + ) @@ -78,31 +78,31 @@ - + - + - + - + - + - + @@ -119,7 +119,7 @@ - + @@ -127,7 +127,7 @@ - + @@ -138,13 +138,13 @@ - + - + - + - + @@ -169,13 +169,13 @@ - + - + - + - + - + - + - + - + - + + + + + diff --git a/tests/auto/testlib/selftests/expected_cmptest.teamcity b/tests/auto/testlib/selftests/expected_cmptest.teamcity index c64060fdf2..cfef152f0b 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.teamcity +++ b/tests/auto/testlib/selftests/expected_cmptest.teamcity @@ -2,13 +2,13 @@ ##teamcity[testStarted name='initTestCase()'] ##teamcity[testFinished name='initTestCase()'] ##teamcity[testStarted name='compare_unregistered_enums()'] -##teamcity[testFailed name='compare_unregistered_enums()' message='Failure! |[Loc: tst_cmptest.cpp(156)|]' details='Compared values are not the same'] +##teamcity[testFailed name='compare_unregistered_enums()' message='Failure! |[Loc: tst_cmptest.cpp(158)|]' details='Compared values are not the same'] ##teamcity[testFinished name='compare_unregistered_enums()'] ##teamcity[testStarted name='compare_registered_enums()'] -##teamcity[testFailed name='compare_registered_enums()' message='Failure! |[Loc: tst_cmptest.cpp(162)|]' details='Compared values are not the same|n Actual (Qt::ArrowCursor): ArrowCursor|n Expected (Qt::BusyCursor) : BusyCursor'] +##teamcity[testFailed name='compare_registered_enums()' message='Failure! |[Loc: tst_cmptest.cpp(164)|]' details='Compared values are not the same|n Actual (Qt::ArrowCursor): ArrowCursor|n Expected (Qt::BusyCursor) : BusyCursor'] ##teamcity[testFinished name='compare_registered_enums()'] ##teamcity[testStarted name='compare_class_enums()'] -##teamcity[testFailed name='compare_class_enums()' message='Failure! |[Loc: tst_cmptest.cpp(168)|]' details='Compared values are not the same|n Actual (MyClassEnum::MyClassEnumValue1): MyClassEnumValue1|n Expected (MyClassEnum::MyClassEnumValue2): MyClassEnumValue2'] +##teamcity[testFailed name='compare_class_enums()' message='Failure! |[Loc: tst_cmptest.cpp(170)|]' details='Compared values are not the same|n Actual (MyClassEnum::MyClassEnumValue1): MyClassEnumValue1|n Expected (MyClassEnum::MyClassEnumValue2): MyClassEnumValue2'] ##teamcity[testFinished name='compare_class_enums()'] ##teamcity[testStarted name='compare_boolfuncs()'] ##teamcity[testFinished name='compare_boolfuncs()'] @@ -17,94 +17,96 @@ ##teamcity[testStarted name='compare_pointerfuncs()'] ##teamcity[testFinished name='compare_pointerfuncs()'] ##teamcity[testStarted name='compare_tostring(int, string)'] -##teamcity[testFailed name='compare_tostring(int, string)' message='Failure! |[Loc: tst_cmptest.cpp(239)|]' details='Compared values are not the same|n Actual (actual) : QVariant(int,123)|n Expected (expected): QVariant(QString,hi)'] +##teamcity[testFailed name='compare_tostring(int, string)' message='Failure! |[Loc: tst_cmptest.cpp(259)|]' details='Compared values are not the same|n Actual (actual) : QVariant(int,123)|n Expected (expected): QVariant(QString,hi)'] ##teamcity[testFinished name='compare_tostring(int, string)'] ##teamcity[testStarted name='compare_tostring(both invalid)'] ##teamcity[testFinished name='compare_tostring(both invalid)'] ##teamcity[testStarted name='compare_tostring(null hash, invalid)'] -##teamcity[testFailed name='compare_tostring(null hash, invalid)' message='Failure! |[Loc: tst_cmptest.cpp(239)|]' details='Compared values are not the same|n Actual (actual) : QVariant(QVariantHash)|n Expected (expected): QVariant()'] +##teamcity[testFailed name='compare_tostring(null hash, invalid)' message='Failure! |[Loc: tst_cmptest.cpp(259)|]' details='Compared values are not the same|n Actual (actual) : QVariant(QVariantHash)|n Expected (expected): QVariant()'] ##teamcity[testFinished name='compare_tostring(null hash, invalid)'] ##teamcity[testStarted name='compare_tostring(string, null user type)'] -##teamcity[testFailed name='compare_tostring(string, null user type)' message='Failure! |[Loc: tst_cmptest.cpp(239)|]' details='Compared values are not the same|n Actual (actual) : QVariant(QString,A simple string)|n Expected (expected): QVariant(PhonyClass)'] +##teamcity[testFailed name='compare_tostring(string, null user type)' message='Failure! |[Loc: tst_cmptest.cpp(259)|]' details='Compared values are not the same|n Actual (actual) : QVariant(QString,A simple string)|n Expected (expected): QVariant(PhonyClass)'] ##teamcity[testFinished name='compare_tostring(string, null user type)'] ##teamcity[testStarted name='compare_tostring(both non-null user type)'] -##teamcity[testFailed name='compare_tostring(both non-null user type)' message='Failure! |[Loc: tst_cmptest.cpp(239)|]' details='Compared values are not the same|n Actual (actual) : QVariant(PhonyClass,)|n Expected (expected): QVariant(PhonyClass,)'] +##teamcity[testFailed name='compare_tostring(both non-null user type)' message='Failure! |[Loc: tst_cmptest.cpp(259)|]' details='Compared values are not the same|n Actual (actual) : QVariant(PhonyClass,)|n Expected (expected): QVariant(PhonyClass,)'] ##teamcity[testFinished name='compare_tostring(both non-null user type)'] ##teamcity[testStarted name='compareQStringLists(empty lists)'] ##teamcity[testFinished name='compareQStringLists(empty lists)'] ##teamcity[testStarted name='compareQStringLists(equal lists)'] ##teamcity[testFinished name='compareQStringLists(equal lists)'] ##teamcity[testStarted name='compareQStringLists(last item different)'] -##teamcity[testFailed name='compareQStringLists(last item different)' message='Failure! |[Loc: tst_cmptest.cpp(333)|]' details='Compared lists differ at index 2.|n Actual (opA): "string3"|n Expected (opB): "DIFFERS"'] +##teamcity[testFailed name='compareQStringLists(last item different)' message='Failure! |[Loc: tst_cmptest.cpp(353)|]' details='Compared lists differ at index 2.|n Actual (opA): "string3"|n Expected (opB): "DIFFERS"'] ##teamcity[testFinished name='compareQStringLists(last item different)'] ##teamcity[testStarted name='compareQStringLists(second-last item different)'] -##teamcity[testFailed name='compareQStringLists(second-last item different)' message='Failure! |[Loc: tst_cmptest.cpp(333)|]' details='Compared lists differ at index 2.|n Actual (opA): "string3"|n Expected (opB): "DIFFERS"'] +##teamcity[testFailed name='compareQStringLists(second-last item different)' message='Failure! |[Loc: tst_cmptest.cpp(353)|]' details='Compared lists differ at index 2.|n Actual (opA): "string3"|n Expected (opB): "DIFFERS"'] ##teamcity[testFinished name='compareQStringLists(second-last item different)'] ##teamcity[testStarted name='compareQStringLists(prefix)'] -##teamcity[testFailed name='compareQStringLists(prefix)' message='Failure! |[Loc: tst_cmptest.cpp(333)|]' details='Compared lists have different sizes.|n Actual (opA) size: 2|n Expected (opB) size: 1'] +##teamcity[testFailed name='compareQStringLists(prefix)' message='Failure! |[Loc: tst_cmptest.cpp(353)|]' details='Compared lists have different sizes.|n Actual (opA) size: 2|n Expected (opB) size: 1'] ##teamcity[testFinished name='compareQStringLists(prefix)'] ##teamcity[testStarted name='compareQStringLists(short list second)'] -##teamcity[testFailed name='compareQStringLists(short list second)' message='Failure! |[Loc: tst_cmptest.cpp(333)|]' details='Compared lists have different sizes.|n Actual (opA) size: 12|n Expected (opB) size: 1'] +##teamcity[testFailed name='compareQStringLists(short list second)' message='Failure! |[Loc: tst_cmptest.cpp(353)|]' details='Compared lists have different sizes.|n Actual (opA) size: 12|n Expected (opB) size: 1'] ##teamcity[testFinished name='compareQStringLists(short list second)'] ##teamcity[testStarted name='compareQStringLists(short list first)'] -##teamcity[testFailed name='compareQStringLists(short list first)' message='Failure! |[Loc: tst_cmptest.cpp(333)|]' details='Compared lists have different sizes.|n Actual (opA) size: 1|n Expected (opB) size: 12'] +##teamcity[testFailed name='compareQStringLists(short list first)' message='Failure! |[Loc: tst_cmptest.cpp(353)|]' details='Compared lists have different sizes.|n Actual (opA) size: 1|n Expected (opB) size: 12'] ##teamcity[testFinished name='compareQStringLists(short list first)'] ##teamcity[testStarted name='compareQListInt()'] -##teamcity[testFailed name='compareQListInt()' message='Failure! |[Loc: tst_cmptest.cpp(340)|]' details='Compared lists differ at index 2.|n Actual (int1): 3|n Expected (int2): 4'] +##teamcity[testFailed name='compareQListInt()' message='Failure! |[Loc: tst_cmptest.cpp(360)|]' details='Compared lists differ at index 2.|n Actual (int1): 3|n Expected (int2): 4'] ##teamcity[testFinished name='compareQListInt()'] ##teamcity[testStarted name='compareQListDouble()'] -##teamcity[testFailed name='compareQListDouble()' message='Failure! |[Loc: tst_cmptest.cpp(347)|]' details='Compared lists differ at index 0.|n Actual (double1): 1.5|n Expected (double2): 1'] +##teamcity[testFailed name='compareQListDouble()' message='Failure! |[Loc: tst_cmptest.cpp(367)|]' details='Compared lists differ at index 0.|n Actual (double1): 1.5|n Expected (double2): 1'] ##teamcity[testFinished name='compareQListDouble()'] ##teamcity[testStarted name='compareQColor()'] -##teamcity[testFailed name='compareQColor()' message='Failure! |[Loc: tst_cmptest.cpp(357)|]' details='Compared values are not the same|n Actual (yellow): #ffff00|n Expected (green) : #00ff00'] +##teamcity[testFailed name='compareQColor()' message='Failure! |[Loc: tst_cmptest.cpp(377)|]' details='Compared values are not the same|n Actual (yellow): #ffff00|n Expected (green) : #00ff00'] ##teamcity[testFinished name='compareQColor()'] ##teamcity[testStarted name='compareQPixmaps(both null)'] ##teamcity[testFinished name='compareQPixmaps(both null)'] ##teamcity[testStarted name='compareQPixmaps(one null)'] -##teamcity[testFailed name='compareQPixmaps(one null)' message='Failure! |[Loc: tst_cmptest.cpp(382)|]' details='Compared QPixmaps differ.|n Actual (opA).isNull(): 1|n Expected (opB).isNull(): 0'] +##teamcity[testFailed name='compareQPixmaps(one null)' message='Failure! |[Loc: tst_cmptest.cpp(402)|]' details='Compared QPixmaps differ.|n Actual (opA).isNull(): 1|n Expected (opB).isNull(): 0'] ##teamcity[testFinished name='compareQPixmaps(one null)'] ##teamcity[testStarted name='compareQPixmaps(other null)'] -##teamcity[testFailed name='compareQPixmaps(other null)' message='Failure! |[Loc: tst_cmptest.cpp(382)|]' details='Compared QPixmaps differ.|n Actual (opA).isNull(): 0|n Expected (opB).isNull(): 1'] +##teamcity[testFailed name='compareQPixmaps(other null)' message='Failure! |[Loc: tst_cmptest.cpp(402)|]' details='Compared QPixmaps differ.|n Actual (opA).isNull(): 0|n Expected (opB).isNull(): 1'] ##teamcity[testFinished name='compareQPixmaps(other null)'] ##teamcity[testStarted name='compareQPixmaps(equal)'] ##teamcity[testFinished name='compareQPixmaps(equal)'] ##teamcity[testStarted name='compareQPixmaps(different size)'] -##teamcity[testFailed name='compareQPixmaps(different size)' message='Failure! |[Loc: tst_cmptest.cpp(382)|]' details='Compared QPixmaps differ in size.|n Actual (opA): 11x20|n Expected (opB): 20x20'] +##teamcity[testFailed name='compareQPixmaps(different size)' message='Failure! |[Loc: tst_cmptest.cpp(402)|]' details='Compared QPixmaps differ in size.|n Actual (opA): 11x20|n Expected (opB): 20x20'] ##teamcity[testFinished name='compareQPixmaps(different size)'] ##teamcity[testStarted name='compareQPixmaps(different pixels)'] -##teamcity[testFailed name='compareQPixmaps(different pixels)' message='Failure! |[Loc: tst_cmptest.cpp(382)|]' details='Compared values are not the same'] +##teamcity[testFailed name='compareQPixmaps(different pixels)' message='Failure! |[Loc: tst_cmptest.cpp(402)|]' details='Compared values are not the same'] ##teamcity[testFinished name='compareQPixmaps(different pixels)'] ##teamcity[testStarted name='compareQImages(both null)'] ##teamcity[testFinished name='compareQImages(both null)'] ##teamcity[testStarted name='compareQImages(one null)'] -##teamcity[testFailed name='compareQImages(one null)' message='Failure! |[Loc: tst_cmptest.cpp(409)|]' details='Compared QImages differ.|n Actual (opA).isNull(): 1|n Expected (opB).isNull(): 0'] +##teamcity[testFailed name='compareQImages(one null)' message='Failure! |[Loc: tst_cmptest.cpp(429)|]' details='Compared QImages differ.|n Actual (opA).isNull(): 1|n Expected (opB).isNull(): 0'] ##teamcity[testFinished name='compareQImages(one null)'] ##teamcity[testStarted name='compareQImages(other null)'] -##teamcity[testFailed name='compareQImages(other null)' message='Failure! |[Loc: tst_cmptest.cpp(409)|]' details='Compared QImages differ.|n Actual (opA).isNull(): 0|n Expected (opB).isNull(): 1'] +##teamcity[testFailed name='compareQImages(other null)' message='Failure! |[Loc: tst_cmptest.cpp(429)|]' details='Compared QImages differ.|n Actual (opA).isNull(): 0|n Expected (opB).isNull(): 1'] ##teamcity[testFinished name='compareQImages(other null)'] ##teamcity[testStarted name='compareQImages(equal)'] ##teamcity[testFinished name='compareQImages(equal)'] ##teamcity[testStarted name='compareQImages(different size)'] -##teamcity[testFailed name='compareQImages(different size)' message='Failure! |[Loc: tst_cmptest.cpp(409)|]' details='Compared QImages differ in size.|n Actual (opA): 11x20|n Expected (opB): 20x20'] +##teamcity[testFailed name='compareQImages(different size)' message='Failure! |[Loc: tst_cmptest.cpp(429)|]' details='Compared QImages differ in size.|n Actual (opA): 11x20|n Expected (opB): 20x20'] ##teamcity[testFinished name='compareQImages(different size)'] ##teamcity[testStarted name='compareQImages(different format)'] -##teamcity[testFailed name='compareQImages(different format)' message='Failure! |[Loc: tst_cmptest.cpp(409)|]' details='Compared QImages differ in format.|n Actual (opA): 6|n Expected (opB): 3'] +##teamcity[testFailed name='compareQImages(different format)' message='Failure! |[Loc: tst_cmptest.cpp(429)|]' details='Compared QImages differ in format.|n Actual (opA): 6|n Expected (opB): 3'] ##teamcity[testFinished name='compareQImages(different format)'] ##teamcity[testStarted name='compareQImages(different pixels)'] -##teamcity[testFailed name='compareQImages(different pixels)' message='Failure! |[Loc: tst_cmptest.cpp(409)|]' details='Compared values are not the same'] +##teamcity[testFailed name='compareQImages(different pixels)' message='Failure! |[Loc: tst_cmptest.cpp(429)|]' details='Compared values are not the same'] ##teamcity[testFinished name='compareQImages(different pixels)'] ##teamcity[testStarted name='verify()'] -##teamcity[testFailed name='verify()' message='Failure! |[Loc: tst_cmptest.cpp(421)|]' details='|'opaqueFunc() < 2|' returned FALSE. ()'] +##teamcity[testFailed name='verify()' message='Failure! |[Loc: tst_cmptest.cpp(441)|]' details='|'opaqueFunc() < 2|' returned FALSE. ()'] ##teamcity[testFinished name='verify()'] ##teamcity[testStarted name='verify2()'] -##teamcity[testFailed name='verify2()' message='Failure! |[Loc: tst_cmptest.cpp(427)|]' details='|'opaqueFunc() < 2|' returned FALSE. (42)'] +##teamcity[testFailed name='verify2()' message='Failure! |[Loc: tst_cmptest.cpp(447)|]' details='|'opaqueFunc() < 2|' returned FALSE. (42)'] ##teamcity[testFinished name='verify2()'] ##teamcity[testStarted name='tryVerify()'] -##teamcity[testFailed name='tryVerify()' message='Failure! |[Loc: tst_cmptest.cpp(433)|]' details='|'opaqueFunc() < 2|' returned FALSE. ()'] +##teamcity[testFailed name='tryVerify()' message='Failure! |[Loc: tst_cmptest.cpp(453)|]' details='|'opaqueFunc() < 2|' returned FALSE. ()'] ##teamcity[testFinished name='tryVerify()'] ##teamcity[testStarted name='tryVerify2()'] -##teamcity[testFailed name='tryVerify2()' message='Failure! |[Loc: tst_cmptest.cpp(439)|]' details='|'opaqueFunc() < 2|' returned FALSE. (42)'] +##teamcity[testFailed name='tryVerify2()' message='Failure! |[Loc: tst_cmptest.cpp(459)|]' details='|'opaqueFunc() < 2|' returned FALSE. (42)'] ##teamcity[testFinished name='tryVerify2()'] +##teamcity[testStarted name='verifyExplicitOperatorBool()'] +##teamcity[testFinished name='verifyExplicitOperatorBool()'] ##teamcity[testStarted name='cleanupTestCase()'] ##teamcity[testFinished name='cleanupTestCase()'] ##teamcity[testSuiteFinished name='tst_Cmptest'] diff --git a/tests/auto/testlib/selftests/expected_cmptest.txt b/tests/auto/testlib/selftests/expected_cmptest.txt index ceee0f1efa..8d403f4a8d 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.txt +++ b/tests/auto/testlib/selftests/expected_cmptest.txt @@ -2,113 +2,114 @@ Config: Using QtTest library PASS : tst_Cmptest::initTestCase() FAIL! : tst_Cmptest::compare_unregistered_enums() Compared values are not the same - Loc: [tst_cmptest.cpp(156)] + Loc: [tst_cmptest.cpp(158)] FAIL! : tst_Cmptest::compare_registered_enums() Compared values are not the same Actual (Qt::ArrowCursor): ArrowCursor Expected (Qt::BusyCursor) : BusyCursor - Loc: [tst_cmptest.cpp(162)] + Loc: [tst_cmptest.cpp(164)] FAIL! : tst_Cmptest::compare_class_enums() Compared values are not the same Actual (MyClassEnum::MyClassEnumValue1): MyClassEnumValue1 Expected (MyClassEnum::MyClassEnumValue2): MyClassEnumValue2 - Loc: [tst_cmptest.cpp(168)] + Loc: [tst_cmptest.cpp(170)] PASS : tst_Cmptest::compare_boolfuncs() PASS : tst_Cmptest::compare_to_nullptr() PASS : tst_Cmptest::compare_pointerfuncs() FAIL! : tst_Cmptest::compare_tostring(int, string) Compared values are not the same Actual (actual) : QVariant(int,123) Expected (expected): QVariant(QString,hi) - Loc: [tst_cmptest.cpp(239)] + Loc: [tst_cmptest.cpp(259)] PASS : tst_Cmptest::compare_tostring(both invalid) FAIL! : tst_Cmptest::compare_tostring(null hash, invalid) Compared values are not the same Actual (actual) : QVariant(QVariantHash) Expected (expected): QVariant() - Loc: [tst_cmptest.cpp(239)] + Loc: [tst_cmptest.cpp(259)] FAIL! : tst_Cmptest::compare_tostring(string, null user type) Compared values are not the same Actual (actual) : QVariant(QString,A simple string) Expected (expected): QVariant(PhonyClass) - Loc: [tst_cmptest.cpp(239)] + Loc: [tst_cmptest.cpp(259)] FAIL! : tst_Cmptest::compare_tostring(both non-null user type) Compared values are not the same Actual (actual) : QVariant(PhonyClass,) Expected (expected): QVariant(PhonyClass,) - Loc: [tst_cmptest.cpp(239)] + Loc: [tst_cmptest.cpp(259)] PASS : tst_Cmptest::compareQStringLists(empty lists) PASS : tst_Cmptest::compareQStringLists(equal lists) FAIL! : tst_Cmptest::compareQStringLists(last item different) Compared lists differ at index 2. Actual (opA): "string3" Expected (opB): "DIFFERS" - Loc: [tst_cmptest.cpp(333)] + Loc: [tst_cmptest.cpp(353)] FAIL! : tst_Cmptest::compareQStringLists(second-last item different) Compared lists differ at index 2. Actual (opA): "string3" Expected (opB): "DIFFERS" - Loc: [tst_cmptest.cpp(333)] + Loc: [tst_cmptest.cpp(353)] FAIL! : tst_Cmptest::compareQStringLists(prefix) Compared lists have different sizes. Actual (opA) size: 2 Expected (opB) size: 1 - Loc: [tst_cmptest.cpp(333)] + Loc: [tst_cmptest.cpp(353)] FAIL! : tst_Cmptest::compareQStringLists(short list second) Compared lists have different sizes. Actual (opA) size: 12 Expected (opB) size: 1 - Loc: [tst_cmptest.cpp(333)] + Loc: [tst_cmptest.cpp(353)] FAIL! : tst_Cmptest::compareQStringLists(short list first) Compared lists have different sizes. Actual (opA) size: 1 Expected (opB) size: 12 - Loc: [tst_cmptest.cpp(333)] + Loc: [tst_cmptest.cpp(353)] FAIL! : tst_Cmptest::compareQListInt() Compared lists differ at index 2. Actual (int1): 3 Expected (int2): 4 - Loc: [tst_cmptest.cpp(340)] + Loc: [tst_cmptest.cpp(360)] FAIL! : tst_Cmptest::compareQListDouble() Compared lists differ at index 0. Actual (double1): 1.5 Expected (double2): 1 - Loc: [tst_cmptest.cpp(347)] + Loc: [tst_cmptest.cpp(367)] FAIL! : tst_Cmptest::compareQColor() Compared values are not the same Actual (yellow): #ffff00 Expected (green) : #00ff00 - Loc: [tst_cmptest.cpp(357)] + Loc: [tst_cmptest.cpp(377)] PASS : tst_Cmptest::compareQPixmaps(both null) FAIL! : tst_Cmptest::compareQPixmaps(one null) Compared QPixmaps differ. Actual (opA).isNull(): 1 Expected (opB).isNull(): 0 - Loc: [tst_cmptest.cpp(382)] + Loc: [tst_cmptest.cpp(402)] FAIL! : tst_Cmptest::compareQPixmaps(other null) Compared QPixmaps differ. Actual (opA).isNull(): 0 Expected (opB).isNull(): 1 - Loc: [tst_cmptest.cpp(382)] + Loc: [tst_cmptest.cpp(402)] PASS : tst_Cmptest::compareQPixmaps(equal) FAIL! : tst_Cmptest::compareQPixmaps(different size) Compared QPixmaps differ in size. Actual (opA): 11x20 Expected (opB): 20x20 - Loc: [tst_cmptest.cpp(382)] + Loc: [tst_cmptest.cpp(402)] FAIL! : tst_Cmptest::compareQPixmaps(different pixels) Compared values are not the same - Loc: [tst_cmptest.cpp(382)] + Loc: [tst_cmptest.cpp(402)] PASS : tst_Cmptest::compareQImages(both null) FAIL! : tst_Cmptest::compareQImages(one null) Compared QImages differ. Actual (opA).isNull(): 1 Expected (opB).isNull(): 0 - Loc: [tst_cmptest.cpp(409)] + Loc: [tst_cmptest.cpp(429)] FAIL! : tst_Cmptest::compareQImages(other null) Compared QImages differ. Actual (opA).isNull(): 0 Expected (opB).isNull(): 1 - Loc: [tst_cmptest.cpp(409)] + Loc: [tst_cmptest.cpp(429)] PASS : tst_Cmptest::compareQImages(equal) FAIL! : tst_Cmptest::compareQImages(different size) Compared QImages differ in size. Actual (opA): 11x20 Expected (opB): 20x20 - Loc: [tst_cmptest.cpp(409)] + Loc: [tst_cmptest.cpp(429)] FAIL! : tst_Cmptest::compareQImages(different format) Compared QImages differ in format. Actual (opA): 6 Expected (opB): 3 - Loc: [tst_cmptest.cpp(409)] + Loc: [tst_cmptest.cpp(429)] FAIL! : tst_Cmptest::compareQImages(different pixels) Compared values are not the same - Loc: [tst_cmptest.cpp(409)] + Loc: [tst_cmptest.cpp(429)] FAIL! : tst_Cmptest::verify() 'opaqueFunc() < 2' returned FALSE. () - Loc: [tst_cmptest.cpp(421)] + Loc: [tst_cmptest.cpp(441)] FAIL! : tst_Cmptest::verify2() 'opaqueFunc() < 2' returned FALSE. (42) - Loc: [tst_cmptest.cpp(427)] + Loc: [tst_cmptest.cpp(447)] FAIL! : tst_Cmptest::tryVerify() 'opaqueFunc() < 2' returned FALSE. () - Loc: [tst_cmptest.cpp(433)] + Loc: [tst_cmptest.cpp(453)] FAIL! : tst_Cmptest::tryVerify2() 'opaqueFunc() < 2' returned FALSE. (42) - Loc: [tst_cmptest.cpp(439)] + Loc: [tst_cmptest.cpp(459)] +PASS : tst_Cmptest::verifyExplicitOperatorBool() PASS : tst_Cmptest::cleanupTestCase() -Totals: 12 passed, 28 failed, 0 skipped, 0 blacklisted, 247ms +Totals: 13 passed, 28 failed, 0 skipped, 0 blacklisted, 246ms ********* Finished testing of tst_Cmptest ********* diff --git a/tests/auto/testlib/selftests/expected_cmptest.xml b/tests/auto/testlib/selftests/expected_cmptest.xml index 2eddfa67d9..18807008d7 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.xml +++ b/tests/auto/testlib/selftests/expected_cmptest.xml @@ -10,13 +10,13 @@ - + - + @@ -24,7 +24,7 @@ - + @@ -44,7 +44,7 @@ - + - + - + - + ) @@ -80,31 +80,31 @@ - + - + - + - + - + - + @@ -121,7 +121,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -140,13 +140,13 @@ - + - + - + - + @@ -171,13 +171,13 @@ - + - + - + - + - + - + - + - + - + + + + + diff --git a/tests/auto/testlib/selftests/expected_cmptest.xunitxml b/tests/auto/testlib/selftests/expected_cmptest.xunitxml index d044771b14..925c725924 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.xunitxml +++ b/tests/auto/testlib/selftests/expected_cmptest.xunitxml @@ -1,5 +1,5 @@ - + @@ -107,6 +107,7 @@ + -- cgit v1.2.3