summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/expected_warnings.txt
diff options
context:
space:
mode:
authorVladimir Belyavsky <belyavskyv@gmail.com>2023-11-17 02:16:58 +0300
committerVladimir Belyavsky <belyavskyv@gmail.com>2023-11-22 20:15:38 +0000
commit18aa36cf878a52b8fe991392098e9445c3d3bfe3 (patch)
treefcbf600c10f272bd76be7d7a0f58b3058b734ba4 /tests/auto/testlib/selftests/expected_warnings.txt
parentf2f2b6ef18907a76461b54e110618e7840971fa7 (diff)
QTest: make failOnWarning() functional on temp objects destruction
We need to be able to handle warnings that may occur when temporary objects, that were created in a test function, are destroyed. For example, now we miss all warnings that might be triggered from the object destructor, if the object's deletion was delayed (e.g. via deleteLater()). Also we miss all the warnings that were triggered on the test's cleanup() call. To fix this we need simply move QTestLog::clearFailOnWarnings() from QTestResult::finishedCurrentTestData() to the later stage, i.e. into QTestLog::clearCurrentTestState() which is actually called in appropriate time from QTestResult::finishedCurrentTestDataCleanup(). Same for QTestLog::clearIgnoreMessages(), since they are interrelated, so we need to clear them at the same time. We need this change for QML tests in particularly, to be able fail on warnings that might be triggered from Component.onDestruction() of some temporary test object. Pick-to: 6.6 6.5 Change-Id: I58a57691f20761619f56bd1bea3a862f2c26f569 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/testlib/selftests/expected_warnings.txt')
-rw-r--r--tests/auto/testlib/selftests/expected_warnings.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/testlib/selftests/expected_warnings.txt b/tests/auto/testlib/selftests/expected_warnings.txt
index 5037eb87df..72e2201f38 100644
--- a/tests/auto/testlib/selftests/expected_warnings.txt
+++ b/tests/auto/testlib/selftests/expected_warnings.txt
@@ -69,6 +69,9 @@ Ran out of cabbage!
SKIP : tst_Warnings::testFailOnWarningsThenSkip() My cabbage! :(
Loc: [qtbase/tests/auto/testlib/selftests/warnings/tst_warnings.cpp(0)]
PASS : tst_Warnings::testFailOnWarningsAndIgnoreWarnings()
+FAIL! : tst_Warnings::testFailOnTemporaryObjectDestruction() Received a warning that resulted in a failure:
+Running low on toothpaste!
+ Loc: [qtbase/tests/auto/testlib/selftests/warnings/tst_warnings.cpp(0)]
PASS : tst_Warnings::cleanupTestCase()
-Totals: 5 passed, 10 failed, 0 skipped, 0 blacklisted, 0ms
+Totals: 5 passed, 11 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Warnings *********