mirror of
https://github.com/bkaradzic/bx.git
synced 2026-06-08 11:13:49 +00:00
Added bx::toHuman. (#370)
This commit is contained in:
committed by
GitHub
parent
2b946b4668
commit
a6168a9d1c
@@ -163,26 +163,26 @@ TEST_CASE("HandleHashTable", "")
|
||||
|
||||
bx::StringView sv0("test0");
|
||||
|
||||
bool ok = hm.insert(bx::hash<bx::HashMurmur2A>(sv0), 0);
|
||||
bool ok = hm.insert(bx::hash<bx::HashMurmur3>(sv0), 0);
|
||||
REQUIRE(ok);
|
||||
|
||||
ok = hm.insert(bx::hash<bx::HashMurmur2A>(sv0), 0);
|
||||
ok = hm.insert(bx::hash<bx::HashMurmur3>(sv0), 0);
|
||||
REQUIRE(!ok);
|
||||
REQUIRE(1 == hm.getNumElements() );
|
||||
|
||||
bx::StringView sv1("test1");
|
||||
|
||||
ok = hm.insert(bx::hash<bx::HashMurmur2A>(sv1), 0);
|
||||
ok = hm.insert(bx::hash<bx::HashMurmur3>(sv1), 0);
|
||||
REQUIRE(ok);
|
||||
REQUIRE(2 == hm.getNumElements() );
|
||||
|
||||
hm.removeByHandle(0);
|
||||
REQUIRE(0 == hm.getNumElements() );
|
||||
|
||||
ok = hm.insert(bx::hash<bx::HashMurmur2A>(sv0), 0);
|
||||
ok = hm.insert(bx::hash<bx::HashMurmur3>(sv0), 0);
|
||||
REQUIRE(ok);
|
||||
|
||||
hm.removeByKey(bx::hash<bx::HashMurmur2A>(sv0) );
|
||||
hm.removeByKey(bx::hash<bx::HashMurmur3>(sv0) );
|
||||
REQUIRE(0 == hm.getNumElements() );
|
||||
|
||||
for (uint32_t ii = 0, num = hm.getMaxCapacity(); ii < num; ++ii)
|
||||
|
||||
@@ -26,7 +26,7 @@ TEST_CASE("prettify", "[string]")
|
||||
prettify(tmp, BX_COUNTOF(tmp), 4000, bx::Units::Kilo);
|
||||
REQUIRE(0 == bx::strCmp(tmp, "4 kB") );
|
||||
|
||||
prettify(tmp, BX_COUNTOF(tmp), 4096, bx::Units::Kibi);
|
||||
prettify(tmp, BX_COUNTOF(tmp), 4096, bx::Units::KibiByte);
|
||||
REQUIRE(0 == bx::strCmp(tmp, "4 KiB") );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user