X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=tests%2Flibpspp%2Fstringi-map-test.c;h=eaf4102bb15341e6eb8c70c8bc961d4397027175;hb=b2368722d2281703dd72de978e2fb7ad9caea7e5;hp=a78fd56557f53a46be68ac9a32a346fe1f377acd;hpb=cb08510bbbab7646bc1031427243489024d22a3b;p=pspp diff --git a/tests/libpspp/stringi-map-test.c b/tests/libpspp/stringi-map-test.c index a78fd56557..eaf4102bb1 100644 --- a/tests/libpspp/stringi-map-test.c +++ b/tests/libpspp/stringi-map-test.c @@ -223,7 +223,7 @@ check_map_contains (struct stringi_map *map, check (stringi_map_contains (map, key)); - node = stringi_map_find_node (map, key); + node = stringi_map_find_node (map, key, strlen (key)); check (node != NULL); check (!utf8_strcasecmp (key, stringi_map_node_get_key (node))); check (!strcmp (value, stringi_map_node_get_value (node))); @@ -271,7 +271,7 @@ check_stringi_map (struct stringi_map *map, const int data[], size_t cnt) check (!stringi_map_contains (map, "xxx")); check (stringi_map_find (map, "0") == NULL); - check (stringi_map_find_node (map, "") == NULL); + check (stringi_map_find_node (map, "", 0) == NULL); check (!stringi_map_delete (map, "xyz")); if (cnt == 0) @@ -689,11 +689,12 @@ node_swap_value_cb (struct stringi_map *map, int data[], int n) for (i = 0; i < n; i++) { + const char *key = make_key (data[i]); const char *value = make_value (data[i]); struct stringi_map_node *node; char *old_value; - node = stringi_map_find_node (map, make_key (data[i])); + node = stringi_map_find_node (map, key, strlen (key)); check (node != NULL); check (!strcmp (stringi_map_node_get_value (node), value)); data[i] = (data[i] & KEY_MASK) | random_value (i, 15);