[njs] Fixed building unit tests by SunC 5.15.

Dmitry Volyntsev xeioex at nginx.com
Fri Apr 3 16:07:19 UTC 2020


details:   https://hg.nginx.org/njs/rev/78b8cfd5b1e9
branches:  
changeset: 1365:78b8cfd5b1e9
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Fri Apr 03 16:06:55 2020 +0000
description:
Fixed building unit tests by SunC 5.15.

Fixed warning "initializer will be sign-extended".

diffstat:

 src/test/njs_externals_test.c |  4 ++--
 src/test/njs_unit_test.c      |  6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diffs (40 lines):

diff -r 2a03cd71561a -r 78b8cfd5b1e9 src/test/njs_externals_test.c
--- a/src/test/njs_externals_test.c	Thu Mar 26 17:12:16 2020 +0300
+++ b/src/test/njs_externals_test.c	Fri Apr 03 16:06:55 2020 +0000
@@ -614,8 +614,8 @@ static njs_unit_test_req_init_t njs_test
     { njs_str("$shared"),
         {
             .uri = njs_str("shared"),
-            .a = -1,
-            .d = -2,
+            .a = 11,
+            .d = 13,
         },
         {
             { njs_string("r"), njs_string("rval") },
diff -r 2a03cd71561a -r 78b8cfd5b1e9 src/test/njs_unit_test.c
--- a/src/test/njs_unit_test.c	Thu Mar 26 17:12:16 2020 +0300
+++ b/src/test/njs_unit_test.c	Fri Apr 03 16:06:55 2020 +0000
@@ -16845,11 +16845,11 @@ static njs_unit_test_t  njs_shared_test[
       njs_str("{a:'1',b:42,c:{d:1024}}") },
 
     { njs_str("njs.dump($shared.props)"),
-      njs_str("{a:'4294967295',b:42,c:{d:4294967294}}") },
+      njs_str("{a:'11',b:42,c:{d:13}}") },
 
     { njs_str("var r = JSON.parse(JSON.stringify($shared));"
               "[r.uri, r.host, r.props.a, njs.dump(r.vars), njs.dump(r.consts), r.header['02']]"),
-      njs_str("shared,АБВГДЕЁЖЗИЙ,4294967295,{},{},02|АБВ") },
+      njs_str("shared,АБВГДЕЁЖЗИЙ,11,{},{},02|АБВ") },
 
     { njs_str("$shared.toString()"),
       njs_str("[object External]") },
@@ -16864,7 +16864,7 @@ static njs_unit_test_t  njs_shared_test[
       njs_str("1") },
 
     { njs_str("$shared.method = function() {return this.props.a;}; $shared.method()"),
-      njs_str("4294967295") },
+      njs_str("11") },
 
     { njs_str("var r; for (var i = 0; i < 2**10; i++) {r = $r.create('XXX').uri;}"),
       njs_str("undefined") },


More information about the nginx-devel mailing list