Jelajahi Sumber

test: suppress warnings + increase code coverage

Michele Caini 5 tahun lalu
induk
melakukan
4f93995bd7
2 mengubah file dengan 13 tambahan dan 1 penghapusan
  1. 12 0
      test/entt/meta/meta_func.cpp
  2. 1 1
      test/entt/meta/meta_type.cpp

+ 12 - 0
test/entt/meta/meta_func.cpp

@@ -442,8 +442,20 @@ TEST_F(MetaFunc, ExternalMemberFunction) {
 }
 }
 
 
 TEST_F(MetaFunc, ReRegistration) {
 TEST_F(MetaFunc, ReRegistration) {
+    int count = 0;
+
+    for([[maybe_unnused]] auto func: entt::resolve<func_t>().func()) {
+        ++count;
+    }
+
     MetaFunc::StaticSetUp();
     MetaFunc::StaticSetUp();
 
 
+    for([[maybe_unnused]] auto func: entt::resolve<func_t>().func()) {
+        --count;
+    }
+
+    ASSERT_EQ(count, 0);
+
     auto *node = entt::internal::meta_info<base_t>::resolve();
     auto *node = entt::internal::meta_info<base_t>::resolve();
 
 
     ASSERT_NE(node->func, nullptr);
     ASSERT_NE(node->func, nullptr);

+ 1 - 1
test/entt/meta/meta_type.cpp

@@ -674,7 +674,7 @@ TEST_F(MetaType, ClassTemplate) {
 TEST_F(MetaType, ReRegistration) {
 TEST_F(MetaType, ReRegistration) {
     int count = 0;
     int count = 0;
 
 
-    for(auto type: entt::resolve()) {
+    for([[maybe_unnused]] auto type: entt::resolve()) {
         ++count;
         ++count;
     }
     }