Просмотр исходного кода

test: suppress warnings for unused variables

Michele Caini 5 лет назад
Родитель
Сommit
8ec7e3cc97
2 измененных файлов с 7 добавлено и 7 удалено
  1. 4 4
      test/entt/meta/meta_func.cpp
  2. 3 3
      test/entt/meta/meta_type.cpp

+ 4 - 4
test/entt/meta/meta_func.cpp

@@ -443,14 +443,14 @@ TEST_F(MetaFunc, ReRegistration) {
     auto reset_and_check = [this]() {
         int count = 0;
 
-        for([[maybe_unnused]] auto func: entt::resolve<func_t>().func()) {
-            ++count;
+        for(auto func: entt::resolve<func_t>().func()) {
+            count += static_cast<bool>(func);
         }
 
         SetUp();
 
-        for([[maybe_unnused]] auto func: entt::resolve<func_t>().func()) {
-            --count;
+        for(auto func: entt::resolve<func_t>().func()) {
+            count -= static_cast<bool>(func);
         }
 
         ASSERT_EQ(count, 0);

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

@@ -672,14 +672,14 @@ TEST_F(MetaType, ReRegistration) {
 
     int count = 0;
 
-    for([[maybe_unnused]] auto type: entt::resolve()) {
-        ++count;
+    for(auto type: entt::resolve()) {
+        count += static_cast<bool>(type);
     }
 
     SetUp();
 
     for(auto type: entt::resolve()) {
-        --count;
+        count -= static_cast<bool>(type);
     }
 
     ASSERT_EQ(count, 0);