From 0294702c9c174c67de563cfdea5c32548d111a58 Mon Sep 17 00:00:00 2001 From: Caroline Chao Date: Wed, 4 Mar 2015 10:51:28 +0100 Subject: testlib: Fix qml objects not deleted between data tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Call wait(0) after the cleanup() function and not only at the end of the test run (wait(0) is used to call processEvents()). Otherwise, eventual destroy() calls in test function are not executed between data tests. Task-number: QTBUG-30523 Task-number: QTBUG-42185 Change-Id: I1d588ee28c61cda835e25307bc1c565d68b741fe Reviewed-by: Jan Arve Sæther --- src/imports/testlib/TestCase.qml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/imports') diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index 9f527b66f1..039ee63f07 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -1271,6 +1271,9 @@ Item { qtest_results.finishTestData() qtest_runInternal("cleanup") qtest_results.finishTestDataCleanup() + // wait(0) will call processEvents() so objects marked for deletion + // in the test function will be deleted. + wait(0) } } @@ -1302,6 +1305,9 @@ Item { // Run the cleanup function. qtest_runInternal("cleanup") qtest_results.finishTestDataCleanup() + // wait(0) will call processEvents() so objects marked for deletion + // in the test function will be deleted. + wait(0) } while (!qtest_results.measurementAccepted()) qtest_results.endDataRun() } while (qtest_results.needsMoreMeasurements()) @@ -1418,9 +1424,6 @@ Item { } else { qtest_runFunction(prop, null, isBenchmark) } - // wait(0) will call processEvents() so objects marked for deletion - // in the test function will be deleted. - wait(0) qtest_results.finishTestFunction() qtest_results.skipped = false } -- cgit v1.2.3