case_name
case_name
The suffix that all TestCase methods need to have to be called by run()
Yioop B-tree Unit Class
Used to test insert, lookup, and deletion of key-value pairs on the B-Tree.
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 |
emptyBTreeNoSaveTestCase()
Test to check that an empty B-Tree is not saved to disk.
A B-Tree object is created. The test directory is checked for B-Tree files. A value is inserted, the test directory is again checked. The inserted value is removed and the test directory is again checked for B-Tree files.
deleteFromLeafNodeTestCase()
Test to check that a key is deleted successfully from a leaf node Key-value pairs are inserted in the B-Tree. key-value pairs present in leaf nodes are then deleted from the B-Tree. The deleted key-value pairs are looked up to check if they were removed successfully.
deleteFromInternalNodeTestCase()
Test to check that a key is deleted successfully from an internal node Key-value pairs are first added to the B-Tree. Key-value pairs are then deleted successively from the root node. The deleted key-value pairs are then looked up to check if they were successfully
deleteLookupTestCase()
Function to check that keys are successfully deleted from the B-Tree Random key-value pairs are firs inserted in the B-Tree. From the inserted key-value pairs, key-value pairs are randomly selected and deleted from the B-Tree. The deleted key-value pairs are then looked up using their keys to check if they were successfully deleted.