Lines Matching refs:assert
26 assert((int)(bitmap == IDR_FULL)); in ktest_idr_case0()
29 assert(k_idr.top == NULL); // 刚被创建,必须是NULL in ktest_idr_case0()
30 assert(k_idr.id_free_cnt == 0); // 必须是0 in ktest_idr_case0()
31 assert(k_idr.free_list == NULL); in ktest_idr_case0()
35 assert(k_idr.id_free_cnt == 0); in ktest_idr_case0()
37 assert(idr_preload(&k_idr, 0) == 0); in ktest_idr_case0()
38 assert(k_idr.id_free_cnt == IDR_FREE_MAX); in ktest_idr_case0()
49 assert(id == chk_id); in ktest_idr_case0()
54 assert(k_idr.id_free_cnt == 0); in ktest_idr_case0()
55 assert(k_idr.free_list == NULL); in ktest_idr_case0()
56 assert(k_idr.top == NULL); in ktest_idr_case0()
75 assert(idr_alloc(&k_idr, &a[i], &a[i]) == 0); in ktest_idr_case1()
76 assert(a[i] == i); in ktest_idr_case1()
83 assert(ptr == &a[i]); in ktest_idr_case1()
84 assert(ptr != NULL); in ktest_idr_case1()
85 assert(*ptr == a[i]); in ktest_idr_case1()
92 assert(id != NULL); in ktest_idr_case1()
93 assert(*id == i); in ktest_idr_case1()
94 assert(idr_find(&k_idr, a[i]) == NULL); in ktest_idr_case1()
101 assert(id != NULL); in ktest_idr_case1()
102 assert(*id == i); in ktest_idr_case1()
103 assert(idr_find(&k_idr, a[i]) == NULL); in ktest_idr_case1()
108 assert(idr_count(&k_idr, i) == 0); in ktest_idr_case1()
114 assert(idr_alloc(&k_idr, &a[i], &a[i]) == 0); in ktest_idr_case1()
115 assert(a[i] == i); in ktest_idr_case1()
120 assert(idr_count(&k_idr, i)); in ktest_idr_case1()
127 assert(id != NULL); in ktest_idr_case1()
128 assert(*id == i); in ktest_idr_case1()
129 assert(idr_find(&k_idr, a[i]) == NULL); in ktest_idr_case1()
136 assert(id != NULL); in ktest_idr_case1()
137 assert(*id == i); in ktest_idr_case1()
138 assert(idr_find(&k_idr, a[i]) == NULL); in ktest_idr_case1()
143 assert(k_idr.top == NULL); in ktest_idr_case1()
148 assert(idr_alloc(&k_idr, &a[i], &a[i]) == 0); in ktest_idr_case1()
149 assert(a[i] == i); in ktest_idr_case1()
156 assert(ptr == &a[i]); in ktest_idr_case1()
157 assert(*ptr == a[i]); in ktest_idr_case1()
164 assert(idr_find(&k_idr, a[i]) == NULL); in ktest_idr_case1()
171 assert(idr_find(&k_idr, a[i]) == NULL); in ktest_idr_case1()
176 assert(k_idr.id_free_cnt == 0); in ktest_idr_case1()
177 assert(k_idr.free_list == NULL); in ktest_idr_case1()
201 assert(idr_alloc(&k_idr, &tmp, &tmp) == 0); in ktest_idr_case2()
203 assert(tmp == i); in ktest_idr_case2()
208 assert(ptr != NULL); in ktest_idr_case2()
209 assert(*ptr == i); in ktest_idr_case2()
213 assert(idr_count(&k_idr, i)); in ktest_idr_case2()
221 assert(ptr != NULL); in ktest_idr_case2()
222 assert(*ptr == N - 1); in ktest_idr_case2()
224 assert(idr_find(&k_idr, i) == NULL); in ktest_idr_case2()
232 assert(*ptr == N - 1); in ktest_idr_case2()
234 assert(idr_find(&k_idr, i) == NULL); in ktest_idr_case2()
240 assert(idr_alloc(&k_idr, &tmp, &tmp) == 0); in ktest_idr_case2()
241 assert(tmp == i); in ktest_idr_case2()
242 assert(k_idr.top != NULL); in ktest_idr_case2()
245 assert(ptr != NULL); in ktest_idr_case2()
246 assert(*ptr == i); in ktest_idr_case2()
249 assert(k_idr.top != NULL); in ktest_idr_case2()
253 assert(idr_replace(&k_idr, NULL, i) == 0); in ktest_idr_case2()
258 assert(k_idr.id_free_cnt == 0); in ktest_idr_case2()
259 assert(k_idr.free_list == NULL); in ktest_idr_case2()
280 assert(idr_alloc(&k_idr, &tmp, &tmp) == 0); in ktest_idr_case3()
281 assert(tmp == i); in ktest_idr_case3()
284 assert(ptr != NULL); in ktest_idr_case3()
285 assert(*ptr == i); in ktest_idr_case3()
295 assert(ptr != NULL); in ktest_idr_case3()
296 assert(*ptr == N - 1); in ktest_idr_case3()
297 assert(nextid == i); in ktest_idr_case3()
301 assert(ptr == NULL); in ktest_idr_case3()
302 assert(nextid == -1); in ktest_idr_case3()
311 assert(ptr != NULL); in ktest_idr_case3()
312 assert(*ptr == N - 1); in ktest_idr_case3()
315 assert(idr_find(&k_idr, i) == NULL); in ktest_idr_case3()
317 assert(k_idr.top != NULL); in ktest_idr_case3()
328 assert(ptr != NULL); in ktest_idr_case3()
329 assert(*ptr == N - 1); in ktest_idr_case3()
330 assert(nextid == target); in ktest_idr_case3()
334 assert(ptr == NULL); in ktest_idr_case3()
335 assert(nextid == -1); in ktest_idr_case3()
341 assert(k_idr.id_free_cnt == 0); in ktest_idr_case3()
342 assert(k_idr.free_list == NULL); in ktest_idr_case3()
366 assert(idr_alloc(&k_idr, &tmp, &tmp) == 0); in ktest_idr_case4()
367 assert(tmp == j); in ktest_idr_case4()
373 assert(ptr != NULL); in ktest_idr_case4()
374 assert(*ptr == M - 1); in ktest_idr_case4()
381 assert(ptr != NULL); in ktest_idr_case4()
382 assert(*ptr == M - 1); in ktest_idr_case4()
389 assert(ptr != NULL); in ktest_idr_case4()
390 assert(*ptr == M - 1); in ktest_idr_case4()
394 assert(k_idr.top == NULL); in ktest_idr_case4()
395 assert(idr_empty(&k_idr)); in ktest_idr_case4()
400 assert(k_idr.id_free_cnt == 0); in ktest_idr_case4()
401 assert(k_idr.free_list == NULL); in ktest_idr_case4()
402 assert(idr_empty(&k_idr)); in ktest_idr_case4()
422 assert(idr_alloc(&k_idr, &a[i], &a[i]) == 0); in ktest_idr_case5()
423 assert(a[i] == i); in ktest_idr_case5()
431 assert(flags == 0); // 0 是成功 in ktest_idr_case5()
432 assert(ptr != NULL); in ktest_idr_case5()
433 assert(*ptr == i); in ktest_idr_case5()
437 assert(ptr != NULL); in ktest_idr_case5()
438 assert(*ptr == (i + 1) % N); in ktest_idr_case5()
443 assert(k_idr.id_free_cnt == 0); in ktest_idr_case5()
444 assert(k_idr.free_list == NULL); in ktest_idr_case5()
449 assert(idr_alloc(&k_idr, &a[i], &a[i]) == 0); in ktest_idr_case5()
450 assert(a[i] == i); in ktest_idr_case5()
455 assert(idr_empty(&k_idr)); in ktest_idr_case5()
456 assert(k_idr.id_free_cnt == 0); in ktest_idr_case5()
457 assert(k_idr.free_list == NULL); in ktest_idr_case5()
471 assert(IDA_BITMAP_LONGS != 0); in ktest_idr_case6()
472 assert(IDA_BMP_SIZE != 0); in ktest_idr_case6()
473 assert(IDA_FULL != 0); in ktest_idr_case6()
474 assert(IDA_BITMAP_BITS != 0); in ktest_idr_case6()
486 assert(ida_alloc(&k_ida, &p_id) == 0); in ktest_idr_case6()
488 assert(p_id == i); in ktest_idr_case6()
494 assert(ida_count(&k_ida, i) == 1); in ktest_idr_case6()
502 assert(ida_count(&k_ida, i) == 0); in ktest_idr_case6()
506 assert(k_ida.idr.top == NULL); in ktest_idr_case6()
512 assert(ida_alloc(&k_ida, &p_id) == 0); in ktest_idr_case6()
514 assert(p_id == i); in ktest_idr_case6()
518 assert(k_ida.idr.top != NULL); in ktest_idr_case6()
522 assert(k_ida.idr.top == NULL); in ktest_idr_case6()
524 assert(k_ida.free_list == NULL); in ktest_idr_case6()
526 assert(ida_empty(&k_ida)); in ktest_idr_case6()
534 assert(ida_alloc(&k_ida, &p_id) == 0); in ktest_idr_case6()
536 assert(p_id == i); in ktest_idr_case6()
544 assert(ida_count(&k_ida, i) == 0); in ktest_idr_case6()
552 assert(ida_count(&k_ida, i) == 0); in ktest_idr_case6()
556 assert(k_ida.idr.top != NULL); in ktest_idr_case6()
560 assert(k_ida.idr.top == NULL); in ktest_idr_case6()
562 assert(k_ida.free_list == NULL); in ktest_idr_case6()
564 assert(ida_empty(&k_ida)); in ktest_idr_case6()