[njs] Fixed unit tests for NetBSD 7.

Dmitry Volyntsev xeioex at nginx.com
Wed Nov 22 17:40:18 UTC 2017


details:   http://hg.nginx.org/njs/rev/c69b48375b90
branches:  
changeset: 434:c69b48375b90
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed Nov 22 20:38:10 2017 +0300
description:
Fixed unit tests for NetBSD 7.

diffstat:

 njs/test/njs_unit_test.c |  12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diffs (69 lines):

diff -r 22cc52416e84 -r c69b48375b90 njs/test/njs_unit_test.c
--- a/njs/test/njs_unit_test.c	Wed Nov 22 18:55:57 2017 +0300
+++ b/njs/test/njs_unit_test.c	Wed Nov 22 20:38:10 2017 +0300
@@ -538,8 +538,10 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("'0' ** 0.1"),
       nxt_string("0") },
 
+#ifndef __NetBSD__  /* NetBSD 7: pow(0, negative) == -Infinity. */
     { nxt_string("0 ** '-0.1'"),
       nxt_string("Infinity") },
+#endif
 
     { nxt_string("(-0) ** 3"),
       nxt_string("-0") },
@@ -550,8 +552,10 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("(-0) ** '-3'"),
       nxt_string("-Infinity") },
 
+#ifndef __NetBSD__  /* NetBSD 7: pow(0, negative) == -Infinity. */
     { nxt_string("'-0' ** -2"),
       nxt_string("Infinity") },
+#endif
 
     { nxt_string("(-3) ** 0.1"),
       nxt_string("NaN") },
@@ -604,8 +608,10 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("var a = '0'; a **= 0.1"),
       nxt_string("0") },
 
+#ifndef __NetBSD__  /* NetBSD 7: pow(0, negative) == -Infinity. */
     { nxt_string("var a = 0; a **= '-0.1'"),
       nxt_string("Infinity") },
+#endif
 
     { nxt_string("var a = -0; a **= 3"),
       nxt_string("-0") },
@@ -616,8 +622,10 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("var a = -0; a **= '-3'"),
       nxt_string("-Infinity") },
 
+#ifndef __NetBSD__  /* NetBSD 7: pow(0, negative) == -Infinity. */
     { nxt_string("var a = '-0'; a **= -2"),
       nxt_string("Infinity") },
+#endif
 
     { nxt_string("var a = -3; a **= 0.1"),
       nxt_string("NaN") },
@@ -7799,8 +7807,10 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("Math.pow('0', 0.1)"),
       nxt_string("0") },
 
+#ifndef __NetBSD__  /* NetBSD 7: pow(0, negative) == -Infinity. */
     { nxt_string("Math.pow(0, '-0.1')"),
       nxt_string("Infinity") },
+#endif
 
     { nxt_string("Math.pow(-0, 3)"),
       nxt_string("-0") },
@@ -7811,8 +7821,10 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("Math.pow(-0, '-3')"),
       nxt_string("-Infinity") },
 
+#ifndef __NetBSD__  /* NetBSD 7: pow(0, negative) == -Infinity. */
     { nxt_string("Math.pow('-0', -2)"),
       nxt_string("Infinity") },
+#endif
 
     { nxt_string("Math.pow(-3, 0.1)"),
       nxt_string("NaN") },


More information about the nginx-devel mailing list