xo-array: + DArenaHashMap.insert
This commit is contained in:
parent
94647287e0
commit
dd39ffc8d9
2 changed files with 242 additions and 51 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#include <catch2/catch.hpp>
|
||||
|
||||
namespace xo {
|
||||
using xo::mm::DArenaHashMapUtil;
|
||||
using xo::mm::DArenaHashMap;
|
||||
//using xo::mM::ArenaConfig;
|
||||
|
||||
|
|
@ -18,7 +19,22 @@ namespace xo {
|
|||
HashMap map;
|
||||
|
||||
REQUIRE(map.empty());
|
||||
REQUIRE(map.capacity() == HashMap::group_size());
|
||||
REQUIRE(map.size() == 0);
|
||||
REQUIRE(map.groups() == 1);
|
||||
REQUIRE(map.capacity() == DArenaHashMapUtil::c_group_size);
|
||||
}
|
||||
|
||||
TEST_CASE("DArenaHashMap-ctor2", "[arena][DArenaHashMap]")
|
||||
{
|
||||
using HashMap = DArenaHashMap<int, int>;
|
||||
|
||||
HashMap map(257);
|
||||
|
||||
REQUIRE(map.empty());
|
||||
REQUIRE(map.size() == 0);
|
||||
REQUIRE(map.capacity() == map.groups() * DArenaHashMapUtil::c_group_size);
|
||||
REQUIRE(map.capacity() == std::max(512ul,
|
||||
DArenaHashMapUtil::c_group_size));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue