Przeglądaj źródła

test: removed unnecessary static functions

Michele Caini 5 lat temu
rodzic
commit
e376493970

+ 2 - 6
test/entt/meta/meta_base.cpp

@@ -14,7 +14,7 @@ struct derived_t: base_t {
 };
 
 struct MetaBase: ::testing::Test {
-    static void StaticSetUp() {
+    void SetUp() override {
         using namespace entt::literals;
 
         entt::meta<derived_t>()
@@ -22,10 +22,6 @@ struct MetaBase: ::testing::Test {
             .base<base_t>();
     }
 
-    void SetUp() override {
-        StaticSetUp();
-    }
-
     void TearDown() override {
         for(auto type: entt::resolve()) {
             type.reset();
@@ -52,7 +48,7 @@ TEST_F(MetaBase, Functionalities) {
 }
 
 TEST_F(MetaBase, ReRegistration) {
-    MetaBase::StaticSetUp();
+    SetUp();
 
     auto *node = entt::internal::meta_info<derived_t>::resolve();
 

+ 2 - 6
test/entt/meta/meta_conv.cpp

@@ -16,7 +16,7 @@ double conv_to_double(const clazz_t &instance) {
 }
 
 struct MetaConv: ::testing::Test {
-    static void StaticSetUp() {
+    void SetUp() override {
         using namespace entt::literals;
 
         entt::meta<clazz_t>()
@@ -25,10 +25,6 @@ struct MetaConv: ::testing::Test {
             .conv<&conv_to_double>();
     }
 
-    void SetUp() override {
-        StaticSetUp();
-    }
-
     void TearDown() override {
         for(auto type: entt::resolve()) {
             type.reset();
@@ -53,7 +49,7 @@ TEST_F(MetaConv, Functionalities) {
 }
 
 TEST_F(MetaConv, ReRegistration) {
-    MetaConv::StaticSetUp();
+    SetUp();
 
     auto *node = entt::internal::meta_info<clazz_t>::resolve();
 

+ 2 - 6
test/entt/meta/meta_ctor.cpp

@@ -33,7 +33,7 @@ struct clazz_t {
 double double_factory() { return 42.; }
 
 struct MetaCtor: ::testing::Test {
-    static void StaticSetUp() {
+    void SetUp() override {
         using namespace entt::literals;
 
         entt::meta<double>()
@@ -54,10 +54,6 @@ struct MetaCtor: ::testing::Test {
             .ctor<entt::overload<clazz_t(base_t, int, int)>(&clazz_t::factory)>();
     }
 
-    void SetUp() override {
-        StaticSetUp();
-    }
-
     void TearDown() override {
         for(auto type: entt::resolve()) {
             type.reset();
@@ -281,7 +277,7 @@ TEST_F(MetaCtor, NonDefaultConstructibleType) {
 }
 
 TEST_F(MetaCtor, ReRegistration) {
-    MetaCtor::StaticSetUp();
+    SetUp();
 
     auto *node = entt::internal::meta_info<double>::resolve();
 

+ 2 - 6
test/entt/meta/meta_data.cpp

@@ -65,7 +65,7 @@ enum class property_t {
 };
 
 struct MetaData: ::testing::Test {
-    static void StaticSetUp() {
+    void SetUp() override {
         using namespace entt::literals;
 
         entt::meta<double>()
@@ -109,10 +109,6 @@ struct MetaData: ::testing::Test {
         base_t::counter = 0;
     }
 
-    void SetUp() override {
-        StaticSetUp();
-    }
-
     void TearDown() override {
         for(auto type: entt::resolve()) {
             type.reset();
@@ -549,7 +545,7 @@ TEST_F(MetaData, FromBase) {
 TEST_F(MetaData, ReRegistration) {
     using namespace entt::literals;
 
-    MetaData::StaticSetUp();
+    SetUp();
 
     auto *node = entt::internal::meta_info<base_t>::resolve();
     auto type = entt::resolve<base_t>();

+ 2 - 6
test/entt/meta/meta_dtor.cpp

@@ -21,7 +21,7 @@ struct clazz_t {
 };
 
 struct MetaDtor: ::testing::Test {
-    static void StaticSetUp() {
+    void SetUp() override {
         using namespace entt::literals;
 
         entt::meta<clazz_t>()
@@ -31,10 +31,6 @@ struct MetaDtor: ::testing::Test {
         clazz_t::counter = 0;
     }
 
-    void SetUp() override {
-        StaticSetUp();
-    }
-
     void TearDown() override {
         for(auto type: entt::resolve()) {
             type.reset();
@@ -55,7 +51,7 @@ TEST_F(MetaDtor, Functionalities) {
 }
 
 TEST_F(MetaDtor, ReRegistration) {
-    MetaDtor::StaticSetUp();
+    SetUp();
 
     auto *node = entt::internal::meta_info<clazz_t>::resolve();
 

+ 3 - 7
test/entt/meta/meta_func.cpp

@@ -60,7 +60,7 @@ struct func_t {
 };
 
 struct MetaFunc: ::testing::Test {
-    static void StaticSetUp() {
+    void SetUp() override {
         using namespace entt::literals;
 
         entt::meta<double>()
@@ -93,10 +93,6 @@ struct MetaFunc: ::testing::Test {
         base_t::counter = 0;
     }
 
-    void SetUp() override {
-        StaticSetUp();
-    }
-
     void TearDown() override {
         for(auto type: entt::resolve()) {
             type.reset();
@@ -444,14 +440,14 @@ TEST_F(MetaFunc, ExternalMemberFunction) {
 TEST_F(MetaFunc, ReRegistration) {
     using namespace entt::literals;
 
-    auto reset_and_check = []() {
+    auto reset_and_check = [this]() {
         int count = 0;
 
         for([[maybe_unnused]] auto func: entt::resolve<func_t>().func()) {
             ++count;
         }
 
-        MetaFunc::StaticSetUp();
+        SetUp();
 
         for([[maybe_unnused]] auto func: entt::resolve<func_t>().func()) {
             --count;

+ 2 - 6
test/entt/meta/meta_prop.cpp

@@ -9,7 +9,7 @@ struct base_2_t {};
 struct derived_t: base_1_t, base_2_t {};
 
 struct MetaProp: ::testing::Test {
-    static void StaticSetUp() {
+    void SetUp() override {
         using namespace entt::literals;
 
         entt::meta<base_1_t>()
@@ -26,10 +26,6 @@ struct MetaProp: ::testing::Test {
             .base<base_2_t>();
     }
 
-    void SetUp() override {
-        StaticSetUp();
-    }
-
     void TearDown() override {
         for(auto type: entt::resolve()) {
             type.reset();
@@ -64,7 +60,7 @@ TEST_F(MetaProp, FromBase) {
 TEST_F(MetaProp, ReRegistration) {
     using namespace entt::literals;
 
-    MetaProp::StaticSetUp();
+    SetUp();
 
     auto *node = entt::internal::meta_info<base_1_t>::resolve();
     auto type = entt::resolve<base_1_t>();

+ 2 - 6
test/entt/meta/meta_type.cpp

@@ -92,7 +92,7 @@ union union_t {
 };
 
 struct MetaType: ::testing::Test {
-    static void StaticSetUp() {
+    void SetUp() override {
         using namespace entt::literals;
 
         entt::meta<double>()
@@ -154,10 +154,6 @@ struct MetaType: ::testing::Test {
             .func<&clazz_t::func>("func"_hs);
     }
 
-    void SetUp() override {
-        StaticSetUp();
-    }
-
     void TearDown() override {
         for(auto type: entt::resolve()) {
             type.reset();
@@ -680,7 +676,7 @@ TEST_F(MetaType, ReRegistration) {
         ++count;
     }
 
-    MetaType::StaticSetUp();
+    SetUp();
 
     for(auto type: entt::resolve()) {
         --count;