storage/registry: batch add no longer returns an iterator

This commit is contained in:
Michele Caini
2020-01-15 23:21:34 +01:00
parent e7d4077065
commit dada8dbdeb
4 changed files with 13 additions and 34 deletions
+1 -7
View File
@@ -1191,17 +1191,11 @@ TEST(Registry, RangeAssign) {
ASSERT_FALSE(registry.has<float>(e2));
const auto view = registry.view<int, char>();
auto it = registry.assign<float>(view.begin(), view.end());
registry.assign<float>(view.begin(), view.end());
ASSERT_TRUE(registry.has<float>(e0));
ASSERT_TRUE(registry.has<float>(e1));
ASSERT_FALSE(registry.has<float>(e2));
*it = 0.f;
*(it+1) = 1.f;
ASSERT_EQ(registry.get<float>(*view.begin()), 0.f);
ASSERT_EQ(registry.get<float>(*(++view.begin())), 1.f);
}
TEST(Registry, RangeRemove) {
+1 -7
View File
@@ -100,7 +100,7 @@ TEST(Storage, BatchAdd) {
entities[0] = entt::entity{3};
entities[1] = entt::entity{42};
auto it = pool.construct(std::begin(entities), std::end(entities));
pool.construct(std::begin(entities), std::end(entities));
ASSERT_TRUE(pool.has(entities[0]));
ASSERT_TRUE(pool.has(entities[1]));
@@ -109,12 +109,6 @@ TEST(Storage, BatchAdd) {
ASSERT_EQ(pool.size(), 2u);
ASSERT_EQ(pool.get(entities[0]), 0);
ASSERT_EQ(pool.get(entities[1]), 0);
it[0] = 1;
it[1] = 2;
ASSERT_EQ(pool.get(entities[0]), 1);
ASSERT_EQ(pool.get(entities[1]), 2);
}
TEST(Storage, BatchAddEmptyType) {