Lines Matching defs:table
1 //===-- Unittests for table -----------------------------------------------===//
11 #include "src/__support/HashTable/table.h"
23 HashTable *table = HashTable::allocate(i, 1);
24 ASSERT_NE(table, static_cast<HashTable *>(nullptr));
26 ASSERT_EQ(table->find(key), static_cast<ENTRY *>(nullptr));
28 HashTable::deallocate(table);
40 HashTable *table = HashTable::allocate(0, 0x7f7f7f7f7f7f7f7f);
41 ASSERT_NE(table, static_cast<HashTable *>(nullptr));
53 HashTable::insert(table, {reinterpret_cast<char *>(keys[i].bytes),
58 for (const ENTRY &e : *table) {
67 HashTable::deallocate(table);
94 HashTable *table =
96 ASSERT_NE(table, static_cast<HashTable *>(nullptr));
100 ASSERT_NE(HashTable::insert(table, {keys[i].bytes, keys[i].bytes}),
104 // One more insert should grow the table successfully. We test the value
107 ASSERT_EQ(HashTable::insert(table, {keys[CAP].bytes, keys[CAP].bytes})->data,
111 ASSERT_EQ(strcmp(table->find(keys[i].bytes)->key, keys[i].bytes), 0);
114 ASSERT_EQ(table->find(keys[i].bytes), static_cast<ENTRY *>(nullptr));
120 HashTable::insert(table, {keys[i].bytes, reinterpret_cast<void *>(i)}),
124 ASSERT_EQ(table->find(keys[i].bytes)->data,
128 HashTable::deallocate(table);