From facb8b74911cc9ff0fd61b4d31f45b14a5c004cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 31 Jan 2020 19:02:08 +0100 Subject: [PATCH] testlib: Properly cleanup after caught exception We were only doing half of what qCleanup was doing in the exception case, and in an inconsistent order. There's no reason not to just call qCleanup to align the behavior. Change-Id: Ic4e63afb4733de5b01a79272cca8908fca3de762 Reviewed-by: Simon Hausmann --- src/testlib/qtestcase.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 76a1b36a617..02eb8a1661c 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1957,13 +1957,7 @@ int QTest::qRun() QTestResult::setCurrentTestFunction(nullptr); } - QTestLog::stopLogging(); - -#if defined(Q_OS_MACOS) - IOPMAssertionRelease(macPowerSavingDisabled); -#endif - - currentTestObject = nullptr; + qCleanup(); // Re-throw exception to make debugging easier throw;