]> git.kaiwu.me - njs.git/commitdiff
Fixed benchmark test missed in 78b8cfd5b1e9.
authorDmitry Volyntsev <xeioex@nginx.com>
Mon, 18 May 2020 14:43:00 +0000 (14:43 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Mon, 18 May 2020 14:43:00 +0000 (14:43 +0000)
src/test/njs_benchmark.c

index 61e3d4350260b47116a06277de9d4c0e0c0593e0..7eeb0e35a805e80b87dd488b5623cc794c6cb61e 100644 (file)
@@ -76,6 +76,7 @@ njs_benchmark_test(njs_vm_t *parent, njs_opts_t *opts, njs_value_t *report,
     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_opts_t *opts, njs_value_t *report,
         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");