QML Autotests: Use fuzzy compare for real numbers
authorJulian de Bhal <julian.debhal@nokia.com>
Mon, 22 Aug 2011 06:51:03 +0000 (16:51 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 23 Aug 2011 01:47:38 +0000 (03:47 +0200)
Change-Id: I5ae2859d15502b29e3a744e155ceabe50d83bcff
Reviewed-on: http://codereview.qt.nokia.com/3290
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Charles Yin <charles.yin@nokia.com>

src/imports/testlib/TestCase.qml

index 1a222a6..6da66b2 100644 (file)
@@ -176,7 +176,7 @@ Item {
                  || ((typeExp === "object" || typeExp == "declarativeitem") && typeAct === "string")) {
                     success = (act == exp)
                 }
-            } else if (typeExp === "string" || typeExp === "boolean" || typeExp === "number" ||
+            } else if (typeExp === "string" || typeExp === "boolean" ||
                        typeExp === "null" || typeExp === "undefined") {
                 if (exp instanceof act.constructor || act instanceof exp.constructor) {
                     // to catch short annotaion VS 'new' annotation of act declaration
@@ -188,7 +188,7 @@ Item {
                 }
             } else if (typeExp === "nan") {
                 success = isNaN(act);
-            } else if (typeExp == "number") {
+            } else if (typeExp === "number") {
                 // Use act fuzzy compare if the two values are floats
                 if (Math.abs(act - exp) <= 0.00001) {
                     success = true