From d9fd41a1febfccb25134cbad0c9b72c43ae32853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 5 Aug 2021 18:21:22 +0200 Subject: [PATCH] testlib: Let loggers know which test function is being left MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit None of the loggers rely on this at the moment, but one could imagine one that does. Plus, doing any sort of debug logging in leaveTestFunction will at the moment be attributed to UnknownTestFunc(). Pick-to: 6.2 Change-Id: I284b2785a276e028b9f57c26357679fd9e045ca7 Reviewed-by: Edward Welbourne Reviewed-by: MÃ¥rten Nordheim --- src/testlib/qtestresult.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/testlib/qtestresult.cpp b/src/testlib/qtestresult.cpp index b8b6ef1e9a..899f5358b5 100644 --- a/src/testlib/qtestresult.cpp +++ b/src/testlib/qtestresult.cpp @@ -231,10 +231,10 @@ void QTestResult::finishedCurrentTestDataCleanup() */ void QTestResult::finishedCurrentTestFunction() { + QTestLog::leaveTestFunction(); + QTest::currentTestFunc = nullptr; QTest::resetFailed(); - - QTestLog::leaveTestFunction(); } const char *QTestResult::currentTestFunction()