test: stress get/get_as_tuple for empty types

This commit is contained in:
Michele Caini
2023-01-31 17:22:07 +01:00
parent c7dfce89e5
commit f48de1bac9

View File

@@ -282,6 +282,17 @@ TEST(Storage, EmptyType) {
ASSERT_TRUE(pool.contains(entt::entity{99}));
ASSERT_FALSE(other.contains(entt::entity{99}));
ASSERT_NO_THROW(pool.get(entt::entity{99}));
ASSERT_EQ(pool.get_as_tuple(entt::entity{99}), std::tuple<>{});
}
ENTT_DEBUG_TEST(StorageDeathTest, EmptyType) {
entt::storage<empty_stable_type> pool;
pool.emplace(entt::entity{99});
ASSERT_DEATH(pool.get(entt::entity{3}), "");
ASSERT_DEATH([[maybe_unused]] auto tup = pool.get_as_tuple(entt::entity{3}), "");
}
TEST(Storage, Insert) {