test: suppress some warnings here and there

This commit is contained in:
Michele Caini
2020-10-15 15:06:57 +02:00
parent d8ff4285da
commit 86c1dd7f32
7 changed files with 8 additions and 8 deletions

View File

@@ -86,11 +86,11 @@ TEST(NonOwningGroup, Functionalities) {
ASSERT_EQ(cgroup.rbegin(), cgroup.rend());
ASSERT_TRUE(group.empty());
ASSERT_TRUE(group.capacity());
ASSERT_NE(group.capacity(), 0u);
group.shrink_to_fit();
ASSERT_FALSE(group.capacity());
ASSERT_EQ(group.capacity(), 0u);
}
TEST(NonOwningGroup, ElementAccess) {

View File

@@ -256,7 +256,7 @@ TEST(Snapshot, Iterator) {
ASSERT_EQ(registry.view<another_component>().size(), size);
registry.view<another_component>().each([](const auto entity, const auto &) {
ASSERT_TRUE(entt::to_integral(entity) % 2);
ASSERT_NE(entt::to_integral(entity) % 2u, 0u);
});
}

View File

@@ -658,7 +658,7 @@ TEST_F(MetaAny, SetGet) {
const auto value = any.get("value"_hs);
ASSERT_TRUE(value);
ASSERT_TRUE(value.try_cast<int>());
ASSERT_NE(value.try_cast<int>(), nullptr);
ASSERT_EQ(value.cast<int>(), 42);
ASSERT_EQ(instance.value, 42);

View File

@@ -216,7 +216,7 @@ TEST_F(MetaData, GetMetaAnyArg) {
const auto value = entt::resolve<clazz_t>().data("i"_hs).get(any);
ASSERT_TRUE(value);
ASSERT_TRUE(value.cast<int>());
ASSERT_TRUE(static_cast<bool>(value.cast<int>()));
ASSERT_EQ(value.cast<int>(), 99);
}

View File

@@ -28,7 +28,7 @@ TEST(Lib, Meta) {
ASSERT_TRUE(pos && vel);
ASSERT_EQ(pos.type().data("x"_hs).type(), entt::resolve<int>());
ASSERT_TRUE(pos.type().data("y"_hs).get(pos).try_cast<int>());
ASSERT_NE(pos.type().data("y"_hs).get(pos).try_cast<int>(), nullptr);
ASSERT_EQ(pos.type().data("x"_hs).get(pos).cast<int>(), 42);
ASSERT_EQ(pos.type().data("y"_hs).get(pos).cast<int>(), 3);

View File

@@ -29,7 +29,7 @@ TEST(Lib, Meta) {
ASSERT_TRUE(pos && vel);
ASSERT_EQ(pos.type().data("x"_hs).type(), entt::resolve<int>());
ASSERT_TRUE(pos.type().data("y"_hs).get(pos).try_cast<int>());
ASSERT_NE(pos.type().data("y"_hs).get(pos).try_cast<int>(), nullptr);
ASSERT_EQ(pos.type().data("x"_hs).get(pos).cast<int>(), 42);
ASSERT_EQ(pos.type().data("y"_hs).get(pos).cast<int>(), 3);

View File

@@ -29,7 +29,7 @@ TEST(Lib, Meta) {
ASSERT_TRUE(pos && vel);
ASSERT_EQ(pos.type().data("x"_hs).type(), entt::resolve<int>());
ASSERT_TRUE(pos.type().data("y"_hs).get(pos).try_cast<int>());
ASSERT_NE(pos.type().data("y"_hs).get(pos).try_cast<int>(), nullptr);
ASSERT_EQ(pos.type().data("x"_hs).get(pos).cast<int>(), 42);
ASSERT_EQ(pos.type().data("y"_hs).get(pos).cast<int>(), 3);