]> git.kaiwu.me - njs.git/commitdiff
Tolerate epsilon difference in the previous unit test change.
authorSergey Kandaurov <pluknet@nginx.com>
Tue, 13 Nov 2018 12:25:00 +0000 (15:25 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Tue, 13 Nov 2018 12:25:00 +0000 (15:25 +0300)
njs/test/njs_unit_test.c

index e0b81cfe8d090d0d508777b1a42ec23b4bdd8555..89e32871119fdf2498c97c0b35dbc2558d04f426 100644 (file)
@@ -9071,10 +9071,13 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("Math.sinh(-Infinity)"),
       nxt_string("-Infinity") },
 
-#ifndef __SUNPRO_C /* Sun C 5.15: round error */
-    { nxt_string("Math.sinh(1) - (Math.E - 1/Math.E)/2"),
-      nxt_string("0") },
-#endif
+    /*
+     * The difference is Number.EPSILON on Solaris
+     * and zero on other platforms.
+     */
+    { nxt_string("Math.abs(Math.sinh(1) - (Math.E - 1/Math.E)/2)"
+                 " <= Number.EPSILON"),
+      nxt_string("true") },
 
     { nxt_string("Math.sqrt()"),
       nxt_string("NaN") },