Ver Fonte

test: use shared empty type

Michele Caini há 2 anos atrás
pai
commit
3c8ddbb0a5
1 ficheiros alterados com 5 adições e 6 exclusões
  1. 5 6
      test/entt/meta/meta_utility.cpp

+ 5 - 6
test/entt/meta/meta_utility.cpp

@@ -6,6 +6,7 @@
 #include <entt/meta/resolve.hpp>
 #include <entt/meta/utility.hpp>
 #include "../common/config.h"
+#include "../common/empty.h"
 
 struct clazz {
     void setter(int v) {
@@ -45,8 +46,6 @@ struct clazz {
     inline static int arr[3u]{};
 };
 
-struct dummy {};
-
 struct MetaUtility: ::testing::Test {
     void SetUp() override {
         clazz::value = 0;
@@ -206,8 +205,8 @@ TEST_F(MetaUtility, MetaInvokeWithCandidate) {
     const auto setter = [](int &value) { value = 3; };
     const auto getter = [](int value) { return value * 2; };
 
-    ASSERT_TRUE(entt::meta_invoke<dummy>({}, setter, args + 1u));
-    ASSERT_EQ(entt::meta_invoke<dummy>({}, getter, args + 1u).cast<int>(), 6);
+    ASSERT_TRUE(entt::meta_invoke<test::empty>({}, setter, args + 1u));
+    ASSERT_EQ(entt::meta_invoke<test::empty>({}, getter, args + 1u).cast<int>(), 6);
 }
 
 TEST_F(MetaUtility, MetaInvoke) {
@@ -251,8 +250,8 @@ TEST_F(MetaUtility, MetaConstructWithCandidate) {
     const auto setter = [](int &value) { value = 3; };
     const auto builder = [](int value) { return value * 2; };
 
-    ASSERT_TRUE(entt::meta_construct<dummy>(setter, args + 1u));
-    ASSERT_EQ(entt::meta_construct<dummy>(builder, args + 1u).cast<int>(), 6);
+    ASSERT_TRUE(entt::meta_construct<test::empty>(setter, args + 1u));
+    ASSERT_EQ(entt::meta_construct<test::empty>(builder, args + 1u).cast<int>(), 6);
 }
 
 TEST_F(MetaUtility, MetaConstruct) {