[njs] Fixed benchmark test missed in 78b8cfd5b1e9.

Dmitry Volyntsev xeioex at nginx.com
Mon May 18 14:43:10 UTC 2020


details:   https://hg.nginx.org/njs/rev/cd1a7a0c3fe9
branches:  
changeset: 1390:cd1a7a0c3fe9
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Mon May 18 14:43:00 2020 +0000
description:
Fixed benchmark test missed in 78b8cfd5b1e9.

diffstat:

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

diffs (39 lines):

diff -r 80d95b2881f6 -r cd1a7a0c3fe9 src/test/njs_benchmark.c
--- a/src/test/njs_benchmark.c	Mon May 18 13:22:34 2020 +0000
+++ b/src/test/njs_benchmark.c	Mon May 18 14:43:00 2020 +0000
@@ -76,6 +76,7 @@ njs_benchmark_test(njs_vm_t *parent, njs
     n = test->repeat;
     expected = &test->result;
 
+    ret = NJS_ERROR;
     us = njs_time() / 1000;
 
     for (i = 0; i < n; i++) {
@@ -96,7 +97,8 @@ njs_benchmark_test(njs_vm_t *parent, njs
         success = njs_strstr_eq(expected, &s);
 
         if (!success) {
-            njs_printf("failed: \"%V\" vs \"%V\"\n", expected, &s);
+            njs_printf("%s failed: \"%V\" vs \"%V\"\n", test->name, expected,
+                       &s);
             goto done;
         }
 
@@ -266,7 +268,7 @@ static njs_benchmark_test_t  njs_test[] 
 
     { "external object property ($shared.props.a)",
       njs_str("$shared.props.a"),
-      njs_str("4294967295"),
+      njs_str("11"),
       1000 },
 
     { "external dump (JSON.stringify($shared.header))",
@@ -395,8 +397,6 @@ main(int argc, char **argv)
 
     njs_vm_start(vm);
 
-    ret = EXIT_FAILURE;
-
     ret = njs_vm_array_alloc(vm, &report, 8);
     if (ret != NJS_OK) {
         njs_printf("njs_vm_array_alloc() failed\n");


More information about the nginx-devel mailing list