Sfoglia il codice sorgente

test: try to get around an issue of msvc

Michele Caini 2 anni fa
parent
commit
94b3944003
1 ha cambiato i file con 14 aggiunte e 9 eliminazioni
  1. 14 9
      test/entt/entity/storage_no_instance.cpp

+ 14 - 9
test/entt/entity/storage_no_instance.cpp

@@ -75,9 +75,10 @@ TYPED_TEST(StorageNoInstance, Emplace) {
 
     testing::StaticAssertTypeEq<decltype(pool.emplace({})), void>();
 
-    ASSERT_NO_FATAL_FAILURE(pool.emplace(entity[0u]));
-
-    if constexpr(!std::is_void_v<value_type>) {
+    if constexpr(std::is_void_v<value_type>) {
+        ASSERT_NO_FATAL_FAILURE(pool.emplace(entity[0u]));
+    } else {
+        ASSERT_NO_FATAL_FAILURE(pool.emplace(entity[0u]));
         ASSERT_NO_FATAL_FAILURE(pool.emplace(entity[1u], value_type{}));
     }
 }
@@ -90,10 +91,12 @@ ENTT_DEBUG_TYPED_TEST(StorageNoInstanceDeathTest, Emplace) {
 
     testing::StaticAssertTypeEq<decltype(pool.emplace({})), void>();
 
-    ASSERT_NO_FATAL_FAILURE(pool.emplace(entity));
-    ASSERT_DEATH(pool.emplace(entity), "");
+    pool.emplace(entity);
 
-    if constexpr(!std::is_void_v<value_type>) {
+    if constexpr(std::is_void_v<value_type>) {
+        ASSERT_DEATH(pool.emplace(entity), "");
+    } else {
+        ASSERT_DEATH(pool.emplace(entity), "");
         ASSERT_DEATH(pool.emplace(entity, value_type{}), "");
     }
 }
@@ -190,12 +193,14 @@ ENTT_DEBUG_TYPED_TEST(StorageNoInstanceDeathTest, Insert) {
 
     const entt::entity entity[2u]{entt::entity{3}, entt::entity{42}};
 
-    ASSERT_NO_FATAL_FAILURE(pool.insert(std::begin(entity), std::end(entity)));
-    ASSERT_DEATH(pool.insert(std::begin(entity), std::end(entity)), "");
+    pool.insert(std::begin(entity), std::end(entity));
 
-    if constexpr(!std::is_void_v<value_type>) {
+    if constexpr(std::is_void_v<value_type>) {
+        ASSERT_DEATH(pool.insert(std::begin(entity), std::end(entity)), "");
+    } else {
         const value_type values[2u]{};
 
+        ASSERT_DEATH(pool.insert(std::begin(entity), std::end(entity)), "");
         ASSERT_DEATH(pool.insert(std::begin(entity), std::end(entity), std::begin(values)), "");
     }
 }