aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@theqtcompany.com>2015-03-04 10:51:28 +0100
committerCaroline Chao <caroline.chao@theqtcompany.com>2015-03-09 14:43:08 +0000
commit0294702c9c174c67de563cfdea5c32548d111a58 (patch)
tree128370ffc4d9a4b133545258d616518f51b4e712 /src/imports
parente15cf0501113e0242db47f4fa5bf1682d587765a (diff)
testlib: Fix qml objects not deleted between data tests
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 <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/testlib/TestCase.qml9
1 files changed, 6 insertions, 3 deletions
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
}