diff --git a/test/entt/core/compressed_pair.cpp b/test/entt/core/compressed_pair.cpp index f08a6b313..3010eebcc 100644 --- a/test/entt/core/compressed_pair.cpp +++ b/test/entt/core/compressed_pair.cpp @@ -47,14 +47,14 @@ TEST(CompressedPair, ConstructCopyMove) { entt::compressed_pair> movable{test::empty{}, std::make_unique(1)}; auto by_move{std::move(movable)}; + ASSERT_TRUE(by_move.second()); ASSERT_EQ(*by_move.second(), 1); - ASSERT_EQ(movable.second(), nullptr); // NOLINT *by_move.second() = 3; movable = std::move(by_move); + ASSERT_TRUE(movable.second()); ASSERT_EQ(*movable.second(), 3); - ASSERT_EQ(by_move.second(), nullptr); // NOLINT } TEST(CompressedPair, PiecewiseConstruct) { diff --git a/test/entt/core/memory.cpp b/test/entt/core/memory.cpp index c7e7f23ea..078bfbf67 100644 --- a/test/entt/core/memory.cpp +++ b/test/entt/core/memory.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -214,10 +215,11 @@ TEST(MakeObjUsingAllocator, Functionalities) { } TEST(UninitializedConstructUsingAllocator, NoUsesAllocatorConstruction) { - alignas(int) std::byte storage[sizeof(int)]; // NOLINT + alignas(int) std::array storage{}; const std::allocator allocator{}; - int *value = entt::uninitialized_construct_using_allocator(reinterpret_cast(&storage), allocator, 1); // NOLINT + // NOLINTNEXTLINE(*-reinterpret-cast) + int *value = entt::uninitialized_construct_using_allocator(reinterpret_cast(storage.data()), allocator, 1); ASSERT_EQ(*value, 1); } @@ -230,9 +232,10 @@ TEST(UninitializedConstructUsingAllocator, UsesAllocatorConstruction) { test::tracked_memory_resource memory_resource{}; const std::pmr::polymorphic_allocator allocator{&memory_resource}; - alignas(string_type) std::byte storage[sizeof(string_type)]; // NOLINT + alignas(string_type) std::array storage{}; - string_type *value = entt::uninitialized_construct_using_allocator(reinterpret_cast(&storage), allocator, test::tracked_memory_resource::default_value); // NOLINT + // NOLINTNEXTLINE(*-reinterpret-cast) + string_type *value = entt::uninitialized_construct_using_allocator(reinterpret_cast(storage.data()), allocator, test::tracked_memory_resource::default_value); ASSERT_GT(memory_resource.do_allocate_counter(), 0u); ASSERT_EQ(memory_resource.do_deallocate_counter(), 0u); diff --git a/test/entt/core/type_traits.cpp b/test/entt/core/type_traits.cpp index e63e4caeb..5d864072b 100644 --- a/test/entt/core/type_traits.cpp +++ b/test/entt/core/type_traits.cpp @@ -60,8 +60,10 @@ struct UnpackAsValue: ::testing::Test { TEST(SizeOf, Functionalities) { ASSERT_EQ(entt::size_of_v, 0u); ASSERT_EQ(entt::size_of_v, sizeof(char)); - ASSERT_EQ(entt::size_of_v, 0u); // NOLINT - ASSERT_EQ(entt::size_of_v, sizeof(int[3])); // NOLINT + // NOLINTBEGIN(*-avoid-c-arrays) + ASSERT_EQ(entt::size_of_v, 0u); + ASSERT_EQ(entt::size_of_v, sizeof(int[3])); + // NOLINTEND(*-avoid-c-arrays) } TEST_F(UnpackAsType, Functionalities) { @@ -223,7 +225,8 @@ TEST(IsEqualityComparable, Functionalities) { ASSERT_TRUE((entt::is_equality_comparable_v>)); ASSERT_TRUE(entt::is_equality_comparable_v); - ASSERT_FALSE(entt::is_equality_comparable_v); // NOLINT + // NOLINTNEXTLINE(*-avoid-c-arrays) + ASSERT_FALSE(entt::is_equality_comparable_v); ASSERT_FALSE(entt::is_equality_comparable_v); ASSERT_FALSE(entt::is_equality_comparable_v); ASSERT_FALSE(entt::is_equality_comparable_v>); diff --git a/test/entt/core/utility.cpp b/test/entt/core/utility.cpp index 1a32175e7..3ed3e5129 100644 --- a/test/entt/core/utility.cpp +++ b/test/entt/core/utility.cpp @@ -27,7 +27,8 @@ TEST(Overload, Functionalities) { ASSERT_EQ(entt::overload(&functions::bar), static_cast(&functions::bar)); ASSERT_EQ(entt::overload(&functions::bar), static_cast(&functions::bar)); - functions instance; // NOLINT + functions instance; + instance.bar(0); // makes the linter happy ASSERT_NO_THROW(entt::overload(&functions::foo)(0)); ASSERT_NO_THROW(entt::overload(&functions::foo)());