Lines Matching refs:HashTable
12 #include "mcld/ADT/HashTable.h"
65 typedef HashTable<HashEntryType, PtrHash, EntryFactory<HashEntryType> >
67 HashTableTy* hashTable = new HashTableTy(0);
70 hashTable->insert(pA, exist);
72 EXPECT_FALSE(hashTable->empty());
75 iter = hashTable->find(NULL);
76 EXPECT_TRUE(iter == hashTable->end());
77 delete hashTable;
82 HashTable<HashEntryType, IntHash, EntryFactory<HashEntryType> > hashTable(16);
83 EXPECT_TRUE(17 == hashTable.numOfBuckets());
84 EXPECT_TRUE(hashTable.empty());
85 EXPECT_TRUE(0 == hashTable.numOfEntries());
90 typedef HashTable<HashEntryType, IntHash, EntryFactory<HashEntryType> >
92 HashTableTy* hashTable = new HashTableTy(22);
96 HashTableTy::entry_type* val = hashTable->insert(key, exist);
98 EXPECT_FALSE(hashTable->empty());
101 HashTableTy::iterator entry = hashTable->find(key);
103 delete hashTable;
108 typedef HashTable<HashEntryType, IntHash, EntryFactory<HashEntryType> >
110 HashTableTy* hashTable = new HashTableTy(22);
115 entry = hashTable->insert(key, exist);
116 EXPECT_FALSE(hashTable->empty());
123 EXPECT_FALSE(hashTable->empty());
124 EXPECT_TRUE(100 == hashTable->numOfEntries());
125 EXPECT_TRUE(197 == hashTable->numOfBuckets());
126 delete hashTable;
131 typedef HashTable<HashEntryType, IntHash, EntryFactory<HashEntryType> >
133 HashTableTy* hashTable = new HashTableTy(0);
137 hashTable->insert(key, exist);
139 EXPECT_FALSE(hashTable->empty());
144 count = hashTable->erase(key);
146 iter = hashTable->find(key);
147 EXPECT_TRUE(iter == hashTable->end());
150 EXPECT_TRUE(hashTable->empty());
151 delete hashTable;
156 typedef HashTable<HashEntryType, IntHash, EntryFactory<HashEntryType> >
158 HashTableTy* hashTable = new HashTableTy(22);
162 hashTable->insert(key, exist);
165 hashTable->clear();
169 iter = hashTable->find(key);
170 EXPECT_TRUE(iter == hashTable->end());
173 EXPECT_TRUE(hashTable->empty());
174 delete hashTable;
179 typedef HashTable<HashEntryType, IntMod3Hash, EntryFactory<HashEntryType> >
181 HashTableTy* hashTable = new HashTableTy();
185 hashTable->insert(key, exist);
187 EXPECT_FALSE(hashTable->empty());
192 count = hashTable->erase(key);
194 iter = hashTable->find(key);
195 EXPECT_TRUE(iter == hashTable->end());
197 EXPECT_TRUE(80 == hashTable->numOfEntries());
200 iter = hashTable->find(key);
201 EXPECT_TRUE(iter != hashTable->end());
205 hashTable->insert(key, exist);
207 EXPECT_TRUE(100 == hashTable->numOfEntries());
208 EXPECT_TRUE(197 == hashTable->numOfBuckets());
210 delete hashTable;
215 typedef HashTable<HashEntryType, IntHash, EntryFactory<HashEntryType> >
217 HashTableTy* hashTable = new HashTableTy(0);
222 entry = hashTable->insert(key, exist);
228 iter = hashTable->find(key);
232 delete hashTable;
237 typedef HashTable<HashEntryType, IntHash, EntryFactory<HashEntryType> >
239 HashTableTy* hashTable = new HashTableTy(0);
244 entry = hashTable->insert(key, exist);
248 HashTableTy::iterator iter, iEnd = hashTable->end();
250 for (iter = hashTable->begin(); iter != iEnd; ++iter) {
255 delete hashTable;
260 typedef HashTable<HashEntryType, IntHash, EntryFactory<HashEntryType> >
262 HashTableTy* hashTable = new HashTableTy();
267 entry = hashTable->insert(key * 37, exist);
272 HashTableTy::chain_iterator iter, iEnd = hashTable->end(key * 37);
273 for (iter = hashTable->begin(key * 37); iter != iEnd; ++iter) {
279 delete hashTable;
288 typedef HashTable<HashEntryType, FixHash, EntryFactory<HashEntryType> >
290 HashTableTy* hashTable = new HashTableTy();
295 entry = hashTable->insert(key, exist);
299 ASSERT_TRUE(16 == hashTable->numOfEntries());
300 ASSERT_TRUE(37 == hashTable->numOfBuckets());
304 HashTableTy::chain_iterator iter, iEnd = hashTable->end(key);
305 for (iter = hashTable->begin(key); iter != iEnd; ++iter) {
309 delete hashTable;