summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmltest/scene3d
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2014-10-17 08:50:12 +0300
committerTomi Korpipää <tomi.korpipaa@digia.com>2014-10-17 09:06:43 +0300
commitb25f6926ded030959d1931ec0a834b1a9e5f27e3 (patch)
tree8b602b289e3e331c4d9e759dfab125879c318f05 /tests/auto/qmltest/scene3d
parent425ece960c378f8486d0c5e544cc7d0b95c9f728 (diff)
Added invalid value tests for QML autotests
Plus fixed a QML documentation bug, and added a missing inheritance to docs. Task-number: QTRD-3383 Change-Id: I1f7c56c49b829fee2cfd0731bbcc7e248a06a0c0 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
Diffstat (limited to 'tests/auto/qmltest/scene3d')
-rw-r--r--tests/auto/qmltest/scene3d/tst_camera.qml16
-rw-r--r--tests/auto/qmltest/scene3d/tst_scene.qml13
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/qmltest/scene3d/tst_camera.qml b/tests/auto/qmltest/scene3d/tst_camera.qml
index c29de0c7..07adf633 100644
--- a/tests/auto/qmltest/scene3d/tst_camera.qml
+++ b/tests/auto/qmltest/scene3d/tst_camera.qml
@@ -45,6 +45,10 @@ Item {
id: change
}
+ Camera3D {
+ id: invalid
+ }
+
TestCase {
name: "Camera3D Initial"
@@ -114,6 +118,18 @@ Item {
compare(change.yRotation, 22.5)
compare(change.zoomLevel, 500.0)
}
+ }
+ TestCase {
+ name: "Camera3D Invalid"
+
+ function test_invalid() {
+ invalid.target = Qt.vector3d(-1.5, -1.5, -1.5)
+ compare(invalid.target, Qt.vector3d(-1.0, -1.0, -1.0))
+ invalid.target = Qt.vector3d(1.5, 1.5, 1.5)
+ compare(invalid.target, Qt.vector3d(1.0, 1.0, 1.0))
+ invalid.minZoomLevel = 0.1
+ compare(invalid.minZoomLevel, 1.0)
+ }
}
}
diff --git a/tests/auto/qmltest/scene3d/tst_scene.qml b/tests/auto/qmltest/scene3d/tst_scene.qml
index 8d497b5c..d53042ca 100644
--- a/tests/auto/qmltest/scene3d/tst_scene.qml
+++ b/tests/auto/qmltest/scene3d/tst_scene.qml
@@ -46,6 +46,10 @@ Item {
id: change
}
+ Bars3D {
+ id: invalid
+ }
+
TestCase {
name: "Scene3D Initial"
@@ -109,4 +113,13 @@ Item {
compare(change.scene.viewport, Qt.rect(0, 0, 100, 100))
}
}
+
+ TestCase {
+ name: "Scene3D Invalid"
+
+ function test_invalid() {
+ invalid.scene.primarySubViewport = Qt.rect(0, 0, -50, -50)
+ compare(invalid.scene.primarySubViewport, Qt.rect(0, 0, 0, 0))
+ }
+ }
}