[njs] Fixed TextDecoder() test on big-endian platforms.

Dmitry Volyntsev xeioex at nginx.com
Thu Sep 3 13:30:54 UTC 2020


details:   https://hg.nginx.org/njs/rev/f4fe4b4b9730
branches:  
changeset: 1517:f4fe4b4b9730
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Thu Sep 03 13:30:17 2020 +0000
description:
Fixed TextDecoder() test on big-endian platforms.

diffstat:

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

diffs (14 lines):

diff -r 95faab343e26 -r f4fe4b4b9730 src/test/njs_unit_test.c
--- a/src/test/njs_unit_test.c	Thu Sep 03 13:30:16 2020 +0000
+++ b/src/test/njs_unit_test.c	Thu Sep 03 13:30:17 2020 +0000
@@ -18205,8 +18205,8 @@ static njs_unit_test_t  njs_test[] =
 
     { njs_str("var de = new TextDecoder();"
               "var u8arr = new Uint8Array([240, 160, 174, 183]);"
-              "var u16arr = new Uint16Array([41200, 47022]);"
-              "var u32arr = new Uint32Array([3081674992]);"
+              "var u16arr = new Uint16Array(u8arr.buffer);"
+              "var u32arr = new Uint32Array(u8arr.buffer);"
               "[u8arr, u16arr, u32arr].map(v=>de.decode(v)).join(',')"),
       njs_str("𠮷,𠮷,𠮷") },
 


More information about the nginx-devel mailing list