summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/expected_tuplediagnostics.txt
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@edeltech.ch>2017-12-07 09:46:30 +0100
committerSamuel Gaist <samuel.gaist@edeltech.ch>2018-06-03 20:26:38 +0000
commit04b180f7f25d73d002df31085cf1c352e075d4e5 (patch)
tree63b20b4fb53704192e231b1fa208885698066c23 /tests/auto/testlib/selftests/expected_tuplediagnostics.txt
parent9998654eacfa07a567e25ac5f2e557f61091145d (diff)
Improve std::tuple handling in tests
Currently when doing comparison with std::tuple the fallback toString method is called which returns a Q_NULLPTR thus not allowing proper diagnostic of the values that triggered an error. This patch adds support for std::tuple to improve the tests output readability. [ChangeLog][QtTest][QCOMPARE] Now outputs contents of std::tuple on failure. Change-Id: I046a55e2ce44c3f7728d51e4745120d38aa5e007 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/testlib/selftests/expected_tuplediagnostics.txt')
-rw-r--r--tests/auto/testlib/selftests/expected_tuplediagnostics.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.txt b/tests/auto/testlib/selftests/expected_tuplediagnostics.txt
new file mode 100644
index 0000000000..ce568bf6c0
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.txt
@@ -0,0 +1,15 @@
+********* Start testing of tst_TupleDiagnostics *********
+Config: Using QtTest library
+PASS : tst_TupleDiagnostics::initTestCase()
+PASS : tst_TupleDiagnostics::testEmptyTuple()
+FAIL! : tst_TupleDiagnostics::testSimpleTuple() Compared values are not the same
+ Actual (std::tuple<int>{1}): std::tuple(1)
+ Expected (std::tuple<int>{2}): std::tuple(2)
+ Loc: [/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)]
+FAIL! : tst_TupleDiagnostics::testTuple() Compared values are not the same
+ Actual (tuple1): std::tuple(42, 'Y', "tuple1")
+ Expected (tuple2): std::tuple(42, 'Y', "tuple2")
+ Loc: [/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)]
+PASS : tst_TupleDiagnostics::cleanupTestCase()
+Totals: 3 passed, 2 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_TupleDiagnostics *********