aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dist/changes-5.1.03
-rw-r--r--src/imports/testlib/TestCase.qml5
2 files changed, 8 insertions, 0 deletions
diff --git a/dist/changes-5.1.0 b/dist/changes-5.1.0
index 50bdc2f9f8..8633d22eef 100644
--- a/dist/changes-5.1.0
+++ b/dist/changes-5.1.0
@@ -43,6 +43,9 @@ Third party components
as count, which are based off of the data model will no longer update
immediately if queried. Updates are batched to happen once per frame (or
when properties are being set).
+
+ - tryCompare now correctly fails when it only gets two parameters
+
****************************************************************************
* Library *
****************************************************************************
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml
index 7584241ca6..0bec4cddf2 100644
--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -291,6 +291,11 @@ Item {
}
function tryCompare(obj, prop, value, timeout) {
+ if (arguments.length == 2) {
+ qtest_results.fail("A value is required for tryCompare",
+ util.callerFile(), util.callerLine())
+ throw new Error("QtQuickTest::fail")
+ }
if (!timeout)
timeout = 5000
if (!qtest_compareInternal(obj[prop], value))