mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-02-04 08:59:07 +00:00
chore(hash): line up HASHKEY_PTR and HASHKEY_STR ctor with verified behavior
This commit is contained in:
parent
adc8cb6200
commit
2e044682e1
3 changed files with 37 additions and 3 deletions
|
|
@ -14,6 +14,26 @@ typedef void* TestExportObjectHandle;
|
|||
|
||||
typedef void* TestExportLockedHandle;
|
||||
|
||||
TEST_CASE("HASHKEY_PTR", "[hash]") {
|
||||
SECTION("constructs correctly") {
|
||||
HASHKEY_PTR key1;
|
||||
HASHKEY_PTR key2;
|
||||
REQUIRE(key1.operator==(key2));
|
||||
|
||||
void* ptr = reinterpret_cast<void*>(0xDEAFBEEF);
|
||||
HASHKEY_PTR key3 = { ptr };
|
||||
HASHKEY_PTR key4 = { ptr };
|
||||
REQUIRE(key3.operator==(key4));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("HASHKEY_STR", "[hash]") {
|
||||
SECTION("constructs correctly") {
|
||||
HASHKEY_STR key = { "foo" };
|
||||
REQUIRE(key.operator==("foo"));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("TSHashTable", "[hash]") {
|
||||
SECTION("constructs correctly") {
|
||||
TSHashTable<TestHashObject, HASHKEY_STRI> hashTable;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue