aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickitem2
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-12-07 13:20:36 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-12-07 13:20:36 +0100
commit4ab7deb923237b0186a211b0326217c480e33848 (patch)
treee277fb616e58e02bb49e0dc62d1ff9a039e8bcdb /tests/auto/quick/qquickitem2
parentc3f03bbff1db14dc5b5436d8aef834512207d498 (diff)
parentbb921064b966efdaabc2245cad21c3d852848a22 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Diffstat (limited to 'tests/auto/quick/qquickitem2')
-rw-r--r--tests/auto/quick/qquickitem2/data/mapCoordinates.qml16
-rw-r--r--tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml16
2 files changed, 24 insertions, 8 deletions
diff --git a/tests/auto/quick/qquickitem2/data/mapCoordinates.qml b/tests/auto/quick/qquickitem2/data/mapCoordinates.qml
index 0b0b15a767..a9c5030e12 100644
--- a/tests/auto/quick/qquickitem2/data/mapCoordinates.qml
+++ b/tests/auto/quick/qquickitem2/data/mapCoordinates.qml
@@ -65,12 +65,20 @@ Item {
}
function checkMapAToInvalid(x, y) {
- var pos = itemA.mapToItem(1122, x, y)
- return pos == undefined;
+ try {
+ itemA.mapToItem(1122, x, y)
+ } catch (e) {
+ return e instanceof TypeError
+ }
+ return false
}
function checkMapAFromInvalid(x, y) {
- var pos = itemA.mapFromItem(1122, x, y)
- return pos == undefined;
+ try {
+ itemA.mapFromItem(1122, x, y)
+ } catch (e) {
+ return e instanceof TypeError
+ }
+ return false
}
}
diff --git a/tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml b/tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml
index e21aab1f01..c127407eae 100644
--- a/tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml
+++ b/tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml
@@ -66,12 +66,20 @@ Item {
}
function checkMapAToInvalid(x, y, w, h) {
- var pos = itemA.mapToItem(1122, x, y, w, h)
- return pos == undefined;
+ try {
+ itemA.mapToItem(1122, x, y, w, h)
+ } catch (e) {
+ return e instanceof TypeError
+ }
+ return false;
}
function checkMapAFromInvalid(x, y, w, h) {
- var pos = itemA.mapFromItem(1122, x, y, w, h)
- return pos == undefined;
+ try {
+ itemA.mapFromItem(1122, x, y, w, h)
+ } catch (e) {
+ return e instanceof TypeError
+ }
+ return false;
}
}