Lines Matching defs:map

26 #include "atf-c/detail/map.h"
51 atf_map_t map;
53 RE(atf_map_init(&map));
54 ATF_REQUIRE_EQ(atf_map_size(&map), 0);
55 atf_map_fini(&map);
61 atf_map_t map;
63 RE(atf_map_init_charpp(&map, NULL));
64 ATF_REQUIRE_EQ(atf_map_size(&map), 0);
65 atf_map_fini(&map);
72 atf_map_t map;
74 RE(atf_map_init_charpp(&map, array));
75 ATF_REQUIRE_EQ(atf_map_size(&map), 0);
76 atf_map_fini(&map);
83 atf_map_t map;
86 RE(atf_map_init_charpp(&map, array));
87 ATF_REQUIRE_EQ(atf_map_size(&map), 2);
89 iter = atf_map_find_c(&map, "K1");
90 ATF_REQUIRE(!atf_equal_map_citer_map_citer(iter, atf_map_end_c(&map)));
94 iter = atf_map_find_c(&map, "K2");
95 ATF_REQUIRE(!atf_equal_map_citer_map_citer(iter, atf_map_end_c(&map)));
99 atf_map_fini(&map);
106 atf_map_t map;
108 atf_error_t err = atf_map_init_charpp(&map, array);
124 atf_map_t map;
129 RE(atf_map_init(&map));
130 RE(atf_map_insert(&map, "K1", val1, false));
131 RE(atf_map_insert(&map, "K2", val2, false));
133 iter = atf_map_find(&map, "K0");
134 ATF_REQUIRE(atf_equal_map_iter_map_iter(iter, atf_map_end(&map)));
136 iter = atf_map_find(&map, "K1");
137 ATF_REQUIRE(!atf_equal_map_iter_map_iter(iter, atf_map_end(&map)));
142 iter = atf_map_find(&map, "K1");
143 ATF_REQUIRE(!atf_equal_map_iter_map_iter(iter, atf_map_end(&map)));
147 iter = atf_map_find(&map, "K2");
148 ATF_REQUIRE(!atf_equal_map_iter_map_iter(iter, atf_map_end(&map)));
152 atf_map_fini(&map);
162 atf_map_t map;
167 RE(atf_map_init(&map));
168 RE(atf_map_insert(&map, "K1", val1, false));
169 RE(atf_map_insert(&map, "K2", val2, false));
171 iter = atf_map_find_c(&map, "K0");
172 ATF_REQUIRE(atf_equal_map_citer_map_citer(iter, atf_map_end_c(&map)));
174 iter = atf_map_find_c(&map, "K1");
175 ATF_REQUIRE(!atf_equal_map_citer_map_citer(iter, atf_map_end_c(&map)));
179 iter = atf_map_find_c(&map, "K2");
180 ATF_REQUIRE(!atf_equal_map_citer_map_citer(iter, atf_map_end_c(&map)));
184 atf_map_fini(&map);
190 atf_map_t map;
193 RE(atf_map_init(&map));
194 ATF_REQUIRE((array = atf_map_to_charpp(&map)) != NULL);
195 atf_map_fini(&map);
204 atf_map_t map;
211 RE(atf_map_init(&map));
212 RE(atf_map_insert(&map, "K1", s1, false));
213 RE(atf_map_insert(&map, "K2", s2, false));
214 RE(atf_map_insert(&map, "K3", s3, false));
215 ATF_REQUIRE((array = atf_map_to_charpp(&map)) != NULL);
216 atf_map_fini(&map);
239 atf_map_t map;
245 RE(atf_map_init(&map));
248 ATF_REQUIRE_EQ(atf_map_size(&map), 0);
249 RE(atf_map_insert(&map, "K1", buf, false));
250 ATF_REQUIRE_EQ(atf_map_size(&map), 1);
251 RE(atf_map_insert(&map, "K2", buf, false));
252 ATF_REQUIRE_EQ(atf_map_size(&map), 2);
253 RE(atf_map_insert(&map, "K3", buf, false));
254 ATF_REQUIRE_EQ(atf_map_size(&map), 3);
257 iter = atf_map_find_c(&map, "K3");
258 ATF_REQUIRE(!atf_equal_map_citer_map_citer(iter, atf_map_end_c(&map)));
261 RE(atf_map_insert(&map, "K3", buf2, false));
262 ATF_REQUIRE_EQ(atf_map_size(&map), 3);
263 iter = atf_map_find_c(&map, "K3");
264 ATF_REQUIRE(!atf_equal_map_citer_map_citer(iter, atf_map_end_c(&map)));
268 atf_map_fini(&map);
282 atf_map_t map;
288 printf("Iterating over empty map\n");
289 RE(atf_map_init(&map));
291 atf_map_for_each(iter, &map) {
296 atf_map_fini(&map);
299 printf("Iterating over map of %zd elements\n", size);
300 RE(atf_map_init(&map));
304 RE(atf_map_insert(&map, keys[i], &nums[i], false));
307 atf_map_for_each(iter, &map) {
312 atf_map_fini(&map);
323 atf_map_t map;
329 printf("Iterating over empty map\n");
330 RE(atf_map_init(&map));
332 atf_map_for_each_c(iter, &map) {
337 atf_map_fini(&map);
340 printf("Iterating over map of %zd elements\n", size);
341 RE(atf_map_init(&map));
345 RE(atf_map_insert(&map, keys[i], &nums[i], false));
348 atf_map_for_each_c(iter, &map) {
354 atf_map_fini(&map);
370 atf_map_t map;
374 RE(atf_map_init(&map));
376 RE(atf_map_insert(&map, key, strdup("test-value"), true));
377 iter = atf_map_find_c(&map, "K1");
378 ATF_REQUIRE(!atf_equal_map_citer_map_citer(iter, atf_map_end_c(&map)));
379 iter = atf_map_find_c(&map, "K2");
380 ATF_REQUIRE(atf_equal_map_citer_map_citer(iter, atf_map_end_c(&map)));
383 iter = atf_map_find_c(&map, "K1");
384 ATF_REQUIRE(!atf_equal_map_citer_map_citer(iter, atf_map_end_c(&map)));
385 iter = atf_map_find_c(&map, "K2");
386 ATF_REQUIRE(atf_equal_map_citer_map_citer(iter, atf_map_end_c(&map)));
388 atf_map_fini(&map);