Lines Matching refs:entries

16 init_entries(ring_t *entries)  in init_entries()  argument
21 qr_new(&entries[i], link); in init_entries()
22 entries[i].id = 'a' + i; in init_entries()
27 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()
66 ring_t entries[NENTRIES]; in TEST_BEGIN() local
68 init_entries(entries); in TEST_BEGIN()
69 test_independent_entries(entries); in TEST_BEGIN()
74 test_entries_ring(ring_t *entries) in test_entries_ring() argument
81 qr_foreach(t, &entries[i], link) { in test_entries_ring()
82 assert_c_eq(t->id, entries[(i+j) % NENTRIES].id, in test_entries_ring()
89 qr_reverse_foreach(t, &entries[i], link) { in test_entries_ring()
90 assert_c_eq(t->id, entries[(NENTRIES+i-j-1) % in test_entries_ring()
96 t = qr_next(&entries[i], link); in test_entries_ring()
97 assert_c_eq(t->id, entries[(i+1) % NENTRIES].id, in test_entries_ring()
101 t = qr_prev(&entries[i], link); in test_entries_ring()
102 assert_c_eq(t->id, entries[(NENTRIES+i-1) % NENTRIES].id, in test_entries_ring()
109 ring_t entries[NENTRIES]; in TEST_BEGIN() local
112 init_entries(entries); in TEST_BEGIN()
114 qr_after_insert(&entries[i - 1], &entries[i], link); in TEST_BEGIN()
115 test_entries_ring(entries); in TEST_BEGIN()
121 ring_t entries[NENTRIES]; in TEST_BEGIN() local
125 init_entries(entries); in TEST_BEGIN()
127 qr_after_insert(&entries[i - 1], &entries[i], link); in TEST_BEGIN()
131 qr_foreach(t, &entries[i], link) { in TEST_BEGIN()
132 assert_c_eq(t->id, entries[i+j].id, in TEST_BEGIN()
137 qr_reverse_foreach(t, &entries[i], link) { in TEST_BEGIN()
138 assert_c_eq(t->id, entries[NENTRIES - 1 - j].id, in TEST_BEGIN()
142 qr_remove(&entries[i], link); in TEST_BEGIN()
144 test_independent_entries(entries); in TEST_BEGIN()
150 ring_t entries[NENTRIES]; in TEST_BEGIN() local
154 init_entries(entries); in TEST_BEGIN()
156 qr_before_insert(&entries[i - 1], &entries[i], link); in TEST_BEGIN()
159 qr_foreach(t, &entries[i], link) { in TEST_BEGIN()
160 assert_c_eq(t->id, entries[(NENTRIES+i-j) % in TEST_BEGIN()
167 qr_reverse_foreach(t, &entries[i], link) { in TEST_BEGIN()
168 assert_c_eq(t->id, entries[(i+j+1) % NENTRIES].id, in TEST_BEGIN()
174 t = qr_next(&entries[i], link); in TEST_BEGIN()
175 assert_c_eq(t->id, entries[(NENTRIES+i-1) % NENTRIES].id, in TEST_BEGIN()
179 t = qr_prev(&entries[i], link); in TEST_BEGIN()
180 assert_c_eq(t->id, entries[(i+1) % NENTRIES].id, in TEST_BEGIN()
187 test_split_entries(ring_t *entries) in test_split_entries() argument
194 qr_foreach(t, &entries[i], link) { in test_split_entries()
197 entries[(i+j) % SPLIT_INDEX].id, in test_split_entries()
200 assert_c_eq(t->id, entries[(i+j-SPLIT_INDEX) % in test_split_entries()
211 ring_t entries[NENTRIES]; in TEST_BEGIN() local
214 init_entries(entries); in TEST_BEGIN()
216 qr_after_insert(&entries[i - 1], &entries[i], link); in TEST_BEGIN()
218 qr_split(&entries[0], &entries[SPLIT_INDEX], link); in TEST_BEGIN()
219 test_split_entries(entries); in TEST_BEGIN()
221 qr_meld(&entries[0], &entries[SPLIT_INDEX], link); in TEST_BEGIN()
222 test_entries_ring(entries); in TEST_BEGIN()
224 qr_meld(&entries[0], &entries[SPLIT_INDEX], link); in TEST_BEGIN()
225 test_split_entries(entries); in TEST_BEGIN()
227 qr_split(&entries[0], &entries[SPLIT_INDEX], link); in TEST_BEGIN()
228 test_entries_ring(entries); in TEST_BEGIN()
230 qr_split(&entries[0], &entries[0], link); in TEST_BEGIN()
231 test_entries_ring(entries); in TEST_BEGIN()
233 qr_meld(&entries[0], &entries[0], link); in TEST_BEGIN()
234 test_entries_ring(entries); in TEST_BEGIN()