diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/qquickitem2/data/mapCoordinates.qml | 16 | ||||
-rw-r--r-- | tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml | 16 |
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; } } |