• Home
  • Raw
  • Download

Lines Matching refs:e

219 static void AssertEntry(ENTRY* e, const char* expected_key, const char* expected_data) {  in AssertEntry()  argument
220 ASSERT_TRUE(e != nullptr); in AssertEntry()
221 ASSERT_STREQ(expected_key, reinterpret_cast<char*>(e->key)); in AssertEntry()
222 ASSERT_STREQ(expected_data, reinterpret_cast<char*>(e->data)); in AssertEntry()
229 ENTRY* e; in TEST() local
230 e = hsearch(ENTRY{.key = const_cast<char*>("a"), .data = const_cast<char*>("A")}, ENTER); in TEST()
231 AssertEntry(e, "a", "A"); in TEST()
232 e = hsearch(ENTRY{.key = const_cast<char*>("aa"), .data = const_cast<char*>("B")}, ENTER); in TEST()
233 AssertEntry(e, "aa", "B"); in TEST()
234 e = hsearch(ENTRY{.key = const_cast<char*>("aaa"), .data = const_cast<char*>("C")}, ENTER); in TEST()
235 AssertEntry(e, "aaa", "C"); in TEST()
238 e = hsearch(ENTRY{.key = const_cast<char*>("aaaa"), .data = nullptr}, FIND); in TEST()
239 ASSERT_FALSE(e != nullptr); in TEST()
242 e = hsearch(ENTRY{.key = const_cast<char*>("aa"), .data = nullptr}, FIND); in TEST()
243 AssertEntry(e, "aa", "B"); in TEST()
246 e = hsearch(ENTRY{.key = const_cast<char*>("aa"), .data = const_cast<char*>("X")}, ENTER); in TEST()
247 AssertEntry(e, "aa", "B"); in TEST()
248 e->data = const_cast<char*>("X"); in TEST()
251 e = hsearch(ENTRY{.key = const_cast<char*>("aa"), .data = nullptr}, FIND); in TEST()
252 AssertEntry(e, "aa", "X"); in TEST()
254 e = hsearch(ENTRY{.key = const_cast<char*>("a"), .data = nullptr}, FIND); in TEST()
255 AssertEntry(e, "a", "A"); in TEST()
256 e = hsearch(ENTRY{.key = const_cast<char*>("aaa"), .data = nullptr}, FIND); in TEST()
257 AssertEntry(e, "aaa", "C"); in TEST()
270 ENTRY* e; in TEST() local
272 ENTER, &e, &h1)); in TEST()
273 AssertEntry(e, "a", "A"); in TEST()
275 ENTER, &e, &h2)); in TEST()
276 AssertEntry(e, "a", "B"); in TEST()
280 ASSERT_EQ(0, hsearch_r(ENTRY{.key = const_cast<char*>("b"), .data = nullptr}, FIND, &e, &h1)); in TEST()
284 ASSERT_EQ(1, hsearch_r(ENTRY{.key = const_cast<char*>("a"), .data = nullptr}, FIND, &e, &h1)); in TEST()
285 AssertEntry(e, "a", "A"); in TEST()
286 ASSERT_EQ(1, hsearch_r(ENTRY{.key = const_cast<char*>("a"), .data = nullptr}, FIND, &e, &h2)); in TEST()
287 AssertEntry(e, "a", "B"); in TEST()
291 ASSERT_EQ(1, hsearch_r(ENTRY{.key = const_cast<char*>("a"), .data = nullptr}, FIND, &e, &h2)); in TEST()
292 AssertEntry(e, "a", "B"); in TEST()
304 ENTRY e; in TEST() local
305 e.data = e.key = p; in TEST()
306 ASSERT_TRUE(hsearch(e, ENTER) != nullptr); in TEST()
312 ENTRY* e = hsearch(ENTRY{.key = p, .data = nullptr}, FIND); in TEST() local
313 AssertEntry(e, p, p); in TEST()