test: drop a bunch of NOLINT

This commit is contained in:
Michele Caini
2024-01-11 14:10:26 +01:00
parent 9708727269
commit 346165e4f9
7 changed files with 25 additions and 34 deletions

View File

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

View File

@@ -10,9 +10,9 @@ TEST(InputIteratorPointer, Functionalities) {
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.operator->(), &ptr.operator*());
}
@@ -46,7 +46,7 @@ TEST(IterableAdaptor, Functionalities) {
ASSERT_EQ(*++iterable.cbegin(), 2);
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);
}
}

View File

@@ -217,9 +217,9 @@ TEST(UninitializedConstructUsingAllocator, NoUsesAllocatorConstruction) {
alignas(int) std::byte storage[sizeof(int)]; // NOLINT
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)

View File

@@ -12,11 +12,11 @@ TEST(Monostate, Functionalities) {
ASSERT_EQ(i_pre, int{});
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 int &i_post = entt::monostate_v<entt::hashed_string{"foobar"}>;
ASSERT_TRUE(b_post);
ASSERT_EQ(i_post, 42);
ASSERT_EQ(i_post, 2);
}

View File

@@ -11,8 +11,8 @@ TEST(Tuple, IsTuple) {
}
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));
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(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(std::move(ref)), 42);
ASSERT_EQ(entt::unwrap_tuple(std::move(ref)), 2);
}
TEST(Tuple, ForwardApply) {
@@ -40,8 +40,8 @@ TEST(Tuple, ForwardApply) {
ASSERT_EQ(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(std::as_const(third)(std::make_tuple('a', 1)), 'b');

View File

@@ -31,7 +31,7 @@ struct clazz {
};
int free_function(int, const double &) {
return 42; // NOLINT
return 64;
}
template<typename, typename Type = void>
@@ -70,8 +70,8 @@ TEST_F(UnpackAsType, 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) {
@@ -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>>();
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) {
@@ -261,7 +261,7 @@ TEST(NthArgument, Functionalities) {
testing::StaticAssertTypeEq<entt::nth_argument_t<1u, decltype(&clazz::bar)>, float>();
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) {

View File

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