Lines Matching refs:i
40 for (uint64_t i = 1; i < 64; i++) in ktest_idr_case0() local
42 int id = __lowbit_id(i), chk_id = -1; in ktest_idr_case0()
44 if ((i >> j) & 1) in ktest_idr_case0()
73 for (int i = 0; i < 128; i++) in ktest_idr_case1() local
75 assert(idr_alloc(&k_idr, &a[i], &a[i]) == 0); in ktest_idr_case1()
76 assert(a[i] == i); in ktest_idr_case1()
80 for (int i = 0; i < 128; i++) in ktest_idr_case1() local
82 int *ptr = idr_find(&k_idr, a[i]); in ktest_idr_case1()
83 assert(ptr == &a[i]); in ktest_idr_case1()
85 assert(*ptr == a[i]); in ktest_idr_case1()
89 for (int i = 127; i >= 64; i--) in ktest_idr_case1() local
91 int *id = idr_remove(&k_idr, a[i]); 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()
98 for (int i = 0; i <= 63; i++) in ktest_idr_case1() local
100 int *id = idr_remove(&k_idr, a[i]); 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()
106 for (int i = 0; i < 128; i++) in ktest_idr_case1() local
108 assert(idr_count(&k_idr, i) == 0); in ktest_idr_case1()
112 for (int i = 0; i < 128; i++) in ktest_idr_case1() local
114 assert(idr_alloc(&k_idr, &a[i], &a[i]) == 0); in ktest_idr_case1()
115 assert(a[i] == i); in ktest_idr_case1()
118 for (int i = 0; i < 128; i++) in ktest_idr_case1() local
120 assert(idr_count(&k_idr, i)); in ktest_idr_case1()
124 for (int i = 0; i <= 31; i++) in ktest_idr_case1() local
126 int *id = idr_remove(&k_idr, a[i]); 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()
133 for (int i = 127; i >= 96; i--) in ktest_idr_case1() local
135 int *id = idr_remove(&k_idr, a[i]); 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()
146 for (int i = 0; i < 128; i++) in ktest_idr_case1() local
148 assert(idr_alloc(&k_idr, &a[i], &a[i]) == 0); in ktest_idr_case1()
149 assert(a[i] == i); in ktest_idr_case1()
153 for (int i = 0; i < 128; i++) in ktest_idr_case1() local
155 int *ptr = idr_find(&k_idr, a[i]); in ktest_idr_case1()
156 assert(ptr == &a[i]); in ktest_idr_case1()
157 assert(*ptr == a[i]); in ktest_idr_case1()
161 for (int i = 0; i <= 63; i++) in ktest_idr_case1() local
163 idr_remove(&k_idr, a[i]); in ktest_idr_case1()
164 assert(idr_find(&k_idr, a[i]) == NULL); in ktest_idr_case1()
168 for (int i = 127; i >= 64; i--) in ktest_idr_case1() local
170 idr_remove(&k_idr, a[i]); in ktest_idr_case1()
171 assert(idr_find(&k_idr, a[i]) == NULL); in ktest_idr_case1()
198 for (int i = 0; i < N; i++) in ktest_idr_case2() local
203 assert(tmp == i); in ktest_idr_case2()
206 int *ptr = idr_find(&k_idr, i); in ktest_idr_case2()
209 assert(*ptr == i); in ktest_idr_case2()
213 assert(idr_count(&k_idr, i)); in ktest_idr_case2()
218 for (int i = 0; i < M; i++) in ktest_idr_case2() local
220 int *ptr = idr_find(&k_idr, i); in ktest_idr_case2()
223 idr_remove(&k_idr, i); in ktest_idr_case2()
224 assert(idr_find(&k_idr, i) == NULL); in ktest_idr_case2()
229 for (int i = (N)-1; i >= M; i--) in ktest_idr_case2() local
231 int *ptr = idr_find(&k_idr, i); in ktest_idr_case2()
233 idr_remove(&k_idr, i); in ktest_idr_case2()
234 assert(idr_find(&k_idr, i) == NULL); in ktest_idr_case2()
238 for (int i = 0; i < N; i++) in ktest_idr_case2() local
241 assert(tmp == i); in ktest_idr_case2()
244 int *ptr = idr_find(&k_idr, i); in ktest_idr_case2()
246 assert(*ptr == i); in ktest_idr_case2()
251 for (int i = 0; i < M; i++) in ktest_idr_case2() local
253 assert(idr_replace(&k_idr, NULL, i) == 0); in ktest_idr_case2()
278 for (int i = 0; i < N; i++) in ktest_idr_case3() local
281 assert(tmp == i); in ktest_idr_case3()
283 int *ptr = idr_find(&k_idr, i); in ktest_idr_case3()
285 assert(*ptr == i); in ktest_idr_case3()
289 for (int i = 1; i <= N; i++) in ktest_idr_case3() local
292 int *ptr = idr_find_next_getid(&k_idr, i - 1, &nextid); in ktest_idr_case3()
293 if (likely(i < N)) in ktest_idr_case3()
297 assert(nextid == i); in ktest_idr_case3()
308 for (int i = N / 3, j = 2 * (N / 3), k = 0; i <= j; k++, i++) in ktest_idr_case3() local
310 int *ptr = idr_find(&k_idr, i); in ktest_idr_case3()
313 idr_remove(&k_idr, i); in ktest_idr_case3()
315 assert(idr_find(&k_idr, i) == NULL); in ktest_idr_case3()
321 for (int i = 1; i <= N; i++) in ktest_idr_case3() local
324 int *ptr = idr_find_next_getid(&k_idr, i - 1, &nextid); in ktest_idr_case3()
325 if (likely(i < N)) in ktest_idr_case3()
327 int target = i < N / 3 ? i : max(i, 2 * (N / 3) + 1); in ktest_idr_case3()
361 for (int i = 1; i <= 20; i++) in ktest_idr_case4() local
363 int M = N / i, T = M / 3, b = 2 * T; in ktest_idr_case4()
420 for (int i = 0; i < N; i++) in ktest_idr_case5() local
422 assert(idr_alloc(&k_idr, &a[i], &a[i]) == 0); in ktest_idr_case5()
423 assert(a[i] == i); in ktest_idr_case5()
427 for (int i = 0; i < N; i++) in ktest_idr_case5() local
430 int flags = idr_replace_get_old(&k_idr, &a[(i + 1) % N], i, (void *)&ptr); in ktest_idr_case5()
433 assert(*ptr == i); in ktest_idr_case5()
436 ptr = idr_find(&k_idr, i); in ktest_idr_case5()
438 assert(*ptr == (i + 1) % N); in ktest_idr_case5()
447 for (int i = 0; i < N; i++) in ktest_idr_case5() local
449 assert(idr_alloc(&k_idr, &a[i], &a[i]) == 0); in ktest_idr_case5()
450 assert(a[i] == i); in ktest_idr_case5()
482 for (int i = 0; i < N; i++) in ktest_idr_case6() local
488 assert(p_id == i); in ktest_idr_case6()
492 for (int i = 0; i < N; i++) in ktest_idr_case6() local
494 assert(ida_count(&k_ida, i) == 1); in ktest_idr_case6()
498 for (int i = N - 1; i >= 0; i--) in ktest_idr_case6() local
500 ida_remove(&k_ida, i); in ktest_idr_case6()
502 assert(ida_count(&k_ida, i) == 0); in ktest_idr_case6()
508 for (int i = 0; i < N; i++) in ktest_idr_case6() local
514 assert(p_id == i); in ktest_idr_case6()
530 for (int i = 0; i < N; i++) in ktest_idr_case6() local
536 assert(p_id == i); in ktest_idr_case6()
540 for (int i = 0; i < N / 3; i++) in ktest_idr_case6() local
542 ida_remove(&k_ida, i); in ktest_idr_case6()
544 assert(ida_count(&k_ida, i) == 0); in ktest_idr_case6()
548 for (int i = 2 * N / 3; i < N; i++) in ktest_idr_case6() local
550 ida_remove(&k_ida, i); in ktest_idr_case6()
552 assert(ida_count(&k_ida, i) == 0); in ktest_idr_case6()
584 for (int i = 0; i < sz; ++i) in ktest_test_idr() local
586 kTEST("Testing case %d", i); in ktest_test_idr()
587 kt_idr_func_table[i](i, i + 1); in ktest_test_idr()