aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/testlib
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2011-08-25 11:47:24 +0200
committerGunnar Sletta <gunnar.sletta@nokia.com>2011-08-25 12:52:15 +0200
commit8e6ecb56e5d61ce661422779c9d9cbf22f081a34 (patch)
tree227aeb360800a49de58472bd39bc5f4c596c1b15 /src/imports/testlib
parentc9224b6cf5cceb7d5314f7504d44bfe72bc66950 (diff)
parent0d84e957297b4ffa6ab5b0b5bcf8b169d567d298 (diff)
Merge branch 'master' into refactor
Conflicts: src/declarative/items/qsgcanvas.cpp src/declarative/items/qsgitem.cpp src/declarative/items/qsgtextnode.cpp tests/auto/declarative/examples/examples.pro tools/qmlviewer/qmlviewer.pro Change-Id: Icbb0ef5dc79b658c62fd2b2c25a66c9bb3cbeb10
Diffstat (limited to 'src/imports/testlib')
-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