From a3c1573e88284be3f5ef5335baf7fa88f080cdc1 Mon Sep 17 00:00:00 2001 From: Julian de Bhal Date: Mon, 22 Aug 2011 16:51:03 +1000 Subject: QML Autotests: Use fuzzy compare for real numbers Change-Id: I5ae2859d15502b29e3a744e155ceabe50d83bcff Reviewed-on: http://codereview.qt.nokia.com/3290 Reviewed-by: Qt Sanity Bot Reviewed-by: Charles Yin --- src/imports/testlib/TestCase.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index 1a222a6138..6da66b20de 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -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 -- cgit v1.2.3