Lines Matching refs:map

47   nghttp2_map map;
48 nghttp2_map_init(&map, nghttp2_mem_default());
56 CU_ASSERT(0 == nghttp2_map_insert(&map, foo.key, &foo));
57 CU_ASSERT(strcmp("foo", ((strentry *)nghttp2_map_find(&map, 1))->str) == 0);
58 CU_ASSERT(1 == nghttp2_map_size(&map));
61 nghttp2_map_insert(&map, FOO.key, &FOO));
63 CU_ASSERT(1 == nghttp2_map_size(&map));
64 CU_ASSERT(strcmp("foo", ((strentry *)nghttp2_map_find(&map, 1))->str) == 0);
66 CU_ASSERT(0 == nghttp2_map_insert(&map, bar.key, &bar));
67 CU_ASSERT(2 == nghttp2_map_size(&map));
69 CU_ASSERT(0 == nghttp2_map_insert(&map, baz.key, &baz));
70 CU_ASSERT(3 == nghttp2_map_size(&map));
72 CU_ASSERT(0 == nghttp2_map_insert(&map, shrubbery.key, &shrubbery));
73 CU_ASSERT(4 == nghttp2_map_size(&map));
75 CU_ASSERT(strcmp("baz", ((strentry *)nghttp2_map_find(&map, 3))->str) == 0);
77 nghttp2_map_remove(&map, 3);
78 CU_ASSERT(3 == nghttp2_map_size(&map));
79 CU_ASSERT(NULL == nghttp2_map_find(&map, 3));
81 nghttp2_map_remove(&map, 1);
82 CU_ASSERT(2 == nghttp2_map_size(&map));
83 CU_ASSERT(NULL == nghttp2_map_find(&map, 1));
86 nghttp2_map_remove(&map, 1);
87 CU_ASSERT(2 == nghttp2_map_size(&map));
88 CU_ASSERT(NULL == nghttp2_map_find(&map, 1));
90 CU_ASSERT(strcmp("bar", ((strentry *)nghttp2_map_find(&map, 2))->str) == 0);
91 CU_ASSERT(strcmp("shrubbery", ((strentry *)nghttp2_map_find(&map, 4))->str) ==
94 nghttp2_map_free(&map);
119 nghttp2_map map;
123 nghttp2_map_init(&map, nghttp2_mem_default());
132 CU_ASSERT(0 == nghttp2_map_insert(&map, ent->key, ent));
135 CU_ASSERT(NUM_ENT == nghttp2_map_size(&map));
138 nghttp2_map_each(&map, eachfun, NULL);
142 CU_ASSERT(NULL != nghttp2_map_find(&map, (nghttp2_map_key_type)order[i]));
146 CU_ASSERT(0 == nghttp2_map_remove(&map, (nghttp2_map_key_type)order[i]));
156 CU_ASSERT(0 == nghttp2_map_insert(&map, ent->key, ent));
158 nghttp2_map_each_free(&map, eachfun, NULL);
159 nghttp2_map_free(&map);
175 nghttp2_map map;
176 nghttp2_map_init(&map, nghttp2_mem_default());
183 nghttp2_map_insert(&map, foo->key, foo);
184 nghttp2_map_insert(&map, bar->key, bar);
185 nghttp2_map_insert(&map, baz->key, baz);
186 nghttp2_map_insert(&map, shrubbery->key, shrubbery);
188 nghttp2_map_each_free(&map, entry_free, (void *)mem);
189 nghttp2_map_free(&map);
194 nghttp2_map map;
199 nghttp2_map_init(&map, mem);
201 CU_ASSERT(0 == nghttp2_map_insert(&map, foo.key, &foo));
203 nghttp2_map_clear(&map);
205 CU_ASSERT(0 == nghttp2_map_size(&map));
207 nghttp2_map_free(&map);