2
2
3
3
import static org .junit .Assert .*;
4
4
5
- import com .williamfiset .algorithms .datastructures .hashtable .HashTableSeperateChaining ;
5
+ import com .williamfiset .algorithms .datastructures .hashtable .HashTableSeparateChaining ;
6
6
import java .util .*;
7
7
import org .junit .*;
8
8
9
- public class HashTableSeperateChainingTest {
9
+ public class HashTableSeparateChainingTest {
10
10
11
11
// You can set the hash value of this object to be whatever you want
12
12
// This makes it great for testing special cases.
@@ -39,11 +39,11 @@ public boolean equals(Object o) {
39
39
MAX_RAND_NUM = randInt (1 , 350 );
40
40
}
41
41
42
- HashTableSeperateChaining <Integer , Integer > map ;
42
+ HashTableSeparateChaining <Integer , Integer > map ;
43
43
44
44
@ Before
45
45
public void setup () {
46
- map = new HashTableSeperateChaining <>();
46
+ map = new HashTableSeparateChaining <>();
47
47
}
48
48
49
49
@ Test (expected = IllegalArgumentException .class )
@@ -53,22 +53,22 @@ public void testNullKey() {
53
53
54
54
@ Test (expected = IllegalArgumentException .class )
55
55
public void testIllegalCreation1 () {
56
- new HashTableSeperateChaining <>(-3 , 0.5 );
56
+ new HashTableSeparateChaining <>(-3 , 0.5 );
57
57
}
58
58
59
59
@ Test (expected = IllegalArgumentException .class )
60
60
public void testIllegalCreation2 () {
61
- new HashTableSeperateChaining <>(5 , Double .POSITIVE_INFINITY );
61
+ new HashTableSeparateChaining <>(5 , Double .POSITIVE_INFINITY );
62
62
}
63
63
64
64
@ Test (expected = IllegalArgumentException .class )
65
65
public void testIllegalCreation3 () {
66
- new HashTableSeperateChaining <>(6 , -0.5 );
66
+ new HashTableSeparateChaining <>(6 , -0.5 );
67
67
}
68
68
69
69
@ Test
70
70
public void testLegalCreation () {
71
- new HashTableSeperateChaining <>(6 , 0.9 );
71
+ new HashTableSeparateChaining <>(6 , 0.9 );
72
72
}
73
73
74
74
@ Test
@@ -95,7 +95,7 @@ public void testIterator() {
95
95
map2 .clear ();
96
96
assertTrue (map .isEmpty ());
97
97
98
- map = new HashTableSeperateChaining <>();
98
+ map = new HashTableSeparateChaining <>();
99
99
100
100
List <Integer > rand_nums = genRandList (MAX_SIZE );
101
101
for (Integer key : rand_nums ) assertEquals (map .add (key , key ), map2 .put (key , key ));
@@ -140,11 +140,11 @@ public void testConcurrentModificationException2() {
140
140
@ Test
141
141
public void randomRemove () {
142
142
143
- HashTableSeperateChaining <Integer , Integer > map ;
143
+ HashTableSeparateChaining <Integer , Integer > map ;
144
144
145
145
for (int loop = 0 ; loop < LOOPS ; loop ++) {
146
146
147
- map = new HashTableSeperateChaining <>();
147
+ map = new HashTableSeparateChaining <>();
148
148
map .clear ();
149
149
150
150
// Add some random values
@@ -167,7 +167,7 @@ public void randomRemove() {
167
167
@ Test
168
168
public void removeTest () {
169
169
170
- HashTableSeperateChaining <Integer , Integer > map = new HashTableSeperateChaining <>(7 );
170
+ HashTableSeparateChaining <Integer , Integer > map = new HashTableSeparateChaining <>(7 );
171
171
172
172
// Add three elements
173
173
map .put (11 , 0 );
@@ -193,7 +193,7 @@ public void removeTest() {
193
193
@ Test
194
194
public void removeTestComplex1 () {
195
195
196
- HashTableSeperateChaining <HashObject , Integer > map = new HashTableSeperateChaining <>();
196
+ HashTableSeparateChaining <HashObject , Integer > map = new HashTableSeparateChaining <>();
197
197
198
198
HashObject o1 = new HashObject (88 , 1 );
199
199
HashObject o2 = new HashObject (88 , 2 );
@@ -224,7 +224,7 @@ public void testRandomMapOperations() {
224
224
jmap .clear ();
225
225
assertEquals (jmap .size (), map .size ());
226
226
227
- map = new HashTableSeperateChaining <>();
227
+ map = new HashTableSeparateChaining <>();
228
228
229
229
final double probability1 = Math .random ();
230
230
final double probability2 = Math .random ();
@@ -255,7 +255,7 @@ public void testRandomMapOperations() {
255
255
@ Test
256
256
public void randomIteratorTests () {
257
257
258
- HashTableSeperateChaining <Integer , LinkedList <Integer >> m = new HashTableSeperateChaining <>();
258
+ HashTableSeparateChaining <Integer , LinkedList <Integer >> m = new HashTableSeparateChaining <>();
259
259
HashMap <Integer , LinkedList <Integer >> hm = new HashMap <>();
260
260
261
261
for (int loop = 0 ; loop < LOOPS ; loop ++) {
@@ -265,7 +265,7 @@ public void randomIteratorTests() {
265
265
assertEquals (m .size (), hm .size ());
266
266
267
267
int sz = randInt (1 , MAX_SIZE );
268
- m = new HashTableSeperateChaining <>(sz );
268
+ m = new HashTableSeparateChaining <>(sz );
269
269
hm = new HashMap <>(sz );
270
270
271
271
final double probability = Math .random ();
0 commit comments