Explorar o código

test: drop a bunch of NOLINT

Michele Caini %!s(int64=2) %!d(string=hai) anos
pai
achega
346165e4f9

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

@@ -85,7 +85,6 @@ TEST_F(Any, Empty) {
     entt::any any{};
     entt::any any{};
 
 
     ASSERT_FALSE(any);
     ASSERT_FALSE(any);
-    ASSERT_TRUE(any.owner()); // NOLINT
     ASSERT_EQ(any.policy(), entt::any_policy::owner);
     ASSERT_EQ(any.policy(), entt::any_policy::owner);
     ASSERT_EQ(any.type(), entt::type_id<void>());
     ASSERT_EQ(any.type(), entt::type_id<void>());
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
@@ -96,7 +95,6 @@ TEST_F(Any, SBOInPlaceTypeConstruction) {
     entt::any any{std::in_place_type<int>, 2};
     entt::any any{std::in_place_type<int>, 2};
 
 
     ASSERT_TRUE(any);
     ASSERT_TRUE(any);
-    ASSERT_TRUE(any.owner()); // NOLINT
     ASSERT_EQ(any.policy(), entt::any_policy::owner);
     ASSERT_EQ(any.policy(), entt::any_policy::owner);
     ASSERT_EQ(any.type(), entt::type_id<int>());
     ASSERT_EQ(any.type(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
@@ -105,7 +103,6 @@ TEST_F(Any, SBOInPlaceTypeConstruction) {
     auto other = any.as_ref();
     auto other = any.as_ref();
 
 
     ASSERT_TRUE(other);
     ASSERT_TRUE(other);
-    ASSERT_FALSE(other.owner()); // NOLINT
     ASSERT_EQ(other.policy(), entt::any_policy::ref);
     ASSERT_EQ(other.policy(), entt::any_policy::ref);
     ASSERT_EQ(other.type(), entt::type_id<int>());
     ASSERT_EQ(other.type(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<int>(other), 2);
     ASSERT_EQ(entt::any_cast<int>(other), 2);
@@ -117,7 +114,6 @@ TEST_F(Any, SBOAsRefConstruction) {
     entt::any any{entt::forward_as_any(value)};
     entt::any any{entt::forward_as_any(value)};
 
 
     ASSERT_TRUE(any);
     ASSERT_TRUE(any);
-    ASSERT_FALSE(any.owner()); // NOLINT
     ASSERT_EQ(any.policy(), entt::any_policy::ref);
     ASSERT_EQ(any.policy(), entt::any_policy::ref);
     ASSERT_EQ(any.type(), entt::type_id<int>());
     ASSERT_EQ(any.type(), entt::type_id<int>());
 
 
@@ -136,7 +132,6 @@ TEST_F(Any, SBOAsRefConstruction) {
     any.emplace<int &>(value);
     any.emplace<int &>(value);
 
 
     ASSERT_TRUE(any);
     ASSERT_TRUE(any);
-    ASSERT_FALSE(any.owner()); // NOLINT
     ASSERT_EQ(any.policy(), entt::any_policy::ref);
     ASSERT_EQ(any.policy(), entt::any_policy::ref);
     ASSERT_EQ(any.type(), entt::type_id<int>());
     ASSERT_EQ(any.type(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<int>(&any), &value);
     ASSERT_EQ(entt::any_cast<int>(&any), &value);
@@ -144,7 +139,6 @@ TEST_F(Any, SBOAsRefConstruction) {
     auto other = any.as_ref();
     auto other = any.as_ref();
 
 
     ASSERT_TRUE(other);
     ASSERT_TRUE(other);
-    ASSERT_FALSE(other.owner()); // NOLINT
     ASSERT_EQ(other.policy(), entt::any_policy::ref);
     ASSERT_EQ(other.policy(), entt::any_policy::ref);
     ASSERT_EQ(other.type(), entt::type_id<int>());
     ASSERT_EQ(other.type(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<int>(other), 2);
     ASSERT_EQ(entt::any_cast<int>(other), 2);
@@ -156,7 +150,6 @@ TEST_F(Any, SBOAsConstRefConstruction) {
     entt::any any{entt::forward_as_any(value)};
     entt::any any{entt::forward_as_any(value)};
 
 
     ASSERT_TRUE(any);
     ASSERT_TRUE(any);
-    ASSERT_FALSE(any.owner()); // NOLINT
     ASSERT_EQ(any.policy(), entt::any_policy::cref);
     ASSERT_EQ(any.policy(), entt::any_policy::cref);
     ASSERT_EQ(any.type(), entt::type_id<int>());
     ASSERT_EQ(any.type(), entt::type_id<int>());
 
 
@@ -175,7 +168,6 @@ TEST_F(Any, SBOAsConstRefConstruction) {
     any.emplace<const int &>(value);
     any.emplace<const int &>(value);
 
 
     ASSERT_TRUE(any);
     ASSERT_TRUE(any);
-    ASSERT_FALSE(any.owner()); // NOLINT
     ASSERT_EQ(any.policy(), entt::any_policy::cref);
     ASSERT_EQ(any.policy(), entt::any_policy::cref);
     ASSERT_EQ(any.type(), entt::type_id<int>());
     ASSERT_EQ(any.type(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<const int>(&any), &value);
     ASSERT_EQ(entt::any_cast<const int>(&any), &value);
@@ -183,7 +175,6 @@ TEST_F(Any, SBOAsConstRefConstruction) {
     auto other = any.as_ref();
     auto other = any.as_ref();
 
 
     ASSERT_TRUE(other);
     ASSERT_TRUE(other);
-    ASSERT_FALSE(other.owner()); // NOLINT
     ASSERT_EQ(other.policy(), entt::any_policy::cref);
     ASSERT_EQ(other.policy(), entt::any_policy::cref);
     ASSERT_EQ(other.type(), entt::type_id<int>());
     ASSERT_EQ(other.type(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<int>(other), 2);
     ASSERT_EQ(entt::any_cast<int>(other), 2);

+ 3 - 3
test/entt/core/iterator.cpp

@@ -10,9 +10,9 @@ TEST(InputIteratorPointer, Functionalities) {
 
 
     ASSERT_EQ(ptr->value, 0);
     ASSERT_EQ(ptr->value, 0);
 
 
-    ptr->value = 42; // NOLINT
+    ptr->value = 2;
 
 
-    ASSERT_EQ(ptr->value, 42);
+    ASSERT_EQ(ptr->value, 2);
     ASSERT_EQ(ptr->value, (*ptr).value);
     ASSERT_EQ(ptr->value, (*ptr).value);
     ASSERT_EQ(ptr.operator->(), &ptr.operator*());
     ASSERT_EQ(ptr.operator->(), &ptr.operator*());
 }
 }
@@ -46,7 +46,7 @@ TEST(IterableAdaptor, Functionalities) {
     ASSERT_EQ(*++iterable.cbegin(), 2);
     ASSERT_EQ(*++iterable.cbegin(), 2);
     ASSERT_EQ(++iterable.cbegin(), --iterable.end());
     ASSERT_EQ(++iterable.cbegin(), --iterable.end());
 
 
-    for(auto value: entt::iterable_adaptor<const int *, const void *>{vec.data(), vec.data() + 1u}) { // NOLINT
+    for(auto value: entt::iterable_adaptor<const int *, const void *>{&vec[0u], &vec[1u]}) {
         ASSERT_EQ(value, 1);
         ASSERT_EQ(value, 1);
     }
     }
 }
 }

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

@@ -217,9 +217,9 @@ TEST(UninitializedConstructUsingAllocator, NoUsesAllocatorConstruction) {
     alignas(int) std::byte storage[sizeof(int)]; // NOLINT
     alignas(int) std::byte storage[sizeof(int)]; // NOLINT
     const std::allocator<int> allocator{};
     const std::allocator<int> allocator{};
 
 
-    int *value = entt::uninitialized_construct_using_allocator(reinterpret_cast<int *>(&storage), allocator, 42); // NOLINT
+    int *value = entt::uninitialized_construct_using_allocator(reinterpret_cast<int *>(&storage), allocator, 1); // NOLINT
 
 
-    ASSERT_EQ(*value, 42);
+    ASSERT_EQ(*value, 1);
 }
 }
 
 
 #if defined(ENTT_HAS_TRACKED_MEMORY_RESOURCE)
 #if defined(ENTT_HAS_TRACKED_MEMORY_RESOURCE)

+ 2 - 2
test/entt/core/monostate.cpp

@@ -12,11 +12,11 @@ TEST(Monostate, Functionalities) {
     ASSERT_EQ(i_pre, int{});
     ASSERT_EQ(i_pre, int{});
 
 
     entt::monostate<"foobar"_hs>{} = true;
     entt::monostate<"foobar"_hs>{} = true;
-    entt::monostate_v<"foobar"_hs> = 42; // NOLINT
+    entt::monostate_v<"foobar"_hs> = 2;
 
 
     const bool &b_post = entt::monostate<"foobar"_hs>{};
     const bool &b_post = entt::monostate<"foobar"_hs>{};
     const int &i_post = entt::monostate_v<entt::hashed_string{"foobar"}>;
     const int &i_post = entt::monostate_v<entt::hashed_string{"foobar"}>;
 
 
     ASSERT_TRUE(b_post);
     ASSERT_TRUE(b_post);
-    ASSERT_EQ(i_post, 42);
+    ASSERT_EQ(i_post, 2);
 }
 }

+ 6 - 6
test/entt/core/tuple.cpp

@@ -11,8 +11,8 @@ TEST(Tuple, IsTuple) {
 }
 }
 
 
 TEST(Tuple, UnwrapTuple) {
 TEST(Tuple, UnwrapTuple) {
-    auto single = std::make_tuple(42);     // NOLINT
-    auto multi = std::make_tuple(42, 'c'); // NOLINT
+    auto single = std::make_tuple(2);
+    auto multi = std::make_tuple(2, 'c');
     auto ref = std::forward_as_tuple(std::get<0>(single));
     auto ref = std::forward_as_tuple(std::get<0>(single));
 
 
     testing::StaticAssertTypeEq<decltype(entt::unwrap_tuple(single)), int &>();
     testing::StaticAssertTypeEq<decltype(entt::unwrap_tuple(single)), int &>();
@@ -27,9 +27,9 @@ TEST(Tuple, UnwrapTuple) {
     testing::StaticAssertTypeEq<decltype(entt::unwrap_tuple(std::as_const(multi))), const std::tuple<int, char> &>();
     testing::StaticAssertTypeEq<decltype(entt::unwrap_tuple(std::as_const(multi))), const std::tuple<int, char> &>();
     testing::StaticAssertTypeEq<decltype(entt::unwrap_tuple(std::as_const(ref))), int &>();
     testing::StaticAssertTypeEq<decltype(entt::unwrap_tuple(std::as_const(ref))), int &>();
 
 
-    ASSERT_EQ(entt::unwrap_tuple(single), 42);
+    ASSERT_EQ(entt::unwrap_tuple(single), 2);
     ASSERT_EQ(entt::unwrap_tuple(multi), multi);
     ASSERT_EQ(entt::unwrap_tuple(multi), multi);
-    ASSERT_EQ(entt::unwrap_tuple(std::move(ref)), 42);
+    ASSERT_EQ(entt::unwrap_tuple(std::move(ref)), 2);
 }
 }
 
 
 TEST(Tuple, ForwardApply) {
 TEST(Tuple, ForwardApply) {
@@ -40,8 +40,8 @@ TEST(Tuple, ForwardApply) {
     ASSERT_EQ(first(std::make_tuple()), 0u);
     ASSERT_EQ(first(std::make_tuple()), 0u);
     ASSERT_EQ(std::as_const(first)(std::make_tuple()), 0u);
     ASSERT_EQ(std::as_const(first)(std::make_tuple()), 0u);
 
 
-    ASSERT_EQ(second(std::make_tuple(42)), 42);
-    ASSERT_EQ(std::as_const(second)(std::make_tuple(42)), 42);
+    ASSERT_EQ(second(std::make_tuple(2)), 2);
+    ASSERT_EQ(std::as_const(second)(std::make_tuple(2)), 2);
 
 
     ASSERT_EQ(third(std::make_tuple('a', 1)), 'b');
     ASSERT_EQ(third(std::make_tuple('a', 1)), 'b');
     ASSERT_EQ(std::as_const(third)(std::make_tuple('a', 1)), 'b');
     ASSERT_EQ(std::as_const(third)(std::make_tuple('a', 1)), 'b');

+ 9 - 9
test/entt/core/type_traits.cpp

@@ -31,7 +31,7 @@ struct clazz {
 };
 };
 
 
 int free_function(int, const double &) {
 int free_function(int, const double &) {
-    return 42; // NOLINT
+    return 64;
 }
 }
 
 
 template<typename, typename Type = void>
 template<typename, typename Type = void>
@@ -70,8 +70,8 @@ TEST_F(UnpackAsType, Functionalities) {
 }
 }
 
 
 TEST_F(UnpackAsValue, Functionalities) {
 TEST_F(UnpackAsValue, Functionalities) {
-    ASSERT_EQ((this->test_for<2>()('c', 42., true)), 6);
-    ASSERT_EQ((this->test_for<true>()('c', 42.)), 2);
+    ASSERT_EQ((this->test_for<2>()('c', 1., true)), 6);
+    ASSERT_EQ((this->test_for<true>()('c', 2.)), 2);
 }
 }
 
 
 TEST(IntegralConstant, Functionalities) {
 TEST(IntegralConstant, Functionalities) {
@@ -162,12 +162,12 @@ TEST(ValueList, Functionalities) {
     testing::StaticAssertTypeEq<entt::value_list_diff_t<entt::value_list<0, 1, 2>, entt::value_list<1>>, entt::value_list<0, 2>>();
     testing::StaticAssertTypeEq<entt::value_list_diff_t<entt::value_list<0, 1, 2>, entt::value_list<1>>, entt::value_list<0, 2>>();
 
 
     ASSERT_EQ((std::tuple_size_v<entt::value_list<>>), 0u);
     ASSERT_EQ((std::tuple_size_v<entt::value_list<>>), 0u);
-    ASSERT_EQ((std::tuple_size_v<entt::value_list<42>>), 1u);
-    ASSERT_EQ((std::tuple_size_v<entt::value_list<42, 'a'>>), 2u);
+    ASSERT_EQ((std::tuple_size_v<entt::value_list<4>>), 1u);
+    ASSERT_EQ((std::tuple_size_v<entt::value_list<4, 'a'>>), 2u);
 
 
-    testing::StaticAssertTypeEq<int, std::tuple_element_t<0, entt::value_list<42>>>();       // NOLINT
-    testing::StaticAssertTypeEq<int, std::tuple_element_t<0, entt::value_list<42, 'a'>>>();  // NOLINT
-    testing::StaticAssertTypeEq<char, std::tuple_element_t<1, entt::value_list<42, 'a'>>>(); // NOLINT
+    testing::StaticAssertTypeEq<int, std::tuple_element_t<0, entt::value_list<4>>>();
+    testing::StaticAssertTypeEq<int, std::tuple_element_t<0, entt::value_list<4, 'a'>>>();
+    testing::StaticAssertTypeEq<char, std::tuple_element_t<1, entt::value_list<4, 'a'>>>();
 }
 }
 
 
 TEST(IsApplicable, Functionalities) {
 TEST(IsApplicable, Functionalities) {
@@ -261,7 +261,7 @@ TEST(NthArgument, Functionalities) {
     testing::StaticAssertTypeEq<entt::nth_argument_t<1u, decltype(&clazz::bar)>, float>();
     testing::StaticAssertTypeEq<entt::nth_argument_t<1u, decltype(&clazz::bar)>, float>();
     testing::StaticAssertTypeEq<entt::nth_argument_t<0u, decltype(&clazz::quux)>, bool>();
     testing::StaticAssertTypeEq<entt::nth_argument_t<0u, decltype(&clazz::quux)>, bool>();
 
 
-    ASSERT_EQ(free_function(entt::nth_argument_t<0u, decltype(&free_function)>{}, entt::nth_argument_t<1u, decltype(&free_function)>{}), 42);
+    ASSERT_EQ(free_function(entt::nth_argument_t<0u, decltype(&free_function)>{}, entt::nth_argument_t<1u, decltype(&free_function)>{}), 64);
 }
 }
 
 
 TEST(Tag, Functionalities) {
 TEST(Tag, Functionalities) {

+ 3 - 3
test/entt/core/utility.cpp

@@ -13,7 +13,7 @@ struct functions {
 
 
 TEST(Identity, Functionalities) {
 TEST(Identity, Functionalities) {
     const entt::identity identity;
     const entt::identity identity;
-    int value = 42; // NOLINT
+    int value = 2;
 
 
     ASSERT_TRUE(entt::is_transparent_v<entt::identity>);
     ASSERT_TRUE(entt::is_transparent_v<entt::identity>);
     ASSERT_EQ(identity(value), value);
     ASSERT_EQ(identity(value), value);
@@ -44,10 +44,10 @@ TEST(Overloaded, Functionalities) {
         [&iv](int value) { iv = value; },
         [&iv](int value) { iv = value; },
         [&cv](char value) { cv = value; }};
         [&cv](char value) { cv = value; }};
 
 
-    func(42); // NOLINT
+    func(2);
     func('c');
     func('c');
 
 
-    ASSERT_EQ(iv, 42); // NOLINT
+    ASSERT_EQ(iv, 2);
     ASSERT_EQ(cv, 'c');
     ASSERT_EQ(cv, 'c');
 }
 }