From: Mariusz Polasinski Date: Tue, 13 Aug 2013 14:49:06 +0000 (+0200) Subject: [unitcommon] the existence of '-0' - amendment in type checking X-Git-Tag: 2.2.1_release~114^2~106^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac1265aa1ce1e7ee3f1945afe633e958b015d235;p=test%2Ftct%2Fweb%2Fapi.git [unitcommon] the existence of '-0' - amendment in type checking Change-Id: Ieb76455372b61eba00db7b289b5f5caa3858705e --- diff --git a/tct-alarm-tizen-tests/resources/unitcommon.js b/tct-alarm-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-alarm-tizen-tests/resources/unitcommon.js +++ b/tct-alarm-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-appcontrol-tizen-tests/resources/unitcommon.js b/tct-appcontrol-tizen-tests/resources/unitcommon.js old mode 100755 new mode 100644 index 78544605c..99c965146 --- a/tct-appcontrol-tizen-tests/resources/unitcommon.js +++ b/tct-appcontrol-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-application-tizen-tests/application/support/TCTAppControl/resources/unitcommon.js b/tct-application-tizen-tests/application/support/TCTAppControl/resources/unitcommon.js old mode 100755 new mode 100644 index 3ac47d5db..99c965146 --- a/tct-application-tizen-tests/application/support/TCTAppControl/resources/unitcommon.js +++ b/tct-application-tizen-tests/application/support/TCTAppControl/resources/unitcommon.js @@ -20,6 +20,25 @@ Authors: */ + +MIN_BYTE = -128; +MAX_BYTE = 127; +MIN_OCTET = 0; +MAX_OCTET = 255; +MIN_SHORT = -32768; +MAX_SHORT = 32767; +MIN_UNSIGNED_SHORT = 0; +MAX_UNSIGNED_SHORT = 65535; +MIN_LONG = -2147483648; +MAX_LONG = 2147483647; +MIN_UNSIGNED_LONG = 0; +MAX_UNSIGNED_LONG = 4294967295; +MIN_LONG_LONG = -9223372036854775808; +MAX_LONG_LONG = 9223372036854775807; +MIN_UNSIGNED_LONG_LONG = 0; +MAX_UNSIGNED_LONG_LONG = 18446744073709551615; + + (function () { var head_src = document.head.innerHTML; if (head_src.search(/\/testharness.js\W/) === -1) { @@ -120,6 +139,7 @@ function getTypeConversionExceptions(conversionType, isOptional) { [false, exceptionName], [NaN, exceptionName], [0, exceptionName], + ["", exceptionName], ["TIZEN", exceptionName], [undefined, exceptionName] ]; @@ -133,7 +153,9 @@ function getTypeConversionExceptions(conversionType, isOptional) { [false, exceptionName], [NaN, exceptionName], [0, exceptionName], + ["", exceptionName], ["TIZEN", exceptionName], + [[], exceptionName], [{ }, exceptionName], [undefined, exceptionName] ]; @@ -147,6 +169,7 @@ function getTypeConversionExceptions(conversionType, isOptional) { [false, exceptionName], [NaN, exceptionName], [0, exceptionName], + ["", exceptionName], ["TIZEN", exceptionName], [{ }, exceptionName], [function () { }, exceptionName], @@ -162,6 +185,7 @@ function getTypeConversionExceptions(conversionType, isOptional) { [false, exceptionName], [NaN, exceptionName], [0, exceptionName], + ["", exceptionName], ["TIZEN", exceptionName], [undefined, exceptionName] ]; @@ -203,6 +227,54 @@ function assert_type(obj, type, description) { case 'date': assert_true(obj instanceof Date, description); break; + case 'byte': + assert_equals(typeof (obj), 'number', description); + assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); + assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); + break; + case 'octet': + assert_equals(typeof (obj), 'number', description); + assert_greater_than_equal(obj, MIN_OCTET, description + " - value too low."); + assert_less_than_equal(obj, MAX_OCTET, description + " - value too high."); + assert_equals(obj % 1, 0, description + " - value is not an integer."); + break; + case 'short': + assert_equals(typeof (obj), 'number', description); + assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); + assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); + break; + case 'unsigned short': + assert_equals(typeof (obj), 'number', description); + assert_greater_than_equal(obj, MIN_UNSIGNED_SHORT, description + " - value too low."); + assert_less_than_equal(obj, MAX_UNSIGNED_SHORT, description + " - value too high."); + assert_equals(obj % 1, 0, description + " - value is not an integer."); + break; + case 'long': + assert_equals(typeof (obj), 'number', description); + assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); + assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); + break; + case 'unsigned long': + assert_equals(typeof (obj), 'number', description); + assert_greater_than_equal(obj, MIN_UNSIGNED_LONG, description + " - value too low."); + assert_less_than_equal(obj, MAX_UNSIGNED_LONG, description + " - value too high."); + assert_equals(obj % 1, 0, description + " - value is not an integer."); + break; + case 'long long': + assert_equals(typeof (obj), 'number', description); + assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); + assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); + break; + case 'unsigned long long': + assert_equals(typeof (obj), 'number', description); + assert_greater_than_equal(obj, MIN_UNSIGNED_LONG_LONG, description + " - value too low."); + assert_less_than_equal(obj, MAX_UNSIGNED_LONG_LONG, description + " - value too high."); + assert_equals(obj % 1, 0, description + " - value is not an integer."); + break; default: assert_unreached('Fix your test. Wrong type \'' + org_type + '\''); } @@ -263,6 +335,7 @@ function check_const(obj, attributeName, expectedValue, expectedType, valueToAss assert_unreached("Fix your test. Wrong type of name " + typeof (attributeName)); } } + /** * Method to check if attribute is readonly. * Example usage: @@ -278,6 +351,21 @@ function check_readonly(obj, attributeName, expectedValue, expectedType, valueTo check_const(obj, attributeName, expectedValue, expectedType, valueToAssign); } +/** + * Method to check if attribute can be set to null. + * Example usage: + * check_not_nullable(syncInfo, "mode"); + * + * @param obj object to test which has not nullable attribute + * @param attributeName attribute name. + */ +function check_not_nullable(obj, attributeName) +{ var old_value = obj[attributeName]; + obj[attributeName] = null; + assert_not_equals(obj[attributeName], null, "Attribute " + attributeName + " can be set to null."); + obj[attributeName] = old_value; +} + /** * Method to check NoInterfaceObject * Example usage: diff --git a/tct-application-tizen-tests/resources/unitcommon.js b/tct-application-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-application-tizen-tests/resources/unitcommon.js +++ b/tct-application-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-bluetooth-tizen-tests/resources/unitcommon.js b/tct-bluetooth-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-bluetooth-tizen-tests/resources/unitcommon.js +++ b/tct-bluetooth-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-bookmark-tizen-tests/resources/unitcommon.js b/tct-bookmark-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-bookmark-tizen-tests/resources/unitcommon.js +++ b/tct-bookmark-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-calendar-tizen-tests/resources/unitcommon.js b/tct-calendar-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-calendar-tizen-tests/resources/unitcommon.js +++ b/tct-calendar-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-callhistory-tizen-tests/resources/unitcommon.js b/tct-callhistory-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-callhistory-tizen-tests/resources/unitcommon.js +++ b/tct-callhistory-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-contact-tizen-tests/resources/unitcommon.js b/tct-contact-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-contact-tizen-tests/resources/unitcommon.js +++ b/tct-contact-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-content-tizen-tests/resources/unitcommon.js b/tct-content-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-content-tizen-tests/resources/unitcommon.js +++ b/tct-content-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-datacontrol-tizen-tests/resources/unitcommon.js b/tct-datacontrol-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-datacontrol-tizen-tests/resources/unitcommon.js +++ b/tct-datacontrol-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-datasync-tizen-tests/resources/unitcommon.js b/tct-datasync-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-datasync-tizen-tests/resources/unitcommon.js +++ b/tct-datasync-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-download-tizen-tests/resources/unitcommon.js b/tct-download-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-download-tizen-tests/resources/unitcommon.js +++ b/tct-download-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-filesystem-tizen-tests/resources/unitcommon.js b/tct-filesystem-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-filesystem-tizen-tests/resources/unitcommon.js +++ b/tct-filesystem-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-messageport-tizen-tests/resources/unitcommon.js b/tct-messageport-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-messageport-tizen-tests/resources/unitcommon.js +++ b/tct-messageport-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-messaging-email-tizen-tests/resources/unitcommon.js b/tct-messaging-email-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-messaging-email-tizen-tests/resources/unitcommon.js +++ b/tct-messaging-email-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-messaging-mms-tizen-tests/resources/unitcommon.js b/tct-messaging-mms-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-messaging-mms-tizen-tests/resources/unitcommon.js +++ b/tct-messaging-mms-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-messaging-sms-tizen-tests/resources/unitcommon.js b/tct-messaging-sms-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-messaging-sms-tizen-tests/resources/unitcommon.js +++ b/tct-messaging-sms-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-namespace-tizen-tests/resources/unitcommon.js b/tct-namespace-tizen-tests/resources/unitcommon.js old mode 100755 new mode 100644 index 78544605c..99c965146 --- a/tct-namespace-tizen-tests/resources/unitcommon.js +++ b/tct-namespace-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-networkbearerselection-tizen-tests/resources/unitcommon.js b/tct-networkbearerselection-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-networkbearerselection-tizen-tests/resources/unitcommon.js +++ b/tct-networkbearerselection-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-nfc-tizen-tests/resources/unitcommon.js b/tct-nfc-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-nfc-tizen-tests/resources/unitcommon.js +++ b/tct-nfc-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-notification-tizen-tests/resources/unitcommon.js b/tct-notification-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-notification-tizen-tests/resources/unitcommon.js +++ b/tct-notification-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-package-tizen-tests/resources/unitcommon.js b/tct-package-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-package-tizen-tests/resources/unitcommon.js +++ b/tct-package-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-power-tizen-tests/resources/unitcommon.js b/tct-power-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-power-tizen-tests/resources/unitcommon.js +++ b/tct-power-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-privilege-tizen-tests/resources/unitcommon.js b/tct-privilege-tizen-tests/resources/unitcommon.js old mode 100755 new mode 100644 index 78544605c..99c965146 --- a/tct-privilege-tizen-tests/resources/unitcommon.js +++ b/tct-privilege-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-push-tizen-tests/resources/unitcommon.js b/tct-push-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-push-tizen-tests/resources/unitcommon.js +++ b/tct-push-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-secureelement-tizen-tests/resources/unitcommon.js b/tct-secureelement-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-secureelement-tizen-tests/resources/unitcommon.js +++ b/tct-secureelement-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-security-tcs-tests/resources/unitcommon.js b/tct-security-tcs-tests/resources/unitcommon.js old mode 100755 new mode 100644 index 78544605c..99c965146 --- a/tct-security-tcs-tests/resources/unitcommon.js +++ b/tct-security-tcs-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-systeminfo-tizen-tests/resources/unitcommon.js b/tct-systeminfo-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-systeminfo-tizen-tests/resources/unitcommon.js +++ b/tct-systeminfo-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-systemsetting-tizen-tests/resources/unitcommon.js b/tct-systemsetting-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-systemsetting-tizen-tests/resources/unitcommon.js +++ b/tct-systemsetting-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-time-tizen-tests/resources/unitcommon.js b/tct-time-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-time-tizen-tests/resources/unitcommon.js +++ b/tct-time-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-tizen-tizen-tests/resources/unitcommon.js b/tct-tizen-tizen-tests/resources/unitcommon.js index 78544605c..99c965146 100644 --- a/tct-tizen-tizen-tests/resources/unitcommon.js +++ b/tct-tizen-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description); diff --git a/tct-websetting-tizen-tests/resources/unitcommon.js b/tct-websetting-tizen-tests/resources/unitcommon.js old mode 100755 new mode 100644 index 78544605c..99c965146 --- a/tct-websetting-tizen-tests/resources/unitcommon.js +++ b/tct-websetting-tizen-tests/resources/unitcommon.js @@ -231,7 +231,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'octet': assert_equals(typeof (obj), 'number', description); @@ -243,7 +243,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned short': assert_equals(typeof (obj), 'number', description); @@ -255,7 +255,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long': assert_equals(typeof (obj), 'number', description); @@ -267,7 +267,7 @@ function assert_type(obj, type, description) { assert_equals(typeof (obj), 'number', description); assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); break; case 'unsigned long long': assert_equals(typeof (obj), 'number', description);