Sfoglia il codice sorgente

test: drop a bunch of NOLINT

Michele Caini 2 anni fa
parent
commit
31b2a2129c
2 ha cambiato i file con 17 aggiunte e 14 eliminazioni
  1. 5 2
      test/entt/resource/resource.cpp
  2. 12 12
      test/entt/resource/resource_cache.cpp

+ 5 - 2
test/entt/resource/resource.cpp

@@ -3,6 +3,7 @@
 #include <gtest/gtest.h>
 #include <entt/core/type_info.hpp>
 #include <entt/resource/resource.hpp>
+#include "../common/linter.hpp"
 
 struct base {
     virtual ~base() = default;
@@ -85,9 +86,10 @@ TEST(Resource, ConstNonConstAndAllInBetween) {
 
     entt::resource<const derived> copy{resource};
     entt::resource<const derived> move{std::move(other)};
+    test::is_initialized(other);
 
     ASSERT_TRUE(resource);
-    ASSERT_FALSE(other); // NOLINT
+    ASSERT_FALSE(other);
 
     ASSERT_TRUE(copy);
     ASSERT_EQ(copy, resource);
@@ -101,8 +103,9 @@ TEST(Resource, ConstNonConstAndAllInBetween) {
 
     copy = resource;
     move = std::move(resource);
+    test::is_initialized(resource);
 
-    ASSERT_FALSE(resource); // NOLINT
+    ASSERT_FALSE(resource);
     ASSERT_FALSE(other);
 
     ASSERT_TRUE(copy);

+ 12 - 12
test/entt/resource/resource_cache.cpp

@@ -94,15 +94,15 @@ TEST(ResourceCache, Copy) {
     using namespace entt::literals;
 
     entt::resource_cache<std::size_t> cache;
-    cache.load("resource"_hs, 42u); // NOLINT
+    cache.load("resource"_hs, 3u);
 
     entt::resource_cache<std::size_t> other{cache};
 
     ASSERT_TRUE(cache.contains("resource"_hs));
     ASSERT_TRUE(other.contains("resource"_hs));
 
-    cache.load("foo"_hs, 99u); // NOLINT
-    cache.load("bar"_hs, 77u); // NOLINT
+    cache.load("foo"_hs, 2u);
+    cache.load("bar"_hs, 1u);
     other.load("quux"_hs, 0u);
     other = cache;
 
@@ -111,16 +111,16 @@ TEST(ResourceCache, Copy) {
     ASSERT_TRUE(other.contains("bar"_hs));
     ASSERT_FALSE(other.contains("quux"_hs));
 
-    ASSERT_EQ(other["resource"_hs], 42u);
-    ASSERT_EQ(other["foo"_hs], 99u);
-    ASSERT_EQ(other["bar"_hs], 77u);
+    ASSERT_EQ(other["resource"_hs], 3u);
+    ASSERT_EQ(other["foo"_hs], 2u);
+    ASSERT_EQ(other["bar"_hs], 1u);
 }
 
 TEST(ResourceCache, Move) {
     using namespace entt::literals;
 
     entt::resource_cache<std::size_t> cache;
-    cache.load("resource"_hs, 42u); // NOLINT
+    cache.load("resource"_hs, 3u);
 
     entt::resource_cache<std::size_t> other{std::move(cache)};
 
@@ -128,8 +128,8 @@ TEST(ResourceCache, Move) {
     ASSERT_TRUE(other.contains("resource"_hs));
 
     cache = other;
-    cache.load("foo"_hs, 99u); // NOLINT
-    cache.load("bar"_hs, 77u); // NOLINT
+    cache.load("foo"_hs, 2u);
+    cache.load("bar"_hs, 1u);
     other.load("quux"_hs, 0u);
     other = std::move(cache);
 
@@ -139,9 +139,9 @@ TEST(ResourceCache, Move) {
     ASSERT_TRUE(other.contains("bar"_hs));
     ASSERT_FALSE(other.contains("quux"_hs));
 
-    ASSERT_EQ(other["resource"_hs], 42u);
-    ASSERT_EQ(other["foo"_hs], 99u);
-    ASSERT_EQ(other["bar"_hs], 77u);
+    ASSERT_EQ(other["resource"_hs], 3u);
+    ASSERT_EQ(other["foo"_hs], 2u);
+    ASSERT_EQ(other["bar"_hs], 1u);
 }
 
 TEST(ResourceCache, Iterator) {