Lines Matching +full:3 +full:x
23 DECLARE_HASHTABLE(hash2, 3); in hashtable_test_hash_init()
67 struct hashtable_test_entry a, b, *x; in hashtable_test_hash_add() local
69 DEFINE_HASHTABLE(hash, 3); in hashtable_test_hash_add()
80 hash_for_each(hash, bkt, x, node) { in hashtable_test_hash_add()
81 x->visited++; in hashtable_test_hash_add()
82 if (x->key == a.key) in hashtable_test_hash_add()
83 KUNIT_EXPECT_EQ(test, x->data, 13); in hashtable_test_hash_add()
84 else if (x->key == b.key) in hashtable_test_hash_add()
85 KUNIT_EXPECT_EQ(test, x->data, 10); in hashtable_test_hash_add()
97 struct hashtable_test_entry a, b, *x; in hashtable_test_hash_del() local
109 hash_for_each_possible(hash, x, node, b.key) { in hashtable_test_hash_del()
110 x->visited++; in hashtable_test_hash_del()
111 KUNIT_EXPECT_NE(test, x->key, b.key); in hashtable_test_hash_del()
125 struct hashtable_test_entry entries[3]; in hashtable_test_hash_for_each()
126 struct hashtable_test_entry *x; in hashtable_test_hash_for_each() local
128 DEFINE_HASHTABLE(hash, 3); in hashtable_test_hash_for_each()
131 for (i = 0; i < 3; i++) { in hashtable_test_hash_for_each()
139 hash_for_each(hash, bkt, x, node) { in hashtable_test_hash_for_each()
140 x->visited += 1; in hashtable_test_hash_for_each()
141 KUNIT_ASSERT_GE_MSG(test, x->key, 0, "Unexpected key in hashtable."); in hashtable_test_hash_for_each()
142 KUNIT_ASSERT_LT_MSG(test, x->key, 3, "Unexpected key in hashtable."); in hashtable_test_hash_for_each()
147 KUNIT_EXPECT_EQ(test, count, 3); in hashtable_test_hash_for_each()
148 for (j = 0; j < 3; j++) in hashtable_test_hash_for_each()
154 struct hashtable_test_entry entries[3]; in hashtable_test_hash_for_each_safe()
155 struct hashtable_test_entry *x; in hashtable_test_hash_for_each_safe() local
158 DEFINE_HASHTABLE(hash, 3); in hashtable_test_hash_for_each_safe()
161 for (i = 0; i < 3; i++) { in hashtable_test_hash_for_each_safe()
169 hash_for_each_safe(hash, bkt, tmp, x, node) { in hashtable_test_hash_for_each_safe()
170 x->visited += 1; in hashtable_test_hash_for_each_safe()
171 KUNIT_ASSERT_GE_MSG(test, x->key, 0, "Unexpected key in hashtable."); in hashtable_test_hash_for_each_safe()
172 KUNIT_ASSERT_LT_MSG(test, x->key, 3, "Unexpected key in hashtable."); in hashtable_test_hash_for_each_safe()
176 hash_del(&x->node); in hashtable_test_hash_for_each_safe()
180 KUNIT_EXPECT_EQ(test, count, 3); in hashtable_test_hash_for_each_safe()
181 for (j = 0; j < 3; j++) in hashtable_test_hash_for_each_safe()
188 struct hashtable_test_entry *x, *y; in hashtable_test_hash_for_each_possible() local
194 for (i = 0; i < 3; i++) { in hashtable_test_hash_for_each_possible()
202 entries[3].key = 1; in hashtable_test_hash_for_each_possible()
203 entries[3].data = 3; in hashtable_test_hash_for_each_possible()
204 entries[3].visited = 0; in hashtable_test_hash_for_each_possible()
205 hash_add(hash, &entries[3].node, entries[3].key); in hashtable_test_hash_for_each_possible()
208 hash_for_each_possible(hash, x, node, 0) { in hashtable_test_hash_for_each_possible()
209 x->visited += 1; in hashtable_test_hash_for_each_possible()
210 KUNIT_ASSERT_GE_MSG(test, x->data, 0, "Unexpected data in hashtable."); in hashtable_test_hash_for_each_possible()
211 KUNIT_ASSERT_LT_MSG(test, x->data, 4, "Unexpected data in hashtable."); in hashtable_test_hash_for_each_possible()
216 for (j = 0; j < 3; j++) in hashtable_test_hash_for_each_possible()
232 KUNIT_EXPECT_EQ(test, entries[3].visited, 1); in hashtable_test_hash_for_each_possible()
234 KUNIT_EXPECT_EQ(test, count, 3); in hashtable_test_hash_for_each_possible()
235 KUNIT_EXPECT_EQ(test, entries[3].visited, 0); in hashtable_test_hash_for_each_possible()
242 struct hashtable_test_entry *x, *y; in hashtable_test_hash_for_each_possible_safe() local
249 for (i = 0; i < 3; i++) { in hashtable_test_hash_for_each_possible_safe()
257 entries[3].key = 1; in hashtable_test_hash_for_each_possible_safe()
258 entries[3].data = 3; in hashtable_test_hash_for_each_possible_safe()
259 entries[3].visited = 0; in hashtable_test_hash_for_each_possible_safe()
260 hash_add(hash, &entries[3].node, entries[3].key); in hashtable_test_hash_for_each_possible_safe()
263 hash_for_each_possible_safe(hash, x, tmp, node, 0) { in hashtable_test_hash_for_each_possible_safe()
264 x->visited += 1; in hashtable_test_hash_for_each_possible_safe()
265 KUNIT_ASSERT_GE_MSG(test, x->data, 0, "Unexpected data in hashtable."); in hashtable_test_hash_for_each_possible_safe()
266 KUNIT_ASSERT_LT_MSG(test, x->data, 4, "Unexpected data in hashtable."); in hashtable_test_hash_for_each_possible_safe()
270 hash_del(&x->node); in hashtable_test_hash_for_each_possible_safe()
274 for (j = 0; j < 3; j++) in hashtable_test_hash_for_each_possible_safe()
290 KUNIT_EXPECT_EQ(test, entries[3].visited, 1); in hashtable_test_hash_for_each_possible_safe()
292 KUNIT_EXPECT_EQ(test, count, 3); in hashtable_test_hash_for_each_possible_safe()
293 KUNIT_EXPECT_EQ(test, entries[3].visited, 0); in hashtable_test_hash_for_each_possible_safe()