aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/testlib/SignalSpy.qml6
-rw-r--r--src/imports/testlib/TestCase.qml4
-rw-r--r--src/imports/testlib/main.cpp8
3 files changed, 12 insertions, 6 deletions
diff --git a/src/imports/testlib/SignalSpy.qml b/src/imports/testlib/SignalSpy.qml
index 59d44185a1..91b5f03522 100644
--- a/src/imports/testlib/SignalSpy.qml
+++ b/src/imports/testlib/SignalSpy.qml
@@ -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")
}
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml
index 1a222a6138..6da66b20de 100644
--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -176,7 +176,7 @@ Item {
|| ((typeExp === "object" || typeExp == "declarativeitem") && typeAct === "string")) {
success = (act == exp)
}
- } else if (typeExp === "string" || typeExp === "boolean" || typeExp === "number" ||
+ } else if (typeExp === "string" || typeExp === "boolean" ||
typeExp === "null" || typeExp === "undefined") {
if (exp instanceof act.constructor || act instanceof exp.constructor) {
// to catch short annotaion VS 'new' annotation of act declaration
@@ -188,7 +188,7 @@ Item {
}
} else if (typeExp === "nan") {
success = isNaN(act);
- } else if (typeExp == "number") {
+ } else if (typeExp === "number") {
// Use act fuzzy compare if the two values are floats
if (Math.abs(act - exp) <= 0.00001) {
success = true
diff --git a/src/imports/testlib/main.cpp b/src/imports/testlib/main.cpp
index db0a029a9a..c12b9423a9 100644
--- a/src/imports/testlib/main.cpp
+++ b/src/imports/testlib/main.cpp
@@ -58,8 +58,8 @@ QML_DECLARE_TYPE(QuickTestEvent)
class QuickTestUtil : public QObject
{
Q_OBJECT
- Q_PROPERTY(bool printAvailableFunctions READ printAvailableFunctions)
- Q_PROPERTY(bool wrapper READ wrapper)
+ Q_PROPERTY(bool printAvailableFunctions READ printAvailableFunctions NOTIFY printAvailableFunctionsChanged)
+ Q_PROPERTY(bool wrapper READ wrapper NOTIFY wrapperChanged)
public:
QuickTestUtil(QObject *parent = 0)
:QObject(parent)
@@ -75,7 +75,9 @@ public:
{
return true;
}
-
+Q_SIGNALS:
+ void printAvailableFunctionsChanged();
+ void wrapperChanged();
public Q_SLOTS:
QDeclarativeV8Handle typeName(const QVariant& v) const