qmltest: Fix SignalSpy to use TestUtil helper functions
authorCaio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Tue, 2 Aug 2011 23:31:19 +0000 (20:31 -0300)
committerQt by Nokia <qt-info@nokia.com>
Tue, 2 Aug 2011 23:50:43 +0000 (01:50 +0200)
Previously the callerFile() and callerLine() functions were exposed as
properties of the QtTest module, but now they are available in the
TestUtil component. TestCase was updated but SignalSpy wasn't.

Change-Id: Ic3f35e6f096b28c443e8aadaa78732a8a15dc284
Reviewed-on: http://codereview.qt.nokia.com/2528
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Charles Yin <charles.yin@nokia.com>
src/imports/testlib/SignalSpy.qml

index 59d4418..91b5f03 100644 (file)
@@ -46,6 +46,10 @@ Item {
     id: spy
     visible: false
 
+    TestUtil {
+        id: util
+    }
+
     // Public API.
 
     property variant target: null
@@ -67,7 +71,7 @@ Item {
             i += 50
         }
         var success = (count >= expected)
-        if (!qtest_results.verify(success, "wait for signal " + signalName, QtTest.qtest_caller_file(), QtTest.qtest_caller_line()))
+        if (!qtest_results.verify(success, "wait for signal " + signalName, util.callerFile(), util.callerLine()))
             throw new Error("QtQuickTest::fail")
     }