diff options
author | Sarah Smith <sarah.j.smith@nokia.com> | 2012-06-21 14:10:49 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-22 03:42:20 +0200 |
commit | 32823026cbbffe059c540711dda51488c8049238 (patch) | |
tree | 39c710e824e9f80fa96766a27cc5c0490c176ac7 /tests/auto | |
parent | 63563c8021931ee0efe9b2f9f019f550a4f999ff (diff) |
Fix skipped tests.
Also fix some other spam and warnings out of this test.
Task-number: QTBUG-25548
Change-Id: Id7a1cf12837bed79310539b324b1a06cd77c4613
Reviewed-by: Danny Pope <daniel.pope@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qml3d/item3d/tst_item3d.qml | 8 | ||||
-rw-r--r-- | tests/auto/qml3d/lookat/tst_lookat.qml | 12 | ||||
-rw-r--r-- | tests/auto/qml3d/scale3d/tst_scale3d.qml | 4 | ||||
-rw-r--r-- | tests/auto/qml3d/sphere/tst_sphere.qml | 5 | ||||
-rw-r--r-- | tests/auto/qml3d/viewport/tst_viewport.qml | 2 |
5 files changed, 12 insertions, 19 deletions
diff --git a/tests/auto/qml3d/item3d/tst_item3d.qml b/tests/auto/qml3d/item3d/tst_item3d.qml index 00ca9da44..4edefa805 100644 --- a/tests/auto/qml3d/item3d/tst_item3d.qml +++ b/tests/auto/qml3d/item3d/tst_item3d.qml @@ -75,10 +75,10 @@ Viewport { Item3D { id: item property int positionHasBeenChanged: 0 - onPositionChanged : positionHasBeenChanged = positionHasBeenChanged + 1; + onPosition3dChanged : positionHasBeenChanged = positionHasBeenChanged + 1; property bool onScaleChangedSignalTriggered: false - onScaleChanged: onScaleChangedSignalTriggered = true + onScale3dChanged: onScaleChangedSignalTriggered = true property bool onMeshChangedSignalTriggered: false onMeshChanged: onMeshChangedSignalTriggered = true @@ -232,9 +232,9 @@ Viewport { verify(item.position.z == -74635, "position modified by setting z negative"); compare(item.positionHasBeenChanged, 2, "onPositionChanged signal after setting z negative"); - skip("comparing reals is too precise"); + //skip("comparing reals is too precise"); item.z = 0.435; - compare(item.z, 0.435, "setting z to a real number") + verify((item.z - 0.435) < 0.0005, "setting z to a real number") compare(item.position.z, 0.435, "position modified by setting z to a real"); compare(item.positionHasBeenChanged, 3, "onPositionChanged signal after setting z to a real"); diff --git a/tests/auto/qml3d/lookat/tst_lookat.qml b/tests/auto/qml3d/lookat/tst_lookat.qml index 369e3bc8d..8cbb58855 100644 --- a/tests/auto/qml3d/lookat/tst_lookat.qml +++ b/tests/auto/qml3d/lookat/tst_lookat.qml @@ -123,6 +123,10 @@ Viewport { return "Vector3D(" + vector.x + ", " + vector.y + ", " + vector.z + ")"; } + function fuzzyCompare(float1, float2) { + return (Math.abs(float1 - float2) < 0.0005); + } + function compareVectors(vector1, vector2, string ) { compare(vector1.x, vector2.x, string + " x"); @@ -153,11 +157,9 @@ Viewport { testPosition = child1.localToWorld(); targetPosition = target1.localToWorld(); - skip("comparing reals is too precise"); - // compare is fuzzy by default - compare(testPosition.x, targetPosition.x, "test subject position change: x"); - compare(testPosition.y, targetPosition.y, "test subject position change: y"); - compare(testPosition.z, targetPosition.z, "test subject position change: z"); + verify(fuzzyCompare(testPosition.x, targetPosition.x), "test subject position change: x"); + verify(fuzzyCompare(testPosition.y, targetPosition.y), "test subject position change: y"); + verify(fuzzyCompare(testPosition.z, targetPosition.z), "test subject position change: z"); } function test_preserveUpVector() { diff --git a/tests/auto/qml3d/scale3d/tst_scale3d.qml b/tests/auto/qml3d/scale3d/tst_scale3d.qml index 5c934b48f..2cf5eeaeb 100644 --- a/tests/auto/qml3d/scale3d/tst_scale3d.qml +++ b/tests/auto/qml3d/scale3d/tst_scale3d.qml @@ -72,7 +72,6 @@ Viewport { name: "Scale3D" function test_uniformScale() { - skip("Scale3D.scale confuses tests"); compare(scale1.scale, Qt.vector3d(2.5, 2.5, 2.5), "uniform1") scale1.scale = 4.5 compare(scale1.scale, Qt.vector3d(4.5, 4.5, 4.5), "uniform2") @@ -81,7 +80,6 @@ Viewport { } function test_nonUniformScale() { - skip("Scale3D.scale confuses tests"); compare(scale2.scale, Qt.vector3d(1.0, 0.5, -2.0), "nonuniform1") scale2.scale = Qt.vector3d(3.0, -2.5, 1.5) compare(scale2.scale, Qt.vector3d(3.0, -2.5, 1.5), "nonuniform2") @@ -90,7 +88,6 @@ Viewport { } function test_scaleChanged() { - skip("Scale3D.scale confuses tests"); compare(scale3.scale, Qt.vector3d(1.0, 1.0, 1.0), "changed1") compare(scale3.changed, 0, "changed2") scale3.scale = Qt.vector3d(3.0, -2.5, 1.5) @@ -102,7 +99,6 @@ Viewport { } function test_originChanged() { - skip("Scale3D.scale confuses tests"); compare(scale4.origin, Qt.vector3d(0.0, 0.0, 0.0), "changed1") compare(scale4.changed, 0, "changed2") scale4.origin = Qt.vector3d(3.0, -2.5, 1.5) diff --git a/tests/auto/qml3d/sphere/tst_sphere.qml b/tests/auto/qml3d/sphere/tst_sphere.qml index 53d4dd8d3..39d357e40 100644 --- a/tests/auto/qml3d/sphere/tst_sphere.qml +++ b/tests/auto/qml3d/sphere/tst_sphere.qml @@ -94,8 +94,7 @@ Viewport { } function test_radiusChanged() { - skip("Crashing"); - compare(sphere4.radius, 1, "radius"); + compare(sphere4.radius, 0.5, "radius"); compare(sphere4.radChanged, 0, "changed 1"); sphere4.radius = 3.5 compare(sphere4.radChanged, 1, "changed 2"); @@ -105,7 +104,6 @@ Viewport { } function test_levelOfDetailChanged() { - skip("Crashing"); compare(sphere4.levelOfDetail, 5, "levelOfDetail"); compare(sphere4.lodChanged, 0, "changed 1"); sphere4.levelOfDetail = 2 @@ -116,7 +114,6 @@ Viewport { } function test_axisChanged() { - skip("Crashing"); compare(sphere4.axis, Qt.ZAxis, "axis"); compare(sphere4.axChanged, 0, "changed 1"); sphere4.axis = Qt.YAxis diff --git a/tests/auto/qml3d/viewport/tst_viewport.qml b/tests/auto/qml3d/viewport/tst_viewport.qml index 55135cb3c..db9f43b83 100644 --- a/tests/auto/qml3d/viewport/tst_viewport.qml +++ b/tests/auto/qml3d/viewport/tst_viewport.qml @@ -82,7 +82,6 @@ Viewport { } function test_camera() { - skip("'Cannot convert object to primitive value' error, needs porting"); verify(viewport.camera != null, "camera") verify(viewport.camera != newCamera, "camera-obj") compare(viewport.camera.projectionType, 0, "projectionType") @@ -105,7 +104,6 @@ Viewport { } function test_light() { - skip("'Cannot convert object to primitive value' error, needs porting"); verify(viewport.light != null, "light") verify(viewport.light != newLight, "light-obj") compare(viewport.light.type, 0, "type-directional") |