summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/expected_cmptest.txt
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-10 11:41:33 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-21 22:01:20 +0200
commitd25589e0529732996e405aaff8d6c46b012e1601 (patch)
tree29b596d0c2ca0e36aa9aea65f426ed393c660e78 /tests/auto/testlib/selftests/expected_cmptest.txt
parentb50daef9771d8829fc7f808898cbe051a5464b79 (diff)
QTestlib: Enable comparing QList against initializer lists/arrays
It is unnecessary to create a QList container just for comparison. Split out helpers for comparing sequence sizes and sequences from qCompare(QList) and add a template for an array with a non-type template parameter for the size. One can then write something like: const int expected[] = {10, 12,...}; QCOMPARE(QFontDatabase.pointSizes(...), expected) Unfortunately, any commas in such an array will be misread by macro expansion as macro argument separators, so any expected array with more than one entry needs an extra macro expanding __VA_ARGS__. Change-Id: Ie7c8dc20bf669bbb25f6d7f8562455f8d03968c8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests/auto/testlib/selftests/expected_cmptest.txt')
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.txt31
1 files changed, 27 insertions, 4 deletions
diff --git a/tests/auto/testlib/selftests/expected_cmptest.txt b/tests/auto/testlib/selftests/expected_cmptest.txt
index 08877ef74d..527ec991bb 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.txt
+++ b/tests/auto/testlib/selftests/expected_cmptest.txt
@@ -71,9 +71,32 @@ FAIL! : tst_Cmptest::compareQStringLists(short list first) Compared lists have
Actual (opA) size: 1
Expected (opB) size: 12
Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
-FAIL! : tst_Cmptest::compareQListInt() Compared lists differ at index 2.
- Actual (int1): 3
- Expected (int2): 4
+PASS : tst_Cmptest::compareQListInt(match)
+FAIL! : tst_Cmptest::compareQListInt(size mismatch) Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (expected) size: 3
+ Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
+FAIL! : tst_Cmptest::compareQListInt(value mismatch) Compared lists differ at index 2.
+ Actual (actual): 4
+ Expected (expected): 3
+ Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
+PASS : tst_Cmptest::compareQListIntToArray(match)
+FAIL! : tst_Cmptest::compareQListIntToArray(size mismatch) Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (expected) size: 3
+ Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
+FAIL! : tst_Cmptest::compareQListIntToArray(value mismatch) Compared lists differ at index 2.
+ Actual (actual): 4
+ Expected (expected): 3
+ Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
+PASS : tst_Cmptest::compareQListIntToInitializerList(match)
+FAIL! : tst_Cmptest::compareQListIntToInitializerList(size mismatch) Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (ARG({1, 2, 3})) size: 3
+ Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
+FAIL! : tst_Cmptest::compareQListIntToInitializerList(value mismatch) Compared lists differ at index 2.
+ Actual (actual): 4
+ Expected (ARG({1, 2, 3})): 3
Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
FAIL! : tst_Cmptest::compareQListDouble() Compared lists differ at index 0.
Actual (double1): 1.5
@@ -164,5 +187,5 @@ FAIL! : tst_Cmptest::tryVerify2() 'opaqueFunc() < 2' returned FALSE. (42)
Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
PASS : tst_Cmptest::verifyExplicitOperatorBool()
PASS : tst_Cmptest::cleanupTestCase()
-Totals: 18 passed, 40 failed, 0 skipped, 0 blacklisted, 0ms
+Totals: 21 passed, 45 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Cmptest *********