[njs] Fixed unit tests on FreeBSD.

Igor Sysoev igor at sysoev.ru
Wed Nov 16 12:22:07 UTC 2016


details:   http://hg.nginx.org/njs/rev/73e4b9ddb4df
branches:  
changeset: 260:73e4b9ddb4df
user:      Igor Sysoev <igor at sysoev.ru>
date:      Wed Nov 16 15:21:03 2016 +0300
description:
Fixed unit tests on FreeBSD.

diffstat:

 njs/test/njs_unit_test.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 8253ecba7ad6 -r 73e4b9ddb4df njs/test/njs_unit_test.c
--- a/njs/test/njs_unit_test.c	Wed Nov 16 12:49:53 2016 +0300
+++ b/njs/test/njs_unit_test.c	Wed Nov 16 15:21:03 2016 +0300
@@ -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") },



More information about the nginx-devel mailing list