From cae9402e7bda876e83aa0d5ef4ba0f4ee0d0eca0 Mon Sep 17 00:00:00 2001 From: Charles Yin Date: Tue, 25 Oct 2011 09:40:37 +1000 Subject: Remove warning messages from TestCase.qml qtest_run should be called only when the whole TestCase is completely loaded. Task-number:QTBUG-22299 Change-Id: Id2874ed2493ccea72a4f17e6cb61aeb58ae4fa31 Reviewed-by: Charles Yin --- src/imports/testlib/TestCase.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/imports') diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index bb97481102..5887ececa0 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -74,6 +74,7 @@ Item { // Internal private state. Identifiers prefixed with qtest are reserved. property bool qtest_prevWhen: true property int qtest_testId: -1 + property bool qtest_componentCompleted : false property variant qtest_testCaseResult property variant qtest_results: qtest_results_normal TestResult { id: qtest_results_normal } @@ -659,7 +660,7 @@ Item { onWhenChanged: { if (when != qtest_prevWhen) { qtest_prevWhen = when - if (when && !completed && !running) + if (when && !completed && !running && qtest_componentCompleted) qtest_run() } } @@ -685,6 +686,7 @@ Item { Component.onCompleted: { qtest.hasTestCase = true; + qtest_componentCompleted = true; if (util.printAvailableFunctions) { var testList = [] @@ -714,4 +716,4 @@ Item { if (when && !completed && !running) qtest_run() } -} +} \ No newline at end of file -- cgit v1.2.3