[njs] The lvlhsh unit test has been updated after nxt_str_t chan...

Igor Sysoev igor at sysoev.ru
Thu Aug 4 13:32:08 UTC 2016


details:   http://hg.nginx.org/njs/rev/19175c06b532
branches:  
changeset: 142:19175c06b532
user:      Igor Sysoev <igor at sysoev.ru>
date:      Thu Aug 04 16:31:48 2016 +0300
description:
The lvlhsh unit test has been updated after nxt_str_t changes.

diffstat:

 nxt/test/lvlhsh_unit_test.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (53 lines):

diff -r b33ba39a1108 -r 19175c06b532 nxt/test/lvlhsh_unit_test.c
--- a/nxt/test/lvlhsh_unit_test.c	Thu Aug 04 16:27:38 2016 +0300
+++ b/nxt/test/lvlhsh_unit_test.c	Thu Aug 04 16:31:48 2016 +0300
@@ -6,6 +6,7 @@
 
 #include <nxt_types.h>
 #include <nxt_clang.h>
+#include <nxt_string.h>
 #include <nxt_stub.h>
 #include <nxt_malloc.h>
 #include <nxt_lvlhsh.h>
@@ -19,7 +20,7 @@
 static nxt_int_t
 lvlhsh_unit_test_key_test(nxt_lvlhsh_query_t *lhq, void *data)
 {
-    if (*(uintptr_t *) lhq->key.data == (uintptr_t) data) {
+    if (*(uintptr_t *) lhq->key.start == (uintptr_t) data) {
         return NXT_OK;
     }
 
@@ -58,8 +59,8 @@ lvlhsh_unit_test_add(nxt_lvlhsh_t *lh, c
 
     lhq.key_hash = key;
     lhq.replace = 0;
-    lhq.key.len = sizeof(uintptr_t);
-    lhq.key.data = (u_char *) &key;
+    lhq.key.length = sizeof(uintptr_t);
+    lhq.key.start = (u_char *) &key;
     lhq.value = (void *) key;
     lhq.proto = proto;
     lhq.pool = pool;
@@ -86,8 +87,8 @@ lvlhsh_unit_test_get(nxt_lvlhsh_t *lh, c
     nxt_lvlhsh_query_t  lhq;
 
     lhq.key_hash = key;
-    lhq.key.len = sizeof(uintptr_t);
-    lhq.key.data =  (u_char *) &key;
+    lhq.key.length = sizeof(uintptr_t);
+    lhq.key.start =  (u_char *) &key;
     lhq.proto = proto;
 
     if (nxt_lvlhsh_find(lh, &lhq) == NXT_OK) {
@@ -112,8 +113,8 @@ lvlhsh_unit_test_delete(nxt_lvlhsh_t *lh
     nxt_lvlhsh_query_t  lhq;
 
     lhq.key_hash = key;
-    lhq.key.len = sizeof(uintptr_t);
-    lhq.key.data = (u_char *) &key;
+    lhq.key.length = sizeof(uintptr_t);
+    lhq.key.start = (u_char *) &key;
     lhq.proto = proto;
     lhq.pool = pool;
 



More information about the nginx-devel mailing list