From cc6d984390dc937b9d8440b6ba7d4f578e22ac0d Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Thu, 2 Jun 2022 11:51:49 +0200 Subject: 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 --- .../auto/testlib/selftests/expected_extendedcompare.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'tests/auto/testlib/selftests/expected_extendedcompare.txt') diff --git a/tests/auto/testlib/selftests/expected_extendedcompare.txt b/tests/auto/testlib/selftests/expected_extendedcompare.txt index ac240d4f85..15f3275844 100644 --- a/tests/auto/testlib/selftests/expected_extendedcompare.txt +++ b/tests/auto/testlib/selftests/expected_extendedcompare.txt @@ -376,6 +376,21 @@ FAIL! : tst_ExtendedCompare::checkComparisonForTemporaryObjects(GE) Left value 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::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) PASS : tst_ExtendedCompare::cleanupTestCase() -Totals: 77 passed, 75 failed, 0 skipped, 0 blacklisted, 0ms +Totals: 80 passed, 78 failed, 0 skipped, 0 blacklisted, 0ms ********* Finished testing of tst_ExtendedCompare ********* -- cgit v1.2.3