test: suppress a few warnings (entity)
This commit is contained in:
+15
-15
@@ -187,10 +187,10 @@ TEST(NonOwningGroup, Each) {
|
||||
auto cgroup = std::as_const(registry).group_if_exists(entt::get<const int, const char>);
|
||||
|
||||
registry.emplace<int>(entity[0u], 0);
|
||||
registry.emplace<char>(entity[0u], 0);
|
||||
registry.emplace<char>(entity[0u], static_cast<char>(0));
|
||||
|
||||
registry.emplace<int>(entity[1u], 1);
|
||||
registry.emplace<char>(entity[1u], 1);
|
||||
registry.emplace<char>(entity[1u], static_cast<char>(1));
|
||||
|
||||
auto iterable = group.each();
|
||||
auto citerable = cgroup.each();
|
||||
@@ -203,14 +203,14 @@ TEST(NonOwningGroup, Each) {
|
||||
|
||||
ASSERT_EQ((it++, ++it), iterable.end());
|
||||
|
||||
group.each([expected = 1u](auto entt, int &ivalue, char &cvalue) mutable {
|
||||
ASSERT_EQ(entt::to_integral(entt), expected);
|
||||
group.each([expected = 1](auto entt, int &ivalue, char &cvalue) mutable {
|
||||
ASSERT_EQ(static_cast<int>(entt::to_integral(entt)), expected);
|
||||
ASSERT_EQ(ivalue, expected);
|
||||
ASSERT_EQ(cvalue, expected);
|
||||
--expected;
|
||||
});
|
||||
|
||||
cgroup.each([expected = 1u](const int &ivalue, const char &cvalue) mutable {
|
||||
cgroup.each([expected = 1](const int &ivalue, const char &cvalue) mutable {
|
||||
ASSERT_EQ(ivalue, expected);
|
||||
ASSERT_EQ(cvalue, expected);
|
||||
--expected;
|
||||
@@ -224,8 +224,8 @@ TEST(NonOwningGroup, Each) {
|
||||
|
||||
// do not use iterable, make sure an iterable group works when created from a temporary
|
||||
for(auto [entt, ivalue, cvalue]: registry.group(entt::get<int, char>).each()) {
|
||||
ASSERT_EQ(entt::to_integral(entt), ivalue);
|
||||
ASSERT_EQ(entt::to_integral(entt), cvalue);
|
||||
ASSERT_EQ(static_cast<int>(entt::to_integral(entt)), ivalue);
|
||||
ASSERT_EQ(static_cast<char>(entt::to_integral(entt)), cvalue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -831,10 +831,10 @@ TEST(OwningGroup, Each) {
|
||||
auto cgroup = std::as_const(registry).group_if_exists<const int>(entt::get<const char>);
|
||||
|
||||
registry.emplace<int>(entity[0u], 0);
|
||||
registry.emplace<char>(entity[0u], 0);
|
||||
registry.emplace<char>(entity[0u], static_cast<char>(0));
|
||||
|
||||
registry.emplace<int>(entity[1u], 1);
|
||||
registry.emplace<char>(entity[1u], 1);
|
||||
registry.emplace<char>(entity[1u], static_cast<char>(1));
|
||||
|
||||
auto iterable = group.each();
|
||||
auto citerable = cgroup.each();
|
||||
@@ -847,14 +847,14 @@ TEST(OwningGroup, Each) {
|
||||
|
||||
ASSERT_EQ((it++, ++it), iterable.end());
|
||||
|
||||
group.each([expected = 1u](auto entt, int &ivalue, char &cvalue) mutable {
|
||||
ASSERT_EQ(entt::to_integral(entt), expected);
|
||||
group.each([expected = 1](auto entt, int &ivalue, char &cvalue) mutable {
|
||||
ASSERT_EQ(static_cast<int>(entt::to_integral(entt)), expected);
|
||||
ASSERT_EQ(ivalue, expected);
|
||||
ASSERT_EQ(cvalue, expected);
|
||||
--expected;
|
||||
});
|
||||
|
||||
cgroup.each([expected = 1u](const int &ivalue, const char &cvalue) mutable {
|
||||
cgroup.each([expected = 1](const int &ivalue, const char &cvalue) mutable {
|
||||
ASSERT_EQ(ivalue, expected);
|
||||
ASSERT_EQ(cvalue, expected);
|
||||
--expected;
|
||||
@@ -868,8 +868,8 @@ TEST(OwningGroup, Each) {
|
||||
|
||||
// do not use iterable, make sure an iterable group works when created from a temporary
|
||||
for(auto [entt, ivalue, cvalue]: registry.group<int>(entt::get<char>).each()) {
|
||||
ASSERT_EQ(entt::to_integral(entt), ivalue);
|
||||
ASSERT_EQ(entt::to_integral(entt), cvalue);
|
||||
ASSERT_EQ(static_cast<int>(entt::to_integral(entt)), ivalue);
|
||||
ASSERT_EQ(static_cast<char>(entt::to_integral(entt)), cvalue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1403,7 +1403,7 @@ TEST(OwningGroup, SwappingValuesIsAllowed) {
|
||||
|
||||
// thanks to @andranik3949 for pointing out this missing test
|
||||
registry.view<const boxed_int>().each([](const auto entity, const auto &value) {
|
||||
ASSERT_EQ(entt::to_integral(entity), value.value);
|
||||
ASSERT_EQ(static_cast<int>(entt::to_integral(entity)), value.value);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ struct clazz {
|
||||
static void ro_int_char_with_payload(clazz &, entt::view<entt::get_t<const int, const char>>) {}
|
||||
};
|
||||
|
||||
void to_args_integrity(entt::view<entt::get_t<int>> view, std::size_t &value, entt::registry ®istry) {
|
||||
void to_args_integrity(entt::view<entt::get_t<int>> view, std::size_t &value, entt::registry &) {
|
||||
value = view.size();
|
||||
}
|
||||
|
||||
|
||||
@@ -2009,7 +2009,7 @@ TEST(Registry, ScramblingPoolsIsAllowed) {
|
||||
|
||||
// thanks to @andranik3949 for pointing out this missing test
|
||||
registry.view<const int>().each([](const auto entity, const auto &value) {
|
||||
ASSERT_EQ(entt::to_integral(entity), value);
|
||||
ASSERT_EQ(static_cast<int>(entt::to_integral(entity)), value);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -599,7 +599,7 @@ TEST(SparseSet, Remove) {
|
||||
ASSERT_TRUE(set.empty());
|
||||
|
||||
ASSERT_EQ(set.remove(std::begin(entities), std::end(entities)), 0u);
|
||||
ASSERT_EQ(set.remove(entities[1u]), 0u);
|
||||
ASSERT_FALSE(set.remove(entities[1u]));
|
||||
|
||||
ASSERT_TRUE(set.empty());
|
||||
|
||||
@@ -620,8 +620,8 @@ TEST(SparseSet, Remove) {
|
||||
ASSERT_EQ(set.current(entities[2u]), traits_type::to_version(entities[2u]));
|
||||
ASSERT_EQ(*set.begin(), entities[2u]);
|
||||
|
||||
ASSERT_EQ(set.remove(entities[2u]), 1u);
|
||||
ASSERT_EQ(set.remove(entities[2u]), 0u);
|
||||
ASSERT_TRUE(set.remove(entities[2u]));
|
||||
ASSERT_FALSE(set.remove(entities[2u]));
|
||||
ASSERT_TRUE(set.empty());
|
||||
ASSERT_EQ(set.current(entities[2u]), traits_type::to_version(entt::tombstone));
|
||||
|
||||
@@ -641,9 +641,9 @@ TEST(SparseSet, Remove) {
|
||||
ASSERT_FALSE(set.empty());
|
||||
ASSERT_EQ(*set.begin(), entities[2u]);
|
||||
|
||||
ASSERT_EQ(set.remove(traits_type::construct(9, 0)), 0u);
|
||||
ASSERT_EQ(set.remove(entt::tombstone), 0u);
|
||||
ASSERT_EQ(set.remove(entt::null), 0u);
|
||||
ASSERT_FALSE(set.remove(traits_type::construct(9, 0)));
|
||||
ASSERT_FALSE(set.remove(entt::tombstone));
|
||||
ASSERT_FALSE(set.remove(entt::null));
|
||||
}
|
||||
|
||||
TEST(SparseSet, CrossRemove) {
|
||||
@@ -671,7 +671,7 @@ TEST(SparseSet, StableRemove) {
|
||||
ASSERT_EQ(set.size(), 0u);
|
||||
|
||||
ASSERT_EQ(set.remove(std::begin(entities), std::end(entities)), 0u);
|
||||
ASSERT_EQ(set.remove(entities[1u]), 0u);
|
||||
ASSERT_FALSE(set.remove(entities[1u]));
|
||||
|
||||
ASSERT_TRUE(set.empty());
|
||||
ASSERT_EQ(set.size(), 0u);
|
||||
@@ -708,8 +708,8 @@ TEST(SparseSet, StableRemove) {
|
||||
ASSERT_TRUE(set.at(0u) == entt::tombstone);
|
||||
ASSERT_TRUE(set.at(1u) == entt::tombstone);
|
||||
|
||||
ASSERT_EQ(set.remove(entities[2u]), 1u);
|
||||
ASSERT_EQ(set.remove(entities[2u]), 0u);
|
||||
ASSERT_TRUE(set.remove(entities[2u]));
|
||||
ASSERT_FALSE(set.remove(entities[2u]));
|
||||
|
||||
ASSERT_FALSE(set.empty());
|
||||
ASSERT_EQ(set.size(), 3u);
|
||||
@@ -751,15 +751,15 @@ TEST(SparseSet, StableRemove) {
|
||||
set.emplace(entities[1u]);
|
||||
set.emplace(entities[2u]);
|
||||
|
||||
ASSERT_EQ(set.remove(entities[2u]), 1u);
|
||||
ASSERT_EQ(set.remove(entities[2u]), 0u);
|
||||
ASSERT_TRUE(set.remove(entities[2u]));
|
||||
ASSERT_FALSE(set.remove(entities[2u]));
|
||||
|
||||
ASSERT_NE(set.current(entities[0u]), traits_type::to_version(entt::tombstone));
|
||||
ASSERT_NE(set.current(entities[1u]), traits_type::to_version(entt::tombstone));
|
||||
ASSERT_EQ(set.current(entities[2u]), traits_type::to_version(entt::tombstone));
|
||||
|
||||
ASSERT_EQ(set.remove(entities[0u]), 1u);
|
||||
ASSERT_EQ(set.remove(entities[1u]), 1u);
|
||||
ASSERT_TRUE(set.remove(entities[0u]));
|
||||
ASSERT_TRUE(set.remove(entities[1u]));
|
||||
ASSERT_EQ(set.remove(entities, entities + 2u), 0u);
|
||||
|
||||
ASSERT_EQ(set.size(), 3u);
|
||||
@@ -786,8 +786,8 @@ TEST(SparseSet, StableRemove) {
|
||||
ASSERT_NE(set.current(entities[1u]), traits_type::to_version(entt::tombstone));
|
||||
ASSERT_NE(set.current(entities[2u]), traits_type::to_version(entt::tombstone));
|
||||
|
||||
ASSERT_EQ(set.remove(traits_type::construct(9, 0)), 0u);
|
||||
ASSERT_EQ(set.remove(entt::null), 0u);
|
||||
ASSERT_FALSE(set.remove(traits_type::construct(9, 0)));
|
||||
ASSERT_FALSE(set.remove(entt::null));
|
||||
}
|
||||
|
||||
TEST(SparseSet, CrossStableRemove) {
|
||||
|
||||
@@ -513,8 +513,8 @@ TEST(Storage, Remove) {
|
||||
ASSERT_FALSE(pool.empty());
|
||||
ASSERT_EQ(*pool.begin(), 2);
|
||||
|
||||
ASSERT_EQ(pool.remove(entities[2u]), 1u);
|
||||
ASSERT_EQ(pool.remove(entities[2u]), 0u);
|
||||
ASSERT_TRUE(pool.remove(entities[2u]));
|
||||
ASSERT_FALSE(pool.remove(entities[2u]));
|
||||
ASSERT_TRUE(pool.empty());
|
||||
|
||||
pool.emplace(entities[0u], 0);
|
||||
@@ -575,9 +575,9 @@ TEST(Storage, StableRemove) {
|
||||
ASSERT_EQ(pool.begin()->value, 2);
|
||||
ASSERT_EQ(pool.index(entities[2u]), 2u);
|
||||
|
||||
ASSERT_EQ(pool.remove(entities[2u]), 1u);
|
||||
ASSERT_EQ(pool.remove(entities[2u]), 0u);
|
||||
ASSERT_EQ(pool.remove(entities[2u]), 0u);
|
||||
ASSERT_TRUE(pool.remove(entities[2u]));
|
||||
ASSERT_FALSE(pool.remove(entities[2u]));
|
||||
ASSERT_FALSE(pool.remove(entities[2u]));
|
||||
ASSERT_FALSE(pool.empty());
|
||||
ASSERT_EQ(pool.size(), 3u);
|
||||
ASSERT_FALSE(pool.contains(entities[0u]));
|
||||
@@ -610,11 +610,11 @@ TEST(Storage, StableRemove) {
|
||||
pool.emplace(entities[1u], stable_type{2});
|
||||
pool.emplace(entities[2u], stable_type{1});
|
||||
|
||||
ASSERT_EQ(pool.remove(entities[2u]), 1u);
|
||||
ASSERT_EQ(pool.remove(entities[2u]), 0u);
|
||||
ASSERT_TRUE(pool.remove(entities[2u]));
|
||||
ASSERT_FALSE(pool.remove(entities[2u]));
|
||||
|
||||
ASSERT_EQ(pool.remove(entities[0u]), 1u);
|
||||
ASSERT_EQ(pool.remove(entities[1u]), 1u);
|
||||
ASSERT_TRUE(pool.remove(entities[0u]));
|
||||
ASSERT_TRUE(pool.remove(entities[1u]));
|
||||
ASSERT_EQ(pool.remove(entities, entities + 2u), 0u);
|
||||
|
||||
ASSERT_EQ(pool.size(), 3u);
|
||||
|
||||
+11
-11
@@ -200,13 +200,13 @@ TEST(SingleComponentView, Each) {
|
||||
|
||||
ASSERT_EQ((it++, ++it), iterable.end());
|
||||
|
||||
view.each([expected = 1u](auto entt, int &value) mutable {
|
||||
ASSERT_EQ(entt::to_integral(entt), expected);
|
||||
view.each([expected = 1](auto entt, int &value) mutable {
|
||||
ASSERT_EQ(static_cast<int>(entt::to_integral(entt)), expected);
|
||||
ASSERT_EQ(value, expected);
|
||||
--expected;
|
||||
});
|
||||
|
||||
cview.each([expected = 1u](const int &value) mutable {
|
||||
cview.each([expected = 1](const int &value) mutable {
|
||||
ASSERT_EQ(value, expected);
|
||||
--expected;
|
||||
});
|
||||
@@ -219,7 +219,7 @@ TEST(SingleComponentView, Each) {
|
||||
|
||||
// do not use iterable, make sure an iterable view works when created from a temporary
|
||||
for(auto [entt, value]: view.each()) {
|
||||
ASSERT_EQ(entt::to_integral(entt), value);
|
||||
ASSERT_EQ(static_cast<int>(entt::to_integral(entt)), value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -705,10 +705,10 @@ TEST(MultiComponentView, Each) {
|
||||
auto cview = std::as_const(registry).view<const int, const char>();
|
||||
|
||||
registry.emplace<int>(entity[0u], 0);
|
||||
registry.emplace<char>(entity[0u], 0);
|
||||
registry.emplace<char>(entity[0u], static_cast<char>(0));
|
||||
|
||||
registry.emplace<int>(entity[1u], 1);
|
||||
registry.emplace<char>(entity[1u], 1);
|
||||
registry.emplace<char>(entity[1u], static_cast<char>(1));
|
||||
|
||||
auto iterable = view.each();
|
||||
auto citerable = cview.each();
|
||||
@@ -721,14 +721,14 @@ TEST(MultiComponentView, Each) {
|
||||
|
||||
ASSERT_EQ((it++, ++it), iterable.end());
|
||||
|
||||
view.each([expected = 1u](auto entt, int &ivalue, char &cvalue) mutable {
|
||||
ASSERT_EQ(entt::to_integral(entt), expected);
|
||||
view.each([expected = 1](auto entt, int &ivalue, char &cvalue) mutable {
|
||||
ASSERT_EQ(static_cast<int>(entt::to_integral(entt)), expected);
|
||||
ASSERT_EQ(ivalue, expected);
|
||||
ASSERT_EQ(cvalue, expected);
|
||||
--expected;
|
||||
});
|
||||
|
||||
cview.each([expected = 1u](const int &ivalue, const char &cvalue) mutable {
|
||||
cview.each([expected = 1](const int &ivalue, const char &cvalue) mutable {
|
||||
ASSERT_EQ(ivalue, expected);
|
||||
ASSERT_EQ(cvalue, expected);
|
||||
--expected;
|
||||
@@ -742,8 +742,8 @@ TEST(MultiComponentView, Each) {
|
||||
|
||||
// do not use iterable, make sure an iterable view works when created from a temporary
|
||||
for(auto [entt, ivalue, cvalue]: registry.view<int, char>().each()) {
|
||||
ASSERT_EQ(entt::to_integral(entt), ivalue);
|
||||
ASSERT_EQ(entt::to_integral(entt), cvalue);
|
||||
ASSERT_EQ(static_cast<int>(entt::to_integral(entt)), ivalue);
|
||||
ASSERT_EQ(static_cast<char>(entt::to_integral(entt)), cvalue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user