test: removed unnecessary static functions

This commit is contained in:
Michele Caini
2021-03-09 12:17:00 +01:00
parent 08e2322d79
commit e376493970
8 changed files with 17 additions and 49 deletions

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -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>();

View File

@@ -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();

View File

@@ -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;

View File

@@ -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>();

View File

@@ -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;