Ver código fonte

test: reduce NOLINT usage

skypjack 9 meses atrás
pai
commit
25cad2543d
3 arquivos alterados com 0 adições e 18 exclusões
  1. 0 8
      test/entt/core/any.cpp
  2. 0 2
      test/entt/core/memory.cpp
  3. 0 8
      test/entt/poly/poly.cpp

+ 0 - 8
test/entt/core/any.cpp

@@ -1746,17 +1746,13 @@ TEST(Any, SboAlignment) {
     std::array<any_type, 2u> sbo = {over_aligned{}, over_aligned{}};
     const auto *data = sbo[0].data();
 
-    // NOLINTBEGIN(*-reinterpret-cast)
     ASSERT_TRUE((reinterpret_cast<std::uintptr_t>(sbo[0u].data()) % alignment) == 0u);
     ASSERT_TRUE((reinterpret_cast<std::uintptr_t>(sbo[1u].data()) % alignment) == 0u);
-    // NOLINTEND(*-reinterpret-cast)
 
     std::swap(sbo[0], sbo[1]);
 
-    // NOLINTBEGIN(*-reinterpret-cast)
     ASSERT_TRUE((reinterpret_cast<std::uintptr_t>(sbo[0u].data()) % alignment) == 0u);
     ASSERT_TRUE((reinterpret_cast<std::uintptr_t>(sbo[1u].data()) % alignment) == 0u);
-    // NOLINTEND(*-reinterpret-cast)
 
     ASSERT_NE(data, sbo[1].data());
 }
@@ -1768,17 +1764,13 @@ TEST(Any, NoSboAlignment) {
     std::array<any_type, 2u> nosbo = {over_aligned{}, over_aligned{}};
     const auto *data = nosbo[0].data();
 
-    // NOLINTBEGIN(*-reinterpret-cast)
     ASSERT_TRUE((reinterpret_cast<std::uintptr_t>(nosbo[0u].data()) % alignment) == 0u);
     ASSERT_TRUE((reinterpret_cast<std::uintptr_t>(nosbo[1u].data()) % alignment) == 0u);
-    // NOLINTEND(*-reinterpret-cast)
 
     std::swap(nosbo[0], nosbo[1]);
 
-    // NOLINTBEGIN(*-reinterpret-cast)
     ASSERT_TRUE((reinterpret_cast<std::uintptr_t>(nosbo[0u].data()) % alignment) == 0u);
     ASSERT_TRUE((reinterpret_cast<std::uintptr_t>(nosbo[1u].data()) % alignment) == 0u);
-    // NOLINTEND(*-reinterpret-cast)
 
     ASSERT_EQ(data, nosbo[1].data());
 }

+ 0 - 2
test/entt/core/memory.cpp

@@ -177,7 +177,6 @@ TEST(UninitializedConstructUsingAllocator, NoUsesAllocatorConstruction) {
     alignas(int) std::array<std::byte, sizeof(int)> storage{};
     const std::allocator<int> allocator{};
 
-    // NOLINTNEXTLINE(*-reinterpret-cast)
     int *value = entt::uninitialized_construct_using_allocator(reinterpret_cast<int *>(storage.data()), allocator, 1);
 
     ASSERT_EQ(*value, 1);
@@ -193,7 +192,6 @@ TEST(UninitializedConstructUsingAllocator, UsesAllocatorConstruction) {
     const std::pmr::polymorphic_allocator<string_type> allocator{&memory_resource};
     alignas(string_type) std::array<std::byte, sizeof(string_type)> storage{};
 
-    // NOLINTNEXTLINE(*-reinterpret-cast)
     string_type *value = entt::uninitialized_construct_using_allocator(reinterpret_cast<string_type *>(storage.data()), allocator, test::tracked_memory_resource::default_value);
 
     ASSERT_GT(memory_resource.do_allocate_counter(), 0u);

+ 0 - 8
test/entt/poly/poly.cpp

@@ -436,17 +436,13 @@ TYPED_TEST(Poly, SboAlignment) {
     std::array<poly_type, 2u> sbo = {over_aligned{}, over_aligned{}};
     const auto *data = sbo[0].data();
 
-    // NOLINTBEGIN(*-reinterpret-cast)
     ASSERT_TRUE((reinterpret_cast<std::uintptr_t>(sbo[0u].data()) % alignment) == 0u);
     ASSERT_TRUE((reinterpret_cast<std::uintptr_t>(sbo[1u].data()) % alignment) == 0u);
-    // NOLINTEND(*-reinterpret-cast)
 
     std::swap(sbo[0], sbo[1]);
 
-    // NOLINTBEGIN(*-reinterpret-cast)
     ASSERT_TRUE((reinterpret_cast<std::uintptr_t>(sbo[0u].data()) % alignment) == 0u);
     ASSERT_TRUE((reinterpret_cast<std::uintptr_t>(sbo[1u].data()) % alignment) == 0u);
-    // NOLINTEND(*-reinterpret-cast)
 
     ASSERT_NE(data, sbo[1].data());
 }
@@ -458,17 +454,13 @@ TYPED_TEST(Poly, NoSboAlignment) {
     std::array<poly_type, 2u> nosbo = {over_aligned{}, over_aligned{}};
     const auto *data = nosbo[0].data();
 
-    // NOLINTBEGIN(*-reinterpret-cast)
     ASSERT_TRUE((reinterpret_cast<std::uintptr_t>(nosbo[0u].data()) % alignment) == 0u);
     ASSERT_TRUE((reinterpret_cast<std::uintptr_t>(nosbo[1u].data()) % alignment) == 0u);
-    // NOLINTEND(*-reinterpret-cast)
 
     std::swap(nosbo[0], nosbo[1]);
 
-    // NOLINTBEGIN(*-reinterpret-cast)
     ASSERT_TRUE((reinterpret_cast<std::uintptr_t>(nosbo[0u].data()) % alignment) == 0u);
     ASSERT_TRUE((reinterpret_cast<std::uintptr_t>(nosbo[1u].data()) % alignment) == 0u);
-    // NOLINTEND(*-reinterpret-cast)
 
     ASSERT_EQ(data, nosbo[1].data());
 }