diff options
Diffstat (limited to 'tests/auto/testlib')
-rw-r--r-- | tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp | 51 | ||||
-rw-r--r-- | tests/auto/testlib/selftests/expected_cmptest.lightxml | 98 | ||||
-rw-r--r-- | tests/auto/testlib/selftests/expected_cmptest.txt | 58 | ||||
-rw-r--r-- | tests/auto/testlib/selftests/expected_cmptest.xml | 98 | ||||
-rw-r--r-- | tests/auto/testlib/selftests/expected_cmptest.xunitxml | 22 | ||||
-rw-r--r-- | tests/auto/testlib/selftests/tst_selftests.cpp | 8 |
6 files changed, 248 insertions, 87 deletions
diff --git a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp index 6b94dfb529..6446fec510 100644 --- a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp +++ b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp @@ -124,6 +124,8 @@ class tst_Cmptest: public QObject Q_OBJECT private slots: + void compare_unregistered_enums(); + void compare_registered_enums(); void compare_boolfuncs(); void compare_pointerfuncs(); void compare_tostring(); @@ -138,8 +140,26 @@ private slots: void compareQImages(); void compareQImages_data(); #endif + void verify(); + void verify2(); + void tryVerify(); + void tryVerify2(); }; +enum MyUnregisteredEnum { MyUnregisteredEnumValue1, MyUnregisteredEnumValue2 }; + +void tst_Cmptest::compare_unregistered_enums() +{ + QCOMPARE(MyUnregisteredEnumValue1, MyUnregisteredEnumValue1); + QCOMPARE(MyUnregisteredEnumValue1, MyUnregisteredEnumValue2); +} + +void tst_Cmptest::compare_registered_enums() +{ + QCOMPARE(Qt::ArrowCursor, Qt::ArrowCursor); + QCOMPARE(Qt::ArrowCursor, Qt::BusyCursor); +} + static bool boolfunc() { return true; } static bool boolfunc2() { return true; } @@ -371,7 +391,36 @@ void tst_Cmptest::compareQImages() QCOMPARE(opA, opB); } -#endif +#endif // QT_GUI_LIB + +static int opaqueFunc() +{ + return 42; +} + +void tst_Cmptest::verify() +{ + QVERIFY(opaqueFunc() > 2); + QVERIFY(opaqueFunc() < 2); +} + +void tst_Cmptest::verify2() +{ + QVERIFY2(opaqueFunc() > 2, QByteArray::number(opaqueFunc()).constData()); + QVERIFY2(opaqueFunc() < 2, QByteArray::number(opaqueFunc()).constData()); +} + +void tst_Cmptest::tryVerify() +{ + QTRY_VERIFY(opaqueFunc() > 2); + QTRY_VERIFY_WITH_TIMEOUT(opaqueFunc() < 2, 1); +} + +void tst_Cmptest::tryVerify2() +{ + QTRY_VERIFY2(opaqueFunc() > 2, QByteArray::number(opaqueFunc()).constData()); + QTRY_VERIFY2_WITH_TIMEOUT(opaqueFunc() < 2, QByteArray::number(opaqueFunc()).constData(), 1); +} 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 4a376b5c8b..36929cec6b 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.lightxml +++ b/tests/auto/testlib/selftests/expected_cmptest.lightxml @@ -5,18 +5,32 @@ </Environment> <TestFunction name="initTestCase"> <Incident type="pass" file="" line="0" /> -<Duration msecs="0"/> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="compare_unregistered_enums"> +<Incident type="fail" file="tst_cmptest.cpp" line="154"> + <Description><![CDATA[Compared values are not the same]]></Description> +</Incident> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="compare_registered_enums"> +<Incident type="fail" file="tst_cmptest.cpp" line="160"> + <Description><![CDATA[Compared values are not the same + Actual (Qt::ArrowCursor): ArrowCursor + Expected (Qt::BusyCursor) : BusyCursor]]></Description> +</Incident> + <Duration msecs="0"/> </TestFunction> <TestFunction name="compare_boolfuncs"> <Incident type="pass" file="" line="0" /> -<Duration msecs="0"/> + <Duration msecs="0"/> </TestFunction> <TestFunction name="compare_pointerfuncs"> <Incident type="pass" file="" line="0" /> -<Duration msecs="0"/> + <Duration msecs="0"/> </TestFunction> <TestFunction name="compare_tostring"> -<Incident type="fail" file="tst_cmptest.cpp" line="219"> +<Incident type="fail" file="tst_cmptest.cpp" line="231"> <DataTag><![CDATA[int, string]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (actual) : QVariant(int,123) @@ -25,25 +39,25 @@ <Incident type="pass" file="" line="0"> <DataTag><![CDATA[both invalid]]></DataTag> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="219"> +<Incident type="fail" file="tst_cmptest.cpp" line="231"> <DataTag><![CDATA[null hash, invalid]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (actual) : QVariant(QVariantHash) Expected (expected): QVariant()]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="219"> +<Incident type="fail" file="tst_cmptest.cpp" line="231"> <DataTag><![CDATA[string, null user type]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (actual) : QVariant(QString,A simple string) Expected (expected): QVariant(PhonyClass)]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="219"> +<Incident type="fail" file="tst_cmptest.cpp" line="231"> <DataTag><![CDATA[both non-null user type]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (actual) : QVariant(PhonyClass,<value not representable as string>) Expected (expected): QVariant(PhonyClass,<value not representable as string>)]]></Description> </Incident> -<Duration msecs="0"/> + <Duration msecs="0"/> </TestFunction> <TestFunction name="compareQStringLists"> <Incident type="pass" file="" line="0"> @@ -52,65 +66,65 @@ <Incident type="pass" file="" line="0"> <DataTag><![CDATA[equal lists]]></DataTag> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="313"> +<Incident type="fail" file="tst_cmptest.cpp" line="325"> <DataTag><![CDATA[last item different]]></DataTag> <Description><![CDATA[Compared lists differ at index 2. Actual (opA): "string3" Expected (opB): "DIFFERS"]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="313"> +<Incident type="fail" file="tst_cmptest.cpp" line="325"> <DataTag><![CDATA[second-last item different]]></DataTag> <Description><![CDATA[Compared lists differ at index 2. Actual (opA): "string3" Expected (opB): "DIFFERS"]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="313"> +<Incident type="fail" file="tst_cmptest.cpp" line="325"> <DataTag><![CDATA[prefix]]></DataTag> <Description><![CDATA[Compared lists have different sizes. Actual (opA) size: 2 Expected (opB) size: 1]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="313"> +<Incident type="fail" file="tst_cmptest.cpp" line="325"> <DataTag><![CDATA[short list second]]></DataTag> <Description><![CDATA[Compared lists have different sizes. Actual (opA) size: 12 Expected (opB) size: 1]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="313"> +<Incident type="fail" file="tst_cmptest.cpp" line="325"> <DataTag><![CDATA[short list first]]></DataTag> <Description><![CDATA[Compared lists have different sizes. Actual (opA) size: 1 Expected (opB) size: 12]]></Description> </Incident> -<Duration msecs="0"/> + <Duration msecs="0"/> </TestFunction> <TestFunction name="compareQListInt"> -<Incident type="fail" file="tst_cmptest.cpp" line="320"> +<Incident type="fail" file="tst_cmptest.cpp" line="332"> <Description><![CDATA[Compared lists differ at index 2. Actual (int1): 3 Expected (int2): 4]]></Description> </Incident> -<Duration msecs="0"/> + <Duration msecs="0"/> </TestFunction> <TestFunction name="compareQListDouble"> -<Incident type="fail" file="tst_cmptest.cpp" line="327"> +<Incident type="fail" file="tst_cmptest.cpp" line="339"> <Description><![CDATA[Compared lists differ at index 0. Actual (double1): 1.5 Expected (double2): 1]]></Description> </Incident> -<Duration msecs="0"/> + <Duration msecs="0"/> </TestFunction> <TestFunction name="compareQPixmaps"> <Incident type="pass" file="" line="0"> <DataTag><![CDATA[both null]]></DataTag> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="353"> +<Incident type="fail" file="tst_cmptest.cpp" line="365"> <DataTag><![CDATA[one null]]></DataTag> <Description><![CDATA[Compared QPixmaps differ. Actual (opA).isNull(): 1 Expected (opB).isNull(): 0]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="353"> +<Incident type="fail" file="tst_cmptest.cpp" line="365"> <DataTag><![CDATA[other null]]></DataTag> <Description><![CDATA[Compared QPixmaps differ. Actual (opA).isNull(): 0 @@ -119,29 +133,29 @@ <Incident type="pass" file="" line="0"> <DataTag><![CDATA[equal]]></DataTag> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="353"> +<Incident type="fail" file="tst_cmptest.cpp" line="365"> <DataTag><![CDATA[different size]]></DataTag> <Description><![CDATA[Compared QPixmaps differ in size. Actual (opA): 11x20 Expected (opB): 20x20]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="353"> +<Incident type="fail" file="tst_cmptest.cpp" line="365"> <DataTag><![CDATA[different pixels]]></DataTag> <Description><![CDATA[Compared values are not the same]]></Description> </Incident> -<Duration msecs="0"/> + <Duration msecs="0"/> </TestFunction> <TestFunction name="compareQImages"> <Incident type="pass" file="" line="0"> <DataTag><![CDATA[both null]]></DataTag> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="380"> +<Incident type="fail" file="tst_cmptest.cpp" line="392"> <DataTag><![CDATA[one null]]></DataTag> <Description><![CDATA[Compared QImages differ. Actual (opA).isNull(): 1 Expected (opB).isNull(): 0]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="380"> +<Incident type="fail" file="tst_cmptest.cpp" line="392"> <DataTag><![CDATA[other null]]></DataTag> <Description><![CDATA[Compared QImages differ. Actual (opA).isNull(): 0 @@ -150,26 +164,50 @@ <Incident type="pass" file="" line="0"> <DataTag><![CDATA[equal]]></DataTag> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="380"> +<Incident type="fail" file="tst_cmptest.cpp" line="392"> <DataTag><![CDATA[different size]]></DataTag> <Description><![CDATA[Compared QImages differ in size. Actual (opA): 11x20 Expected (opB): 20x20]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="380"> +<Incident type="fail" file="tst_cmptest.cpp" line="392"> <DataTag><![CDATA[different format]]></DataTag> <Description><![CDATA[Compared QImages differ in format. Actual (opA): 6 Expected (opB): 3]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="380"> +<Incident type="fail" file="tst_cmptest.cpp" line="392"> <DataTag><![CDATA[different pixels]]></DataTag> <Description><![CDATA[Compared values are not the same]]></Description> </Incident> -<Duration msecs="0"/> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="verify"> +<Incident type="fail" file="tst_cmptest.cpp" line="404"> + <Description><![CDATA['opaqueFunc() < 2' returned FALSE. ()]]></Description> +</Incident> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="verify2"> +<Incident type="fail" file="tst_cmptest.cpp" line="410"> + <Description><![CDATA['opaqueFunc() < 2' returned FALSE. (42)]]></Description> +</Incident> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="tryVerify"> +<Incident type="fail" file="tst_cmptest.cpp" line="416"> + <Description><![CDATA['opaqueFunc() < 2' returned FALSE. ()]]></Description> +</Incident> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="tryVerify2"> +<Incident type="fail" file="tst_cmptest.cpp" line="422"> + <Description><![CDATA['opaqueFunc() < 2' returned FALSE. (42)]]></Description> +</Incident> + <Duration msecs="0"/> </TestFunction> <TestFunction name="cleanupTestCase"> <Incident type="pass" file="" line="0" /> -<Duration msecs="0"/> + <Duration msecs="0"/> </TestFunction> <Duration msecs="0"/> diff --git a/tests/auto/testlib/selftests/expected_cmptest.txt b/tests/auto/testlib/selftests/expected_cmptest.txt index 9e8c56ed99..70c54704f9 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.txt +++ b/tests/auto/testlib/selftests/expected_cmptest.txt @@ -1,91 +1,105 @@ ********* Start testing of tst_Cmptest ********* -Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ +Config: Using QtTest library PASS : tst_Cmptest::initTestCase() +FAIL! : tst_Cmptest::compare_unregistered_enums() Compared values are not the same + Loc: [tst_cmptest.cpp(154)] +FAIL! : tst_Cmptest::compare_registered_enums() Compared values are not the same + Actual (Qt::ArrowCursor): ArrowCursor + Expected (Qt::BusyCursor) : BusyCursor + Loc: [tst_cmptest.cpp(160)] PASS : tst_Cmptest::compare_boolfuncs() 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(219)] + Loc: [tst_cmptest.cpp(231)] 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(219)] + Loc: [tst_cmptest.cpp(231)] 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(219)] + Loc: [tst_cmptest.cpp(231)] FAIL! : tst_Cmptest::compare_tostring(both non-null user type) Compared values are not the same Actual (actual) : QVariant(PhonyClass,<value not representable as string>) Expected (expected): QVariant(PhonyClass,<value not representable as string>) - Loc: [tst_cmptest.cpp(219)] + Loc: [tst_cmptest.cpp(231)] 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(313)] + Loc: [tst_cmptest.cpp(325)] FAIL! : tst_Cmptest::compareQStringLists(second-last item different) Compared lists differ at index 2. Actual (opA): "string3" Expected (opB): "DIFFERS" - Loc: [tst_cmptest.cpp(313)] + Loc: [tst_cmptest.cpp(325)] FAIL! : tst_Cmptest::compareQStringLists(prefix) Compared lists have different sizes. Actual (opA) size: 2 Expected (opB) size: 1 - Loc: [tst_cmptest.cpp(313)] + Loc: [tst_cmptest.cpp(325)] FAIL! : tst_Cmptest::compareQStringLists(short list second) Compared lists have different sizes. Actual (opA) size: 12 Expected (opB) size: 1 - Loc: [tst_cmptest.cpp(313)] + Loc: [tst_cmptest.cpp(325)] FAIL! : tst_Cmptest::compareQStringLists(short list first) Compared lists have different sizes. Actual (opA) size: 1 Expected (opB) size: 12 - Loc: [tst_cmptest.cpp(313)] + Loc: [tst_cmptest.cpp(325)] FAIL! : tst_Cmptest::compareQListInt() Compared lists differ at index 2. Actual (int1): 3 Expected (int2): 4 - Loc: [tst_cmptest.cpp(320)] + Loc: [tst_cmptest.cpp(332)] FAIL! : tst_Cmptest::compareQListDouble() Compared lists differ at index 0. Actual (double1): 1.5 Expected (double2): 1 - Loc: [tst_cmptest.cpp(327)] + Loc: [tst_cmptest.cpp(339)] 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(353)] + Loc: [tst_cmptest.cpp(365)] FAIL! : tst_Cmptest::compareQPixmaps(other null) Compared QPixmaps differ. Actual (opA).isNull(): 0 Expected (opB).isNull(): 1 - Loc: [tst_cmptest.cpp(353)] + Loc: [tst_cmptest.cpp(365)] 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(353)] + Loc: [tst_cmptest.cpp(365)] FAIL! : tst_Cmptest::compareQPixmaps(different pixels) Compared values are not the same - Loc: [tst_cmptest.cpp(353)] + Loc: [tst_cmptest.cpp(365)] 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(380)] + Loc: [tst_cmptest.cpp(392)] FAIL! : tst_Cmptest::compareQImages(other null) Compared QImages differ. Actual (opA).isNull(): 0 Expected (opB).isNull(): 1 - Loc: [tst_cmptest.cpp(380)] + Loc: [tst_cmptest.cpp(392)] 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(380)] + Loc: [tst_cmptest.cpp(392)] FAIL! : tst_Cmptest::compareQImages(different format) Compared QImages differ in format. Actual (opA): 6 Expected (opB): 3 - Loc: [tst_cmptest.cpp(380)] + Loc: [tst_cmptest.cpp(392)] FAIL! : tst_Cmptest::compareQImages(different pixels) Compared values are not the same - Loc: [tst_cmptest.cpp(380)] + Loc: [tst_cmptest.cpp(392)] +FAIL! : tst_Cmptest::verify() 'opaqueFunc() < 2' returned FALSE. () + Loc: [tst_cmptest.cpp(404)] +FAIL! : tst_Cmptest::verify2() 'opaqueFunc() < 2' returned FALSE. (42) + Loc: [tst_cmptest.cpp(410)] +FAIL! : tst_Cmptest::tryVerify() 'opaqueFunc() < 2' returned FALSE. () + Loc: [tst_cmptest.cpp(416)] +FAIL! : tst_Cmptest::tryVerify2() 'opaqueFunc() < 2' returned FALSE. (42) + Loc: [tst_cmptest.cpp(422)] PASS : tst_Cmptest::cleanupTestCase() -Totals: 11 passed, 20 failed, 0 skipped, 0 blacklisted +Totals: 11 passed, 26 failed, 0 skipped, 0 blacklisted ********* Finished testing of tst_Cmptest ********* diff --git a/tests/auto/testlib/selftests/expected_cmptest.xml b/tests/auto/testlib/selftests/expected_cmptest.xml index aefb1b5f4c..9437e8e4b7 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.xml +++ b/tests/auto/testlib/selftests/expected_cmptest.xml @@ -7,18 +7,32 @@ </Environment> <TestFunction name="initTestCase"> <Incident type="pass" file="" line="0" /> -<Duration msecs="0"/> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="compare_unregistered_enums"> +<Incident type="fail" file="tst_cmptest.cpp" line="154"> + <Description><![CDATA[Compared values are not the same]]></Description> +</Incident> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="compare_registered_enums"> +<Incident type="fail" file="tst_cmptest.cpp" line="160"> + <Description><![CDATA[Compared values are not the same + Actual (Qt::ArrowCursor): ArrowCursor + Expected (Qt::BusyCursor) : BusyCursor]]></Description> +</Incident> + <Duration msecs="0"/> </TestFunction> <TestFunction name="compare_boolfuncs"> <Incident type="pass" file="" line="0" /> -<Duration msecs="0"/> + <Duration msecs="0"/> </TestFunction> <TestFunction name="compare_pointerfuncs"> <Incident type="pass" file="" line="0" /> -<Duration msecs="0"/> + <Duration msecs="0"/> </TestFunction> <TestFunction name="compare_tostring"> -<Incident type="fail" file="tst_cmptest.cpp" line="219"> +<Incident type="fail" file="tst_cmptest.cpp" line="231"> <DataTag><![CDATA[int, string]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (actual) : QVariant(int,123) @@ -27,25 +41,25 @@ <Incident type="pass" file="" line="0"> <DataTag><![CDATA[both invalid]]></DataTag> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="219"> +<Incident type="fail" file="tst_cmptest.cpp" line="231"> <DataTag><![CDATA[null hash, invalid]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (actual) : QVariant(QVariantHash) Expected (expected): QVariant()]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="219"> +<Incident type="fail" file="tst_cmptest.cpp" line="231"> <DataTag><![CDATA[string, null user type]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (actual) : QVariant(QString,A simple string) Expected (expected): QVariant(PhonyClass)]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="219"> +<Incident type="fail" file="tst_cmptest.cpp" line="231"> <DataTag><![CDATA[both non-null user type]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (actual) : QVariant(PhonyClass,<value not representable as string>) Expected (expected): QVariant(PhonyClass,<value not representable as string>)]]></Description> </Incident> -<Duration msecs="0"/> + <Duration msecs="0"/> </TestFunction> <TestFunction name="compareQStringLists"> <Incident type="pass" file="" line="0"> @@ -54,65 +68,65 @@ <Incident type="pass" file="" line="0"> <DataTag><![CDATA[equal lists]]></DataTag> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="313"> +<Incident type="fail" file="tst_cmptest.cpp" line="325"> <DataTag><![CDATA[last item different]]></DataTag> <Description><![CDATA[Compared lists differ at index 2. Actual (opA): "string3" Expected (opB): "DIFFERS"]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="313"> +<Incident type="fail" file="tst_cmptest.cpp" line="325"> <DataTag><![CDATA[second-last item different]]></DataTag> <Description><![CDATA[Compared lists differ at index 2. Actual (opA): "string3" Expected (opB): "DIFFERS"]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="313"> +<Incident type="fail" file="tst_cmptest.cpp" line="325"> <DataTag><![CDATA[prefix]]></DataTag> <Description><![CDATA[Compared lists have different sizes. Actual (opA) size: 2 Expected (opB) size: 1]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="313"> +<Incident type="fail" file="tst_cmptest.cpp" line="325"> <DataTag><![CDATA[short list second]]></DataTag> <Description><![CDATA[Compared lists have different sizes. Actual (opA) size: 12 Expected (opB) size: 1]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="313"> +<Incident type="fail" file="tst_cmptest.cpp" line="325"> <DataTag><![CDATA[short list first]]></DataTag> <Description><![CDATA[Compared lists have different sizes. Actual (opA) size: 1 Expected (opB) size: 12]]></Description> </Incident> -<Duration msecs="0"/> + <Duration msecs="0"/> </TestFunction> <TestFunction name="compareQListInt"> -<Incident type="fail" file="tst_cmptest.cpp" line="320"> +<Incident type="fail" file="tst_cmptest.cpp" line="332"> <Description><![CDATA[Compared lists differ at index 2. Actual (int1): 3 Expected (int2): 4]]></Description> </Incident> -<Duration msecs="0"/> + <Duration msecs="0"/> </TestFunction> <TestFunction name="compareQListDouble"> -<Incident type="fail" file="tst_cmptest.cpp" line="327"> +<Incident type="fail" file="tst_cmptest.cpp" line="339"> <Description><![CDATA[Compared lists differ at index 0. Actual (double1): 1.5 Expected (double2): 1]]></Description> </Incident> -<Duration msecs="0"/> + <Duration msecs="0"/> </TestFunction> <TestFunction name="compareQPixmaps"> <Incident type="pass" file="" line="0"> <DataTag><![CDATA[both null]]></DataTag> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="353"> +<Incident type="fail" file="tst_cmptest.cpp" line="365"> <DataTag><![CDATA[one null]]></DataTag> <Description><![CDATA[Compared QPixmaps differ. Actual (opA).isNull(): 1 Expected (opB).isNull(): 0]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="353"> +<Incident type="fail" file="tst_cmptest.cpp" line="365"> <DataTag><![CDATA[other null]]></DataTag> <Description><![CDATA[Compared QPixmaps differ. Actual (opA).isNull(): 0 @@ -121,29 +135,29 @@ <Incident type="pass" file="" line="0"> <DataTag><![CDATA[equal]]></DataTag> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="353"> +<Incident type="fail" file="tst_cmptest.cpp" line="365"> <DataTag><![CDATA[different size]]></DataTag> <Description><![CDATA[Compared QPixmaps differ in size. Actual (opA): 11x20 Expected (opB): 20x20]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="353"> +<Incident type="fail" file="tst_cmptest.cpp" line="365"> <DataTag><![CDATA[different pixels]]></DataTag> <Description><![CDATA[Compared values are not the same]]></Description> </Incident> -<Duration msecs="0"/> + <Duration msecs="0"/> </TestFunction> <TestFunction name="compareQImages"> <Incident type="pass" file="" line="0"> <DataTag><![CDATA[both null]]></DataTag> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="380"> +<Incident type="fail" file="tst_cmptest.cpp" line="392"> <DataTag><![CDATA[one null]]></DataTag> <Description><![CDATA[Compared QImages differ. Actual (opA).isNull(): 1 Expected (opB).isNull(): 0]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="380"> +<Incident type="fail" file="tst_cmptest.cpp" line="392"> <DataTag><![CDATA[other null]]></DataTag> <Description><![CDATA[Compared QImages differ. Actual (opA).isNull(): 0 @@ -152,27 +166,51 @@ <Incident type="pass" file="" line="0"> <DataTag><![CDATA[equal]]></DataTag> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="380"> +<Incident type="fail" file="tst_cmptest.cpp" line="392"> <DataTag><![CDATA[different size]]></DataTag> <Description><![CDATA[Compared QImages differ in size. Actual (opA): 11x20 Expected (opB): 20x20]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="380"> +<Incident type="fail" file="tst_cmptest.cpp" line="392"> <DataTag><![CDATA[different format]]></DataTag> <Description><![CDATA[Compared QImages differ in format. Actual (opA): 6 Expected (opB): 3]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="380"> +<Incident type="fail" file="tst_cmptest.cpp" line="392"> <DataTag><![CDATA[different pixels]]></DataTag> <Description><![CDATA[Compared values are not the same]]></Description> </Incident> -<Duration msecs="0"/> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="verify"> +<Incident type="fail" file="tst_cmptest.cpp" line="404"> + <Description><![CDATA['opaqueFunc() < 2' returned FALSE. ()]]></Description> +</Incident> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="verify2"> +<Incident type="fail" file="tst_cmptest.cpp" line="410"> + <Description><![CDATA['opaqueFunc() < 2' returned FALSE. (42)]]></Description> +</Incident> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="tryVerify"> +<Incident type="fail" file="tst_cmptest.cpp" line="416"> + <Description><![CDATA['opaqueFunc() < 2' returned FALSE. ()]]></Description> +</Incident> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="tryVerify2"> +<Incident type="fail" file="tst_cmptest.cpp" line="422"> + <Description><![CDATA['opaqueFunc() < 2' returned FALSE. (42)]]></Description> +</Incident> + <Duration msecs="0"/> </TestFunction> <TestFunction name="cleanupTestCase"> <Incident type="pass" file="" line="0" /> -<Duration msecs="0"/> + <Duration msecs="0"/> </TestFunction> <Duration msecs="0"/> </TestCase> diff --git a/tests/auto/testlib/selftests/expected_cmptest.xunitxml b/tests/auto/testlib/selftests/expected_cmptest.xunitxml index 7502d3cc54..fa970d4172 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.xunitxml +++ b/tests/auto/testlib/selftests/expected_cmptest.xunitxml @@ -1,11 +1,19 @@ <?xml version="1.0" encoding="UTF-8" ?> -<testsuite errors="0" failures="20" tests="10" name="tst_Cmptest"> +<testsuite errors="0" failures="26" tests="16" name="tst_Cmptest"> <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> + <testcase result="fail" name="compare_unregistered_enums"> + <failure message="Compared values are not the same" result="fail"/> + </testcase> + <testcase result="fail" name="compare_registered_enums"> + <failure message="Compared values are not the same + Actual (Qt::ArrowCursor): ArrowCursor + Expected (Qt::BusyCursor) : BusyCursor" result="fail"/> + </testcase> <testcase result="pass" name="compare_boolfuncs"/> <testcase result="pass" name="compare_pointerfuncs"/> <testcase result="fail" name="compare_tostring"> @@ -76,6 +84,18 @@ Expected (opB): 3" result="fail"/> <failure tag="different pixels" message="Compared values are not the same" result="fail"/> </testcase> + <testcase result="fail" name="verify"> + <failure message="'opaqueFunc() < 2' returned FALSE. ()" result="fail"/> + </testcase> + <testcase result="fail" name="verify2"> + <failure message="'opaqueFunc() < 2' returned FALSE. (42)" result="fail"/> + </testcase> + <testcase result="fail" name="tryVerify"> + <failure message="'opaqueFunc() < 2' returned FALSE. ()" result="fail"/> + </testcase> + <testcase result="fail" name="tryVerify2"> + <failure message="'opaqueFunc() < 2' returned FALSE. (42)" result="fail"/> + </testcase> <testcase result="pass" name="cleanupTestCase"/> <system-err/> </testsuite> diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 6536f103ac..9b76bca28c 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -571,7 +571,9 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge #endif QProcess proc; - static const QProcessEnvironment environment = processEnvironment(); + QProcessEnvironment environment = processEnvironment(); + if (crashes) + environment.insert("QTEST_DISABLE_STACK_DUMP", "1"); proc.setProcessEnvironment(environment); const QString path = subdir + QLatin1Char('/') + subdir; proc.start(path, arguments); @@ -626,8 +628,8 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge QList<QByteArray> res = splitLines(actualOutputs[n]); const QString expectedFileName = expectedFileNameFromTest(subdir, logger); QList<QByteArray> exp = expectedResult(expectedFileName); -#if defined (Q_CC_MSVC) || defined(Q_CC_MINGW) - // MSVC, MinGW format double numbers differently +#if (defined (Q_CC_MSVC) && _MSC_VER < 1900)|| defined(Q_CC_MINGW) + // MSVC up to MSVC2013, MinGW format double numbers differently if (n == 0 && subdir == QStringLiteral("float")) { for (int i = 0; i < exp.size(); ++i) { exp[i].replace("e-07", "e-007"); |