Lines Matching refs:entries
18 init_entries(ring_t *entries) { in init_entries() argument
22 qr_new(&entries[i], link); in init_entries()
23 entries[i].id = 'a' + i; in init_entries()
28 test_independent_entries(ring_t *entries) { in test_independent_entries() argument
34 qr_foreach(t, &entries[i], link) { in test_independent_entries()
43 qr_reverse_foreach(t, &entries[i], link) { in test_independent_entries()
51 t = qr_next(&entries[i], link); in test_independent_entries()
52 assert_ptr_eq(t, &entries[i], in test_independent_entries()
57 t = qr_prev(&entries[i], link); in test_independent_entries()
58 assert_ptr_eq(t, &entries[i], in test_independent_entries()
65 ring_t entries[NENTRIES]; in TEST_BEGIN() local
67 init_entries(entries); in TEST_BEGIN()
68 test_independent_entries(entries); in TEST_BEGIN()
73 test_entries_ring(ring_t *entries) { in test_entries_ring() argument
79 qr_foreach(t, &entries[i], link) { in test_entries_ring()
80 assert_c_eq(t->id, entries[(i+j) % NENTRIES].id, in test_entries_ring()
87 qr_reverse_foreach(t, &entries[i], link) { in test_entries_ring()
88 assert_c_eq(t->id, entries[(NENTRIES+i-j-1) % in test_entries_ring()
94 t = qr_next(&entries[i], link); in test_entries_ring()
95 assert_c_eq(t->id, entries[(i+1) % NENTRIES].id, in test_entries_ring()
99 t = qr_prev(&entries[i], link); in test_entries_ring()
100 assert_c_eq(t->id, entries[(NENTRIES+i-1) % NENTRIES].id, in test_entries_ring()
106 ring_t entries[NENTRIES]; in TEST_BEGIN() local
109 init_entries(entries); in TEST_BEGIN()
111 qr_after_insert(&entries[i - 1], &entries[i], link); in TEST_BEGIN()
113 test_entries_ring(entries); in TEST_BEGIN()
118 ring_t entries[NENTRIES]; in TEST_BEGIN() local
122 init_entries(entries); in TEST_BEGIN()
124 qr_after_insert(&entries[i - 1], &entries[i], link); in TEST_BEGIN()
129 qr_foreach(t, &entries[i], link) { in TEST_BEGIN()
130 assert_c_eq(t->id, entries[i+j].id, in TEST_BEGIN()
135 qr_reverse_foreach(t, &entries[i], link) { in TEST_BEGIN()
136 assert_c_eq(t->id, entries[NENTRIES - 1 - j].id, in TEST_BEGIN()
140 qr_remove(&entries[i], link); in TEST_BEGIN()
142 test_independent_entries(entries); in TEST_BEGIN()
147 ring_t entries[NENTRIES]; in TEST_BEGIN() local
151 init_entries(entries); in TEST_BEGIN()
153 qr_before_insert(&entries[i - 1], &entries[i], link); in TEST_BEGIN()
157 qr_foreach(t, &entries[i], link) { in TEST_BEGIN()
158 assert_c_eq(t->id, entries[(NENTRIES+i-j) % in TEST_BEGIN()
165 qr_reverse_foreach(t, &entries[i], link) { in TEST_BEGIN()
166 assert_c_eq(t->id, entries[(i+j+1) % NENTRIES].id, in TEST_BEGIN()
172 t = qr_next(&entries[i], link); in TEST_BEGIN()
173 assert_c_eq(t->id, entries[(NENTRIES+i-1) % NENTRIES].id, in TEST_BEGIN()
177 t = qr_prev(&entries[i], link); in TEST_BEGIN()
178 assert_c_eq(t->id, entries[(i+1) % NENTRIES].id, in TEST_BEGIN()
185 test_split_entries(ring_t *entries) { in test_split_entries() argument
191 qr_foreach(t, &entries[i], link) { in test_split_entries()
194 entries[(i+j) % SPLIT_INDEX].id, in test_split_entries()
197 assert_c_eq(t->id, entries[(i+j-SPLIT_INDEX) % in test_split_entries()
207 ring_t entries[NENTRIES]; in TEST_BEGIN() local
210 init_entries(entries); in TEST_BEGIN()
212 qr_after_insert(&entries[i - 1], &entries[i], link); in TEST_BEGIN()
215 qr_split(&entries[0], &entries[SPLIT_INDEX], ring_t, link); in TEST_BEGIN()
216 test_split_entries(entries); in TEST_BEGIN()
218 qr_meld(&entries[0], &entries[SPLIT_INDEX], ring_t, link); in TEST_BEGIN()
219 test_entries_ring(entries); in TEST_BEGIN()
221 qr_meld(&entries[0], &entries[SPLIT_INDEX], ring_t, link); in TEST_BEGIN()
222 test_split_entries(entries); in TEST_BEGIN()
224 qr_split(&entries[0], &entries[SPLIT_INDEX], ring_t, link); in TEST_BEGIN()
225 test_entries_ring(entries); in TEST_BEGIN()
227 qr_split(&entries[0], &entries[0], ring_t, link); in TEST_BEGIN()
228 test_entries_ring(entries); in TEST_BEGIN()
230 qr_meld(&entries[0], &entries[0], ring_t, link); in TEST_BEGIN()
231 test_entries_ring(entries); in TEST_BEGIN()