Lines Matching refs:CHECK
13 #define CHECK(condition, format...) ({ \ macro
62 if (CHECK(IS_ERR(map), "failed to create map: %ld\n", PTR_ERR(map))) in test_hashmap_generic()
70 if (CHECK(err != -ENOENT, "unexpected result: %d\n", err)) in test_hashmap_generic()
77 if (CHECK(oldk != NULL || oldv != NULL, in test_hashmap_generic()
82 if (CHECK(err, "failed to add k/v %ld = %ld: %d\n", in test_hashmap_generic()
86 if (CHECK(!hashmap__find(map, k, &oldv), in test_hashmap_generic()
89 if (CHECK(oldv != v, "found value is wrong: %ld\n", (long)oldv)) in test_hashmap_generic()
93 if (CHECK(hashmap__size(map) != ELEM_CNT, in test_hashmap_generic()
96 if (CHECK(hashmap__capacity(map) != exp_cap(hashmap__size(map)), in test_hashmap_generic()
106 if (CHECK(v - k != 1024, "invalid k/v pair: %ld = %ld\n", k, v)) in test_hashmap_generic()
109 if (CHECK(found_msk != (1ULL << ELEM_CNT) - 1, in test_hashmap_generic()
118 if (CHECK(err != -EEXIST, "unexpected add result: %d\n", err)) in test_hashmap_generic()
126 if (CHECK(err, "failed to update k/v %ld = %ld: %d\n", in test_hashmap_generic()
129 if (CHECK(!hashmap__find(map, k, &oldv), in test_hashmap_generic()
132 if (CHECK(oldv != v, "found value is wrong: %ld\n", (long)oldv)) in test_hashmap_generic()
136 if (CHECK(hashmap__size(map) != ELEM_CNT, in test_hashmap_generic()
139 if (CHECK(hashmap__capacity(map) != exp_cap(hashmap__size(map)), in test_hashmap_generic()
149 if (CHECK(v - k != 256, in test_hashmap_generic()
153 if (CHECK(found_msk != (1ULL << ELEM_CNT) - 1, in test_hashmap_generic()
161 if (CHECK(!found_cnt, "didn't find any entries for key 0\n")) in test_hashmap_generic()
176 if (CHECK(!hashmap__delete(map, k, &oldk, &oldv), in test_hashmap_generic()
180 if (CHECK(oldk != k || oldv != v, in test_hashmap_generic()
184 if (CHECK(hashmap__delete(map, k, &oldk, &oldv), in test_hashmap_generic()
190 if (CHECK(!found_cnt || !found_msk, in test_hashmap_generic()
193 if (CHECK(hashmap__size(map) != ELEM_CNT - found_cnt, in test_hashmap_generic()
197 if (CHECK(hashmap__capacity(map) != exp_cap(hashmap__size(map)), in test_hashmap_generic()
211 if (CHECK(!hashmap__delete(map, k, &oldk, &oldv), in test_hashmap_generic()
215 if (CHECK(oldk != k || oldv != v, in test_hashmap_generic()
219 if (CHECK(hashmap__delete(map, k, &oldk, &oldv), in test_hashmap_generic()
225 if (CHECK(found_cnt != ELEM_CNT || found_msk != (1ULL << ELEM_CNT) - 1, in test_hashmap_generic()
229 if (CHECK(hashmap__size(map) != 0, in test_hashmap_generic()
236 CHECK(false, "unexpected map entries left: %ld = %ld\n", in test_hashmap_generic()
243 CHECK(false, "unexpected map entries left: %ld = %ld\n", in test_hashmap_generic()
269 if (CHECK(IS_ERR(map), "failed to create map: %ld\n", PTR_ERR(map))) in test_hashmap_multimap()
278 if (CHECK(err, "failed to add k/v: %d\n", err)) in test_hashmap_multimap()
281 if (CHECK(err, "failed to add k/v: %d\n", err)) in test_hashmap_multimap()
284 if (CHECK(err, "failed to add k/v: %d\n", err)) in test_hashmap_multimap()
288 if (CHECK(err, "failed to add k/v: %d\n", err)) in test_hashmap_multimap()
291 if (CHECK(err, "failed to add k/v: %d\n", err)) in test_hashmap_multimap()
294 if (CHECK(err, "failed to add k/v: %d\n", err)) in test_hashmap_multimap()
297 if (CHECK(hashmap__size(map) != 6, in test_hashmap_multimap()
306 if (CHECK(found_msk != (1 << 6) - 1, in test_hashmap_multimap()
315 if (CHECK(found_msk != (1 | 2 | 4), in test_hashmap_multimap()
324 if (CHECK(found_msk != (8 | 16 | 32), in test_hashmap_multimap()
343 if (CHECK(IS_ERR(map), "failed to create map: %ld\n", PTR_ERR(map))) in test_hashmap_empty()
346 if (CHECK(hashmap__size(map) != 0, in test_hashmap_empty()
349 if (CHECK(hashmap__capacity(map) != 0, in test_hashmap_empty()
352 if (CHECK(hashmap__find(map, k, NULL), "unexpected find\n")) in test_hashmap_empty()
354 if (CHECK(hashmap__delete(map, k, NULL, NULL), "unexpected delete\n")) in test_hashmap_empty()
358 CHECK(false, "unexpected iterated entry\n"); in test_hashmap_empty()
362 CHECK(false, "unexpected key entry\n"); in test_hashmap_empty()