case_name
case_name
The suffix that all TestCase methods need to have to be called by run()
Used to test that the HashTable class properly stores key value pairs, handles insert, deletes, collisions okay. It should also detect when table is full
assertEqual(mixed $x, mixed $y, string $description = "")
Checks that $x and $y are the same, the result of the test is added to $this->test_case_results
mixed | $x | a first item to compare |
mixed | $y | a second item to compare |
string | $description | information about this test subcase |
assertNotEqual(mixed $x, mixed $y, string $description = "")
Checks that $x and $y are not the same, the result of the test is added to $this->test_case_results
mixed | $x | a first item to compare |
mixed | $y | a second item to compare |
string | $description | information about this test subcase |
reinsertCollisionAndIndexTestCase()
First check that inserting an item twice does not change its index in the table. Then inserts an item which should hash to the same value. So there is a collision which is resolved by linear offset. Check lookup of new item succeeds.Then delete first insert, check lookup of second insert still works. Check delete of second item, reinsert of first item and lookup. Index should change