diff options
author | Albert Astals Cid <albert.astals@canonical.com> | 2017-04-04 16:26:20 +0200 |
---|---|---|
committer | Albert Astals Cid <albert.astals@canonical.com> | 2017-04-05 07:07:19 +0000 |
commit | af72231fe4a91226d945db9a526fb755332548eb (patch) | |
tree | 4739e114b5aa6c2557444cb91c84fbf738a949be /src/imports/testlib/TestCase.qml | |
parent | fdb822613989c5975ba282b775e6d194467bdef4 (diff) |
Error out if TestCase.verify receives more than 2 parameters
Change-Id: I3299f602970067aaef290d4f1c7449d3ab03fb3c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/testlib/TestCase.qml')
-rw-r--r-- | src/imports/testlib/TestCase.qml | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index 3e6eb64311..8c1744a2b2 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -444,6 +444,9 @@ Item { or \c{QVERIFY2(condition, message)} in C++. */ function verify(cond, msg) { + if (arguments.length > 2) + qtest_fail("More than two arguments given to verify(). Did you mean tryVerify() or tryCompare()?", 1) + if (msg === undefined) msg = ""; if (!qtest_results.verify(cond, msg, util.callerFile(), util.callerLine())) |