mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 10:32:29 +00:00
feat(hash): finish implementation of TSHashTable<T, TKey>::Clear
This commit is contained in:
parent
67841ebf14
commit
1d561d4bdf
2 changed files with 35 additions and 6 deletions
|
|
@ -11,3 +11,18 @@ TEST_CASE("TSHashTable", "[hash]") {
|
|||
REQUIRE(hashTable.Head() == nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("TSHashTable::Clear", "[hash]") {
|
||||
SECTION("clears empty hash table correctly") {
|
||||
TSHashTable<TestHashObject, HASHKEY_STRI> hashTable;
|
||||
hashTable.Clear();
|
||||
REQUIRE(hashTable.Head() == nullptr);
|
||||
}
|
||||
|
||||
SECTION("clears hash table with entry correctly") {
|
||||
TSHashTable<TestHashObject, HASHKEY_STRI> hashTable;
|
||||
hashTable.New("testKey", 0, 0x0);
|
||||
hashTable.Clear();
|
||||
REQUIRE(hashTable.Head() == nullptr);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue