04b180f7f2
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>
34 lines
1.2 KiB
Plaintext
34 lines
1.2 KiB
Plaintext
TAP version 13
|
|
# tst_TupleDiagnostics
|
|
ok 1 - initTestCase()
|
|
ok 2 - testEmptyTuple()
|
|
not ok 3 - testSimpleTuple()
|
|
---
|
|
type: QCOMPARE
|
|
message: Compared values are not the same
|
|
wanted: std::tuple(2) (std::tuple<int>{2})
|
|
found: std::tuple(1) (std::tuple<int>{1})
|
|
expected: std::tuple(2) (std::tuple<int>{2})
|
|
actual: std::tuple(1) (std::tuple<int>{1})
|
|
at: tst_TupleDiagnostics::testSimpleTuple() (/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp:53)
|
|
file: /localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp
|
|
line: 53
|
|
...
|
|
not ok 4 - testTuple()
|
|
---
|
|
type: QCOMPARE
|
|
message: Compared values are not the same
|
|
wanted: std::tuple(42, 'Y', "tuple2") (tuple2)
|
|
found: std::tuple(42, 'Y', "tuple1") (tuple1)
|
|
expected: std::tuple(42, 'Y', "tuple2") (tuple2)
|
|
actual: std::tuple(42, 'Y', "tuple1") (tuple1)
|
|
at: tst_TupleDiagnostics::testTuple() (/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp:60)
|
|
file: /localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp
|
|
line: 60
|
|
...
|
|
ok 5 - cleanupTestCase()
|
|
1..5
|
|
# tests 5
|
|
# pass 3
|
|
# fail 2
|