Prechádzať zdrojové kódy

test: use default member init as needed

Michele Caini 2 rokov pred
rodič
commit
27698a2a0a

+ 1 - 4
test/entt/meta/meta_any.cpp

@@ -11,9 +11,6 @@
 #include "../common/non_comparable.h"
 
 struct clazz_t {
-    clazz_t()
-        : value{0} {}
-
     void member(int i) {
         value = i;
     }
@@ -27,7 +24,7 @@ struct clazz_t {
     }
 
     inline static char c = 'c';
-    int value;
+    int value{0};
 };
 
 struct empty_t {

+ 1 - 4
test/entt/meta/meta_ctor.cpp

@@ -11,10 +11,7 @@
 #include <entt/meta/resolve.hpp>
 
 struct base_t {
-    base_t()
-        : value{'c'} {}
-
-    char value;
+    char value{'c'};
 };
 
 struct derived_t: base_t {

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

@@ -30,11 +30,6 @@ struct derived_t: base_t {
 };
 
 struct clazz_t {
-    clazz_t()
-        : i{0},
-          j{1},
-          base{} {}
-
     operator int() const {
         return h;
     }
@@ -47,9 +42,6 @@ struct clazz_t {
 };
 
 struct setter_getter_t {
-    setter_getter_t()
-        : value{0} {}
-
     int setter(double val) {
         return value = static_cast<int>(val);
     }
@@ -74,13 +66,10 @@ struct setter_getter_t {
         return type.value;
     }
 
-    int value;
+    int value{0};
 };
 
 struct multi_setter_t {
-    multi_setter_t()
-        : value{0} {}
-
     void from_double(double val) {
         value = static_cast<int>(val);
     }
@@ -89,7 +78,7 @@ struct multi_setter_t {
         value = std::atoi(val);
     }
 
-    int value;
+    int value{0};
 };
 
 struct array_t {

+ 1 - 4
test/entt/meta/meta_handle.cpp

@@ -5,9 +5,6 @@
 #include <entt/meta/meta.hpp>
 
 struct clazz_t {
-    clazz_t()
-        : value{} {}
-
     void incr() {
         ++value;
     }
@@ -16,7 +13,7 @@ struct clazz_t {
         --value;
     }
 
-    int value;
+    int value{};
 };
 
 struct MetaHandle: ::testing::Test {

+ 1 - 4
test/entt/meta/meta_type.cpp

@@ -30,10 +30,7 @@ Type get(Type &prop) {
 }
 
 struct base_t {
-    base_t()
-        : value{'c'} {};
-
-    char value;
+    char value{'c'};
 };
 
 struct derived_t: base_t {

+ 5 - 12
test/entt/process/process.cpp

@@ -9,13 +9,6 @@ struct fake_process: entt::process<fake_process<Delta>, Delta> {
     using process_type = entt::process<fake_process<Delta>, Delta>;
     using delta_type = typename process_type::delta_type;
 
-    fake_process()
-        : init_invoked{false},
-          update_invoked{false},
-          succeeded_invoked{false},
-          failed_invoked{false},
-          aborted_invoked{false} {}
-
     void succeed() noexcept {
         process_type::succeed();
     }
@@ -56,11 +49,11 @@ struct fake_process: entt::process<fake_process<Delta>, Delta> {
         update_invoked = true;
     }
 
-    bool init_invoked;
-    bool update_invoked;
-    bool succeeded_invoked;
-    bool failed_invoked;
-    bool aborted_invoked;
+    bool init_invoked{};
+    bool update_invoked{};
+    bool succeeded_invoked{};
+    bool failed_invoked{};
+    bool aborted_invoked{};
 };
 
 TEST(Process, Basics) {