Lines Matching refs:hashTable
12 #include "mcld/ADT/HashTable.h"
81 typedef HashTable<HashEntryType, PtrHash, EntryFactory<HashEntryType> > HashTableTy;
82 HashTableTy *hashTable = new HashTableTy(0);
87 entry = hashTable->insert(pA, exist);
89 EXPECT_FALSE(hashTable->empty());
92 iter = hashTable->find(NULL);
93 EXPECT_TRUE(iter==hashTable->end());
94 delete hashTable;
99 HashTable<HashEntryType, IntHash, EntryFactory<HashEntryType> > hashTable(16);
100 EXPECT_TRUE(17 == hashTable.numOfBuckets());
101 EXPECT_TRUE(hashTable.empty());
102 EXPECT_TRUE(0 == hashTable.numOfEntries());
107 typedef HashTable<HashEntryType, IntHash, EntryFactory<HashEntryType> > HashTableTy;
108 HashTableTy *hashTable = new HashTableTy(22);
112 HashTableTy::entry_type* val = hashTable->insert(key, exist);
114 EXPECT_FALSE(hashTable->empty());
117 HashTableTy::iterator entry = hashTable->find(key);
119 delete hashTable;
124 typedef HashTable<HashEntryType, IntHash, EntryFactory<HashEntryType> > HashTableTy;
125 HashTableTy *hashTable = new HashTableTy(22);
130 entry = hashTable->insert(key, exist);
131 EXPECT_FALSE(hashTable->empty());
138 EXPECT_FALSE(hashTable->empty());
139 EXPECT_TRUE(100 == hashTable->numOfEntries());
140 EXPECT_TRUE(197 == hashTable->numOfBuckets());
141 delete hashTable;
146 typedef HashTable<HashEntryType, IntHash, EntryFactory<HashEntryType> > HashTableTy;
147 HashTableTy *hashTable = new HashTableTy(0);
152 entry = hashTable->insert(key, exist);
154 EXPECT_FALSE(hashTable->empty());
159 count = hashTable->erase(key);
161 iter = hashTable->find(key);
162 EXPECT_TRUE(iter == hashTable->end());
165 EXPECT_TRUE(hashTable->empty());
166 delete hashTable;
171 typedef HashTable<HashEntryType, IntHash, EntryFactory<HashEntryType> > HashTableTy;
172 HashTableTy *hashTable = new HashTableTy(22);
177 entry = hashTable->insert(key, exist);
180 hashTable->clear();
184 iter = hashTable->find(key);
185 EXPECT_TRUE(iter == hashTable->end());
188 EXPECT_TRUE(hashTable->empty());
189 delete hashTable;
194 typedef HashTable<HashEntryType, IntMod3Hash, EntryFactory<HashEntryType> > HashTableTy;
195 HashTableTy *hashTable = new HashTableTy();
200 entry = hashTable->insert(key, exist);
202 EXPECT_FALSE(hashTable->empty());
207 count = hashTable->erase(key);
209 iter = hashTable->find(key);
210 EXPECT_TRUE(iter == hashTable->end());
212 EXPECT_TRUE(80 == hashTable->numOfEntries());
215 iter = hashTable->find(key);
216 EXPECT_TRUE(iter != hashTable->end());
220 entry = hashTable->insert(key, exist);
222 EXPECT_TRUE(100 == hashTable->numOfEntries());
223 EXPECT_TRUE(197 == hashTable->numOfBuckets());
225 delete hashTable;
230 typedef HashTable<HashEntryType, IntHash, EntryFactory<HashEntryType> > HashTableTy;
231 HashTableTy *hashTable = new HashTableTy(0);
236 entry = hashTable->insert(key, exist);
242 iter = hashTable->find(key);
246 delete hashTable;
251 typedef HashTable<HashEntryType, IntHash, EntryFactory<HashEntryType> > HashTableTy;
252 HashTableTy *hashTable = new HashTableTy(0);
257 entry = hashTable->insert(key, exist);
261 HashTableTy::iterator iter, iEnd = hashTable->end();
263 for (iter = hashTable->begin(); iter != iEnd; ++iter) {
268 delete hashTable;
274 typedef HashTable<HashEntryType, IntHash, EntryFactory<HashEntryType> > HashTableTy;
275 HashTableTy *hashTable = new HashTableTy();
280 entry = hashTable->insert(key*37, exist);
285 HashTableTy::chain_iterator iter, iEnd = hashTable->end(key*37);
286 for (iter = hashTable->begin(key*37); iter != iEnd; ++iter) {
292 delete hashTable;
305 typedef HashTable<HashEntryType, FixHash, EntryFactory<HashEntryType> > HashTableTy;
306 HashTableTy *hashTable = new HashTableTy();
311 entry = hashTable->insert(key, exist);
315 ASSERT_TRUE(16 == hashTable->numOfEntries());
316 ASSERT_TRUE(37 == hashTable->numOfBuckets());
320 HashTableTy::chain_iterator iter, iEnd = hashTable->end(key);
321 for (iter = hashTable->begin(key); iter != iEnd; ++iter) {
325 delete hashTable;