Browse Source

test. avoid warnings due to unused variables

Michele Caini 1 year ago
parent
commit
83495c967e
2 changed files with 3 additions and 3 deletions
  1. 2 2
      test/entt/entity/group.cpp
  2. 1 1
      test/entt/entity/registry.cpp

+ 2 - 2
test/entt/entity/group.cpp

@@ -403,7 +403,7 @@ TEST(NonOwningGroup, ConstNonConstAndAllInBetween) {
         testing::StaticAssertTypeEq<decltype(c), const char &>();
     });
 
-    for(auto [entt, iv, cv]: group.each()) {
+    for([[maybe_unused]] auto [entt, iv, cv]: group.each()) {
         testing::StaticAssertTypeEq<decltype(entt), entt::entity>();
         testing::StaticAssertTypeEq<decltype(iv), int &>();
         testing::StaticAssertTypeEq<decltype(cv), const char &>();
@@ -1211,7 +1211,7 @@ TEST(OwningGroup, ConstNonConstAndAllInBetween) {
         testing::StaticAssertTypeEq<decltype(f), const float &>();
     });
 
-    for(auto [entt, iv, cv, dv, fv]: group.each()) {
+    for([[maybe_unused]] auto [entt, iv, cv, dv, fv]: group.each()) {
         testing::StaticAssertTypeEq<decltype(entt), entt::entity>();
         testing::StaticAssertTypeEq<decltype(iv), int &>();
         testing::StaticAssertTypeEq<decltype(cv), const char &>();

+ 1 - 1
test/entt/entity/registry.cpp

@@ -452,7 +452,7 @@ TEST(Registry, RegistryStorageIteratorConversion) {
     registry.storage<int>();
 
     auto proxy = registry.storage();
-    auto cproxy = std::as_const(registry).storage();
+    [[maybe_unused]] auto cproxy = std::as_const(registry).storage();
 
     const typename decltype(proxy)::iterator it = proxy.begin();
     typename decltype(cproxy)::iterator cit = it;