[unitcommon] the existence of '-0' - amendment in type checking
authorMariusz Polasinski <m.polasinski@samsung.com>
Tue, 13 Aug 2013 14:49:06 +0000 (16:49 +0200)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Wed, 14 Aug 2013 07:50:19 +0000 (07:50 +0000)
Change-Id: Ieb76455372b61eba00db7b289b5f5caa3858705e

33 files changed:
tct-alarm-tizen-tests/resources/unitcommon.js
tct-appcontrol-tizen-tests/resources/unitcommon.js [changed mode: 0755->0644]
tct-application-tizen-tests/application/support/TCTAppControl/resources/unitcommon.js [changed mode: 0755->0644]
tct-application-tizen-tests/resources/unitcommon.js
tct-bluetooth-tizen-tests/resources/unitcommon.js
tct-bookmark-tizen-tests/resources/unitcommon.js
tct-calendar-tizen-tests/resources/unitcommon.js
tct-callhistory-tizen-tests/resources/unitcommon.js
tct-contact-tizen-tests/resources/unitcommon.js
tct-content-tizen-tests/resources/unitcommon.js
tct-datacontrol-tizen-tests/resources/unitcommon.js
tct-datasync-tizen-tests/resources/unitcommon.js
tct-download-tizen-tests/resources/unitcommon.js
tct-filesystem-tizen-tests/resources/unitcommon.js
tct-messageport-tizen-tests/resources/unitcommon.js
tct-messaging-email-tizen-tests/resources/unitcommon.js
tct-messaging-mms-tizen-tests/resources/unitcommon.js
tct-messaging-sms-tizen-tests/resources/unitcommon.js
tct-namespace-tizen-tests/resources/unitcommon.js [changed mode: 0755->0644]
tct-networkbearerselection-tizen-tests/resources/unitcommon.js
tct-nfc-tizen-tests/resources/unitcommon.js
tct-notification-tizen-tests/resources/unitcommon.js
tct-package-tizen-tests/resources/unitcommon.js
tct-power-tizen-tests/resources/unitcommon.js
tct-privilege-tizen-tests/resources/unitcommon.js [changed mode: 0755->0644]
tct-push-tizen-tests/resources/unitcommon.js
tct-secureelement-tizen-tests/resources/unitcommon.js
tct-security-tcs-tests/resources/unitcommon.js [changed mode: 0755->0644]
tct-systeminfo-tizen-tests/resources/unitcommon.js
tct-systemsetting-tizen-tests/resources/unitcommon.js
tct-time-tizen-tests/resources/unitcommon.js
tct-tizen-tizen-tests/resources/unitcommon.js
tct-websetting-tizen-tests/resources/unitcommon.js [changed mode: 0755->0644]

index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
old mode 100755 (executable)
new mode 100644 (file)
index 7854460..99c9651
@@ -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);
old mode 100755 (executable)
new mode 100644 (file)
index 3ac47d5..99c9651
@@ -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:
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
old mode 100755 (executable)
new mode 100644 (file)
index 7854460..99c9651
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
old mode 100755 (executable)
new mode 100644 (file)
index 7854460..99c9651
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
old mode 100755 (executable)
new mode 100644 (file)
index 7854460..99c9651
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
index 78544605c5945262dd9cd9579be4cd4cc2e2c6d3..99c965146dcf507ce49b1bb9c59411aa678b9531 100644 (file)
@@ -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);
old mode 100755 (executable)
new mode 100644 (file)
index 7854460..99c9651
@@ -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);