aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/v4/data/mathFloor.qml
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-08-21 12:44:42 +1000
committerQt by Nokia <qt-info@nokia.com>2012-08-23 08:16:24 +0200
commit9ee6bb0e14d968647350683eafbe80eed7a27058 (patch)
tree6218951a0de9e1f47ea2f76a2673d26bac85097f /tests/auto/qml/v4/data/mathFloor.qml
parent540092608b26c469d4905d3c673374542cc32940 (diff)
Increase test coverage for V4
Add test for integer operations, Math functions and exercise some previously uncovered code. Change-Id: Idff3f3672498775ac117ca98bf34b0fe96cbf760 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'tests/auto/qml/v4/data/mathFloor.qml')
-rw-r--r--tests/auto/qml/v4/data/mathFloor.qml37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/auto/qml/v4/data/mathFloor.qml b/tests/auto/qml/v4/data/mathFloor.qml
new file mode 100644
index 0000000000..3473dccd10
--- /dev/null
+++ b/tests/auto/qml/v4/data/mathFloor.qml
@@ -0,0 +1,37 @@
+import QtQuick 2.0
+
+Item {
+ property real test1: Math.floor(i1.p1)
+ property real test2: Math.floor(i1.p2)
+
+ property real subtest3: Math.floor()
+ property real subtest4: Math.floor(i1.p4)
+ property bool test3: isNaN(subtest3)
+ property bool test4: isNaN(subtest4)
+
+ property real subtest5: Math.floor(i1.p5)
+ property bool test5: isNaN(subtest5)
+ property real test6: Math.floor(i1.p6)
+
+ property real subtest7: Math.floor(i1.p7)
+ property real subtest8: Math.floor(i1.p8)
+ property bool test7: subtest7 === Number.NEGATIVE_INFINITY
+ property bool test8: subtest8 === Number.POSITIVE_INFINITY
+
+ property real test9: Math.floor(i1.p9)
+ property real subtest10: Math.floor(i1.p10)
+ property bool test10: subtest10 === 0 && (1/subtest10) === -Infinity
+
+ QtObject {
+ id: i1
+ property real p1: -3.7
+ property real p2: 4.4
+ property real p4: Number.NaN
+ property string p5: "hello world"
+ property string p6: "82.6"
+ property real p7: Number.NEGATIVE_INFINITY
+ property real p8: Number.POSITIVE_INFINITY
+ property real p9: 0
+ property real p10: -0
+ }
+ }