• Home
  • Raw
  • Download

Lines Matching refs:hash

45     Hash hash;  in DEF_TEST()  local
46 ASSERT(hash.capacity() == 0); in DEF_TEST()
48 hash.add(&a); in DEF_TEST()
49 ASSERT(hash.capacity() == 4); in DEF_TEST()
51 hash.add(&b); in DEF_TEST()
52 ASSERT(hash.capacity() == 4); in DEF_TEST()
54 hash.add(&c); in DEF_TEST()
55 ASSERT(hash.capacity() == 4); in DEF_TEST()
57 hash.add(&d); in DEF_TEST()
58 ASSERT(hash.capacity() == 8); in DEF_TEST()
60 hash.add(&e); in DEF_TEST()
61 ASSERT(hash.capacity() == 8); in DEF_TEST()
63 ASSERT(hash.count() == 5); in DEF_TEST()
67 Hash hash; in DEF_TEST() local
71 ASSERT(hash.count() == 0); in DEF_TEST()
72 hash.add(&a); in DEF_TEST()
73 ASSERT(hash.count() == 1); in DEF_TEST()
74 hash.add(&b); in DEF_TEST()
75 ASSERT(hash.count() == 2); in DEF_TEST()
79 Hash hash; in DEF_TEST() local
86 ASSERT(hash.countCollisions(1) == 0); in DEF_TEST()
87 ASSERT(hash.countCollisions(5) == 0); in DEF_TEST()
88 ASSERT(hash.countCollisions(9) == 0); in DEF_TEST()
91 hash.add(&a); in DEF_TEST()
92 ASSERT(hash.countCollisions(1) == 0); in DEF_TEST()
93 ASSERT(hash.countCollisions(5) == 1); in DEF_TEST()
94 ASSERT(hash.countCollisions(9) == 1); in DEF_TEST()
97 hash.add(&b); in DEF_TEST()
98 ASSERT(hash.countCollisions(1) == 0); in DEF_TEST()
99 ASSERT(hash.countCollisions(5) == 1); in DEF_TEST()
100 ASSERT(hash.countCollisions(9) == 2); in DEF_TEST()
103 ASSERT(hash.find(1) != NULL); in DEF_TEST()
104 ASSERT(hash.find(1)->value == 2.0); in DEF_TEST()
105 ASSERT(hash.find(5) != NULL); in DEF_TEST()
106 ASSERT(hash.find(5)->value == 3.0); in DEF_TEST()
109 ASSERT(hash.find(2) == NULL); in DEF_TEST()
110 ASSERT(hash.find(9) == NULL); in DEF_TEST()
114 Hash hash; in DEF_TEST() local
121 hash.add(&a); in DEF_TEST()
122 hash.add(&b); in DEF_TEST()
123 hash.remove(1); in DEF_TEST()
126 ASSERT(hash.find(1) == NULL); in DEF_TEST()
127 ASSERT(hash.find(5) != NULL); in DEF_TEST()
128 ASSERT(hash.find(5)->value == 3.0); in DEF_TEST()
131 ASSERT(hash.countCollisions(9) == 0); in DEF_TEST()
132 hash.add(&c); in DEF_TEST()
133 ASSERT(hash.find(9) != NULL); in DEF_TEST()
134 ASSERT(hash.find(9)->value == 4.0); in DEF_TEST()
135 ASSERT(hash.find(5) != NULL); in DEF_TEST()
136 ASSERT(hash.find(5)->value == 3.0); in DEF_TEST()
140 Hash hash; in DEF_TEST() local
144 for (Hash::Iter iter(&hash); !iter.done(); ++iter) { in DEF_TEST()
154 hash.add(&a); in DEF_TEST()
155 hash.add(&b); in DEF_TEST()
156 hash.add(&c); in DEF_TEST()
161 for (Hash::Iter iter(&hash); !iter.done(); ++iter) { in DEF_TEST()
164 ASSERT(hash.find(key) != NULL); in DEF_TEST()
173 hash.remove(1); in DEF_TEST()
176 for (Hash::Iter iter(&hash); !iter.done(); ++iter) { in DEF_TEST()
180 ASSERT(hash.find(key) != NULL); in DEF_TEST()