osrm-backend/test/unit/reserve.cpp
Siarhei Fedartsou f1087e81ec Squashed 'third_party/unordered_dense/' content from commit 231e48c94
git-subtree-dir: third_party/unordered_dense
git-subtree-split: 231e48c9426bd21c273669e5fdcd042c146975cf
2024-05-30 19:06:16 +02:00

15 lines
461 B
C++

#include <ankerl/unordered_dense.h>
#include <app/doctest.h>
TEST_CASE_MAP("reserve", int, int) {
// there's no capacity() for std::deque
if constexpr (!std::is_same_v<typename map_t::value_container_type, std::deque<std::pair<int, int>>>) {
auto map = map_t();
REQUIRE(map.values().capacity() <= 1000U);
map.reserve(1000);
REQUIRE(map.values().capacity() >= 1000U);
REQUIRE(0U == map.values().size());
}
}