]> git.kaiwu.me - njs.git/commitdiff
Fixed unit tests on FreeBSD.
authorIgor Sysoev <igor@sysoev.ru>
Wed, 16 Nov 2016 12:21:03 +0000 (15:21 +0300)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 16 Nov 2016 12:21:03 +0000 (15:21 +0300)
njs/test/njs_unit_test.c

index d8f759cf97beec17273535d750904bce4ec89550..4c8e37ce48749144fa91f0583fb184d00424b0a4 100644 (file)
@@ -5738,8 +5738,12 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("Math.exp(-Infinity)"),
       nxt_string("0") },
 
-    { nxt_string("Math.exp(1) - Math.E"),
-      nxt_string("0") },
+    /*
+     * The difference is 2 * Number.EPSILON on FreeBSD
+     * and zero on other platforms.
+     */
+    { nxt_string("Math.exp(1) - Math.E <= 2 * Number.EPSILON"),
+      nxt_string("true") },
 
     { nxt_string("Math.floor()"),
       nxt_string("NaN") },