Skip to content

Commit

Permalink
test: use default member init as needed
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Dec 21, 2023
1 parent 9b7aa49 commit 27698a2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 41 deletions.
5 changes: 1 addition & 4 deletions test/entt/meta/meta_any.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
#include "../common/non_comparable.h"

struct clazz_t {
clazz_t()
: value{0} {}

void member(int i) {
value = i;
}
Expand All @@ -27,7 +24,7 @@ struct clazz_t {
}

inline static char c = 'c';
int value;
int value{0};
};

struct empty_t {
Expand Down
5 changes: 1 addition & 4 deletions test/entt/meta/meta_ctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
15 changes: 2 additions & 13 deletions test/entt/meta/meta_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ struct derived_t: base_t {
};

struct clazz_t {
clazz_t()
: i{0},
j{1},
base{} {}

operator int() const {
return h;
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -89,7 +78,7 @@ struct multi_setter_t {
value = std::atoi(val);
}

int value;
int value{0};
};

struct array_t {
Expand Down
5 changes: 1 addition & 4 deletions test/entt/meta/meta_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
#include <entt/meta/meta.hpp>

struct clazz_t {
clazz_t()
: value{} {}

void incr() {
++value;
}
Expand All @@ -16,7 +13,7 @@ struct clazz_t {
--value;
}

int value;
int value{};
};

struct MetaHandle: ::testing::Test {
Expand Down
5 changes: 1 addition & 4 deletions test/entt/meta/meta_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
17 changes: 5 additions & 12 deletions test/entt/process/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 27698a2

Please sign in to comment.