Add QCOMPARE_{EQ,NE,LT,LE,GT,GE}()
[ChangeLog][QTestLib] Add QCOMPARE_{EQ,NE,LT,LE,GT,GE}()
macros. These new macros behave similarly to QVERIFY(a op b),
where 'op' is ==, !=, <, <=, >, >= respectively, but print
a formatted error message with argument values in case of failure.
The formatting is done lazily, which means that the strings will
be generated only when the comparison fails.
Also add a new test for tst_selftest and generate expected output
for it.
Fixes: QTBUG-98873
Task-number: QTBUG-98874
Change-Id: Ic8074798901d7a469b1f58d5cd28bbf49a3da1db
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-05-19 11:48:45 +00:00
|
|
|
********* Start testing of tst_ExtendedCompare *********
|
|
|
|
Config: Using QtTest library
|
|
|
|
PASS : tst_ExtendedCompare::initTestCase()
|
|
|
|
PASS : tst_ExtendedCompare::compareInts(EQ:left == right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareInts(EQ:left < right) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 2
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareInts(EQ:left > right) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (lhs): 2
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareInts(NE:left == right) Left value is expected to be different from right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareInts(NE:left < right)
|
|
|
|
PASS : tst_ExtendedCompare::compareInts(NE:left > right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareInts(LT:left == right) Left value is expected to be less than right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareInts(LT:left < right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareInts(LT:left > right) Left value is expected to be less than right value, but is not
|
|
|
|
Left (lhs): 2
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareInts(LE:left == right)
|
|
|
|
PASS : tst_ExtendedCompare::compareInts(LE:left < right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareInts(LE:left > right) Left value is expected to be less than or equal to right value, but is not
|
|
|
|
Left (lhs): 2
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareInts(GT:left == right) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareInts(GT:left < right) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 2
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareInts(GT:left > right)
|
|
|
|
PASS : tst_ExtendedCompare::compareInts(GE:left == right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareInts(GE:left < right) Left value is expected to be greater than or equal to right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 2
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareInts(GE:left > right)
|
|
|
|
PASS : tst_ExtendedCompare::compareFloats(EQ:left == right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareFloats(EQ:left < right) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 1.1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareFloats(EQ:left > right) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (lhs): 1.1
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareFloats(NE:left == right) Left value is expected to be different from right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareFloats(NE:left < right)
|
|
|
|
PASS : tst_ExtendedCompare::compareFloats(NE:left > right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareFloats(LT:left == right) Left value is expected to be less than right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareFloats(LT:left < right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareFloats(LT:left > right) Left value is expected to be less than right value, but is not
|
|
|
|
Left (lhs): 1.1
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareFloats(LE:left == right)
|
|
|
|
PASS : tst_ExtendedCompare::compareFloats(LE:left < right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareFloats(LE:left > right) Left value is expected to be less than or equal to right value, but is not
|
|
|
|
Left (lhs): 1.1
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareFloats(GT:left == right) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareFloats(GT:left < right) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 1.1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareFloats(GT:left > right)
|
|
|
|
PASS : tst_ExtendedCompare::compareFloats(GE:left == right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareFloats(GE:left < right) Left value is expected to be greater than or equal to right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 1.1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareFloats(GE:left > right)
|
|
|
|
PASS : tst_ExtendedCompare::compareDoubles(EQ:left == right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareDoubles(EQ:left < right) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (lhs): 0
|
|
|
|
Right (rhs): 0.1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareDoubles(EQ:left > right) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (lhs): 0.1
|
|
|
|
Right (rhs): 0
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareDoubles(NE:left == right) Left value is expected to be different from right value, but is not
|
|
|
|
Left (lhs): 0
|
|
|
|
Right (rhs): 0
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareDoubles(NE:left < right)
|
|
|
|
PASS : tst_ExtendedCompare::compareDoubles(NE:left > right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareDoubles(LT:left == right) Left value is expected to be less than right value, but is not
|
|
|
|
Left (lhs): 0
|
|
|
|
Right (rhs): 0
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareDoubles(LT:left < right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareDoubles(LT:left > right) Left value is expected to be less than right value, but is not
|
|
|
|
Left (lhs): 0.1
|
|
|
|
Right (rhs): 0
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareDoubles(LE:left == right)
|
|
|
|
PASS : tst_ExtendedCompare::compareDoubles(LE:left < right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareDoubles(LE:left > right) Left value is expected to be less than or equal to right value, but is not
|
|
|
|
Left (lhs): 0.1
|
|
|
|
Right (rhs): 0
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareDoubles(GT:left == right) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (lhs): 0
|
|
|
|
Right (rhs): 0
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareDoubles(GT:left < right) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (lhs): 0
|
|
|
|
Right (rhs): 0.1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareDoubles(GT:left > right)
|
|
|
|
PASS : tst_ExtendedCompare::compareDoubles(GE:left == right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareDoubles(GE:left < right) Left value is expected to be greater than or equal to right value, but is not
|
|
|
|
Left (lhs): 0
|
|
|
|
Right (rhs): 0.1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareDoubles(GE:left > right)
|
|
|
|
PASS : tst_ExtendedCompare::comparePointers(EQ:left == right)
|
|
|
|
FAIL! : tst_ExtendedCompare::comparePointers(EQ:left < right) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 2
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::comparePointers(EQ:left > right) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (lhs): 2
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::comparePointers(NE:left == right) Left value is expected to be different from right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::comparePointers(NE:left < right)
|
|
|
|
PASS : tst_ExtendedCompare::comparePointers(NE:left > right)
|
|
|
|
FAIL! : tst_ExtendedCompare::comparePointers(LT:left == right) Left value is expected to be less than right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::comparePointers(LT:left < right)
|
|
|
|
FAIL! : tst_ExtendedCompare::comparePointers(LT:left > right) Left value is expected to be less than right value, but is not
|
|
|
|
Left (lhs): 2
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::comparePointers(LE:left == right)
|
|
|
|
PASS : tst_ExtendedCompare::comparePointers(LE:left < right)
|
|
|
|
FAIL! : tst_ExtendedCompare::comparePointers(LE:left > right) Left value is expected to be less than or equal to right value, but is not
|
|
|
|
Left (lhs): 2
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::comparePointers(GT:left == right) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::comparePointers(GT:left < right) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 2
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::comparePointers(GT:left > right)
|
|
|
|
PASS : tst_ExtendedCompare::comparePointers(GE:left == right)
|
|
|
|
FAIL! : tst_ExtendedCompare::comparePointers(GE:left < right) Left value is expected to be greater than or equal to right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 2
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::comparePointers(GE:left > right)
|
|
|
|
PASS : tst_ExtendedCompare::compareToNullptr(EQ:left == right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareToNullptr(EQ:left < right) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (lhs): "nullptr"
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareToNullptr(EQ:left > right) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): "nullptr"
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareToNullptr(NE:left == right) Left value is expected to be different from right value, but is not
|
|
|
|
Left (lhs): "nullptr"
|
|
|
|
Right (rhs): "nullptr"
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareToNullptr(NE:left < right)
|
|
|
|
PASS : tst_ExtendedCompare::compareToNullptr(NE:left > right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareToNullptr(LT:left == right) Left value is expected to be less than right value, but is not
|
|
|
|
Left (lhs): "nullptr"
|
|
|
|
Right (rhs): "nullptr"
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareToNullptr(LT:left < right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareToNullptr(LT:left > right) Left value is expected to be less than right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): "nullptr"
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareToNullptr(LE:left == right)
|
|
|
|
PASS : tst_ExtendedCompare::compareToNullptr(LE:left < right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareToNullptr(LE:left > right) Left value is expected to be less than or equal to right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): "nullptr"
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareToNullptr(GT:left == right) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (lhs): "nullptr"
|
|
|
|
Right (rhs): "nullptr"
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareToNullptr(GT:left < right) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (lhs): "nullptr"
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareToNullptr(GT:left > right)
|
|
|
|
PASS : tst_ExtendedCompare::compareToNullptr(GE:left == right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareToNullptr(GE:left < right) Left value is expected to be greater than or equal to right value, but is not
|
|
|
|
Left (lhs): "nullptr"
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareToNullptr(GE:left > right)
|
|
|
|
PASS : tst_ExtendedCompare::compareUnregistereEnum(EQ:left == right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareUnregistereEnum(EQ:left < right) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (lhs): 0
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareUnregistereEnum(EQ:left > right) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 0
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareUnregistereEnum(NE:left == right) Left value is expected to be different from right value, but is not
|
|
|
|
Left (lhs): 0
|
|
|
|
Right (rhs): 0
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareUnregistereEnum(NE:left < right)
|
|
|
|
PASS : tst_ExtendedCompare::compareUnregistereEnum(NE:left > right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareUnregistereEnum(LT:left == right) Left value is expected to be less than right value, but is not
|
|
|
|
Left (lhs): 0
|
|
|
|
Right (rhs): 0
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareUnregistereEnum(LT:left < right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareUnregistereEnum(LT:left > right) Left value is expected to be less than right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 0
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareUnregistereEnum(LE:left == right)
|
|
|
|
PASS : tst_ExtendedCompare::compareUnregistereEnum(LE:left < right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareUnregistereEnum(LE:left > right) Left value is expected to be less than or equal to right value, but is not
|
|
|
|
Left (lhs): 1
|
|
|
|
Right (rhs): 0
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareUnregistereEnum(GT:left == right) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (lhs): 0
|
|
|
|
Right (rhs): 0
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareUnregistereEnum(GT:left < right) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (lhs): 0
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareUnregistereEnum(GT:left > right)
|
|
|
|
PASS : tst_ExtendedCompare::compareUnregistereEnum(GE:left == right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareUnregistereEnum(GE:left < right) Left value is expected to be greater than or equal to right value, but is not
|
|
|
|
Left (lhs): 0
|
|
|
|
Right (rhs): 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareUnregistereEnum(GE:left > right)
|
|
|
|
PASS : tst_ExtendedCompare::compareRegistereEnum(EQ:left == right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareRegistereEnum(EQ:left < right) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (lhs): Monday
|
|
|
|
Right (rhs): Sunday
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareRegistereEnum(EQ:left > right) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (lhs): Sunday
|
|
|
|
Right (rhs): Monday
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareRegistereEnum(NE:left == right) Left value is expected to be different from right value, but is not
|
|
|
|
Left (lhs): Monday
|
|
|
|
Right (rhs): Monday
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareRegistereEnum(NE:left < right)
|
|
|
|
PASS : tst_ExtendedCompare::compareRegistereEnum(NE:left > right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareRegistereEnum(LT:left == right) Left value is expected to be less than right value, but is not
|
|
|
|
Left (lhs): Monday
|
|
|
|
Right (rhs): Monday
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareRegistereEnum(LT:left < right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareRegistereEnum(LT:left > right) Left value is expected to be less than right value, but is not
|
|
|
|
Left (lhs): Sunday
|
|
|
|
Right (rhs): Monday
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareRegistereEnum(LE:left == right)
|
|
|
|
PASS : tst_ExtendedCompare::compareRegistereEnum(LE:left < right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareRegistereEnum(LE:left > right) Left value is expected to be less than or equal to right value, but is not
|
|
|
|
Left (lhs): Sunday
|
|
|
|
Right (rhs): Monday
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareRegistereEnum(GT:left == right) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (lhs): Monday
|
|
|
|
Right (rhs): Monday
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareRegistereEnum(GT:left < right) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (lhs): Monday
|
|
|
|
Right (rhs): Sunday
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareRegistereEnum(GT:left > right)
|
|
|
|
PASS : tst_ExtendedCompare::compareRegistereEnum(GE:left == right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareRegistereEnum(GE:left < right) Left value is expected to be greater than or equal to right value, but is not
|
|
|
|
Left (lhs): Monday
|
|
|
|
Right (rhs): Sunday
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareRegistereEnum(GE:left > right)
|
|
|
|
PASS : tst_ExtendedCompare::compareCustomTypes(EQ:left == right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareCustomTypes(EQ:left < right) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (lhs): MyClass(1)
|
|
|
|
Right (rhs): MyClass(2)
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareCustomTypes(EQ:left > right) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (lhs): MyClass(2)
|
|
|
|
Right (rhs): MyClass(1)
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareCustomTypes(NE:left == right) Left value is expected to be different from right value, but is not
|
|
|
|
Left (lhs): MyClass(1)
|
|
|
|
Right (rhs): MyClass(1)
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareCustomTypes(NE:left < right)
|
|
|
|
PASS : tst_ExtendedCompare::compareCustomTypes(NE:left > right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareCustomTypes(LT:left == right) Left value is expected to be less than right value, but is not
|
|
|
|
Left (lhs): MyClass(1)
|
|
|
|
Right (rhs): MyClass(1)
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareCustomTypes(LT:left < right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareCustomTypes(LT:left > right) Left value is expected to be less than right value, but is not
|
|
|
|
Left (lhs): MyClass(2)
|
|
|
|
Right (rhs): MyClass(1)
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareCustomTypes(LE:left == right)
|
|
|
|
PASS : tst_ExtendedCompare::compareCustomTypes(LE:left < right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareCustomTypes(LE:left > right) Left value is expected to be less than or equal to right value, but is not
|
|
|
|
Left (lhs): MyClass(2)
|
|
|
|
Right (rhs): MyClass(1)
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareCustomTypes(GT:left == right) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (lhs): MyClass(1)
|
|
|
|
Right (rhs): MyClass(1)
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::compareCustomTypes(GT:left < right) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (lhs): MyClass(1)
|
|
|
|
Right (rhs): MyClass(2)
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareCustomTypes(GT:left > right)
|
|
|
|
PASS : tst_ExtendedCompare::compareCustomTypes(GE:left == right)
|
|
|
|
FAIL! : tst_ExtendedCompare::compareCustomTypes(GE:left < right) Left value is expected to be greater than or equal to right value, but is not
|
|
|
|
Left (lhs): MyClass(1)
|
|
|
|
Right (rhs): MyClass(2)
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::compareCustomTypes(GE:left > right)
|
|
|
|
FAIL! : tst_ExtendedCompare::checkComparisonForTemporaryObjects(EQ) Left value is expected to be equal to right value, but is not
|
|
|
|
Left (getClassForValue(0).getValuePointer()): MyClass(2) on memory address with index 0
|
|
|
|
Right (getClassForValue(1).getValuePointer()): MyClass(1) on memory address with index 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::checkComparisonForTemporaryObjects(NE)
|
|
|
|
PASS : tst_ExtendedCompare::checkComparisonForTemporaryObjects(LT)
|
|
|
|
PASS : tst_ExtendedCompare::checkComparisonForTemporaryObjects(LE)
|
|
|
|
FAIL! : tst_ExtendedCompare::checkComparisonForTemporaryObjects(GT) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (getClassForValue(0).getValuePointer()): MyClass(2) on memory address with index 0
|
|
|
|
Right (getClassForValue(1).getValuePointer()): MyClass(1) on memory address with index 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::checkComparisonForTemporaryObjects(GE) Left value is expected to be greater than or equal to right value, but is not
|
|
|
|
Left (getClassForValue(0).getValuePointer()): MyClass(2) on memory address with index 0
|
|
|
|
Right (getClassForValue(1).getValuePointer()): MyClass(1) on memory address with index 1
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
Add QTRY_COMPARE_{EQ,NE,LT,LE,GT,GE}_WITH_TIMEOUT()
[ChangeLog][QTestLib] Add QTRY_COMPARE_{EQ,NE,LT,LE,GT,GE}_WITH_TIMEOUT
macros that repeatedly execute QCOMPARE_{EQ,NE,LT,LE,GT,GE} until either
the comparison returns true or the timeout expires. Also add
QTRY_COMPARE_{EQ,NE,LT,LE,GT,GE} macros that simply invoke the
*_WITH_TIMEOUT versions with the usual timeout of five seconds.
Task-number: QTBUG-98873
Change-Id: Ib0d7d1c8c997f442b46acd85da738a8f512cc875
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-06-02 09:51:49 +00:00
|
|
|
PASS : tst_ExtendedCompare::checkComparisonWithTimeout(EQ)
|
|
|
|
PASS : tst_ExtendedCompare::checkComparisonWithTimeout(NE)
|
|
|
|
FAIL! : tst_ExtendedCompare::checkComparisonWithTimeout(LT) Left value is expected to be less than right value, but is not
|
|
|
|
Left (c) : ClassWithDeferredSetter(1)
|
|
|
|
Right (ClassWithDeferredSetter(0)): ClassWithDeferredSetter(0)
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::checkComparisonWithTimeout(LE) Left value is expected to be less than or equal to right value, but is not
|
|
|
|
Left (c) : ClassWithDeferredSetter(1)
|
|
|
|
Right (ClassWithDeferredSetter(-1)): ClassWithDeferredSetter(-1)
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
FAIL! : tst_ExtendedCompare::checkComparisonWithTimeout(GT) Left value is expected to be greater than right value, but is not
|
|
|
|
Left (c) : ClassWithDeferredSetter(1)
|
|
|
|
Right (ClassWithDeferredSetter(1)): ClassWithDeferredSetter(1)
|
|
|
|
Loc: [qtbase/tests/auto/testlib/selftests/extendedcompare/tst_extendedcompare.cpp(0)]
|
|
|
|
PASS : tst_ExtendedCompare::checkComparisonWithTimeout(GE)
|
Add QCOMPARE_{EQ,NE,LT,LE,GT,GE}()
[ChangeLog][QTestLib] Add QCOMPARE_{EQ,NE,LT,LE,GT,GE}()
macros. These new macros behave similarly to QVERIFY(a op b),
where 'op' is ==, !=, <, <=, >, >= respectively, but print
a formatted error message with argument values in case of failure.
The formatting is done lazily, which means that the strings will
be generated only when the comparison fails.
Also add a new test for tst_selftest and generate expected output
for it.
Fixes: QTBUG-98873
Task-number: QTBUG-98874
Change-Id: Ic8074798901d7a469b1f58d5cd28bbf49a3da1db
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-05-19 11:48:45 +00:00
|
|
|
PASS : tst_ExtendedCompare::cleanupTestCase()
|
Add QTRY_COMPARE_{EQ,NE,LT,LE,GT,GE}_WITH_TIMEOUT()
[ChangeLog][QTestLib] Add QTRY_COMPARE_{EQ,NE,LT,LE,GT,GE}_WITH_TIMEOUT
macros that repeatedly execute QCOMPARE_{EQ,NE,LT,LE,GT,GE} until either
the comparison returns true or the timeout expires. Also add
QTRY_COMPARE_{EQ,NE,LT,LE,GT,GE} macros that simply invoke the
*_WITH_TIMEOUT versions with the usual timeout of five seconds.
Task-number: QTBUG-98873
Change-Id: Ib0d7d1c8c997f442b46acd85da738a8f512cc875
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-06-02 09:51:49 +00:00
|
|
|
Totals: 80 passed, 78 failed, 0 skipped, 0 blacklisted, 0ms
|
Add QCOMPARE_{EQ,NE,LT,LE,GT,GE}()
[ChangeLog][QTestLib] Add QCOMPARE_{EQ,NE,LT,LE,GT,GE}()
macros. These new macros behave similarly to QVERIFY(a op b),
where 'op' is ==, !=, <, <=, >, >= respectively, but print
a formatted error message with argument values in case of failure.
The formatting is done lazily, which means that the strings will
be generated only when the comparison fails.
Also add a new test for tst_selftest and generate expected output
for it.
Fixes: QTBUG-98873
Task-number: QTBUG-98874
Change-Id: Ic8074798901d7a469b1f58d5cd28bbf49a3da1db
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-05-19 11:48:45 +00:00
|
|
|
********* Finished testing of tst_ExtendedCompare *********
|