It happens often that people convert a
compare(foo.bar, 3)
to a
tryCompare(foo.bar, 3)
and unfortunately that succeeds but doesn't do what they expected
This makes tryCompare fail if no third argument is given
Task-number: QTBUG-31427
Change-Id: I0c9618dae9aad4be55aa35c3e2dcf3535728beaa
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
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 *
****************************************************************************
}
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))