test: suppress non-const global variable warnings by the linter

This commit is contained in:
Michele Caini
2024-01-09 16:26:34 +01:00
parent 4e9cc9773d
commit f920a84ac0
9 changed files with 19 additions and 20 deletions

View File

@@ -5,7 +5,6 @@ Checks: >
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-const-or-ref-data-members,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-pro-*,
misc-*,
-misc-no-recursion,

View File

@@ -25,7 +25,7 @@ struct empty {
++counter;
}
inline static int counter = 0;
inline static int counter = 0; // NOLINT
};
struct fat {
@@ -43,7 +43,7 @@ struct fat {
return std::equal(std::begin(value), std::end(value), std::begin(other.value), std::end(other.value));
}
inline static int counter{0};
inline static int counter{0}; // NOLINT
double value[4];
};

View File

@@ -24,7 +24,7 @@ struct clazz_t {
return value;
}
inline static char c = 'c';
inline static char c = 'c'; // NOLINT
int value{0};
};
@@ -42,8 +42,8 @@ struct empty_t {
++destroy_counter;
}
inline static int destroy_counter = 0;
inline static int destructor_counter = 0;
inline static int destroy_counter = 0; // NOLINT
inline static int destructor_counter = 0; // NOLINT
};
struct fat_t: empty_t {

View File

@@ -50,7 +50,7 @@ struct clazz: base {
}
int value{};
inline static int bucket{};
inline static int bucket{}; // NOLINT
};
struct argument {
@@ -137,7 +137,7 @@ public:
entt::meta_reset();
}
[[nodiscard]] const entt::meta_ctx& ctx() const noexcept {
[[nodiscard]] const entt::meta_ctx &ctx() const noexcept {
return context;
}

View File

@@ -21,7 +21,7 @@ struct base_t {
++counter;
}
inline static int counter = 0;
inline static int counter = 0; // NOLINT
int value{3};
};
@@ -37,8 +37,8 @@ struct clazz_t {
int i{0};
const int j{1};
base_t base{};
inline static int h{2};
inline static const int k{3};
inline static int h{2}; // NOLINT
inline static const int k{3}; // NOLINT
};
struct setter_getter_t {
@@ -82,7 +82,7 @@ struct multi_setter_t {
};
struct array_t {
inline static int global[3];
inline static int global[3]; // NOLINT
int local[5];
};

View File

@@ -21,7 +21,7 @@ struct clazz_t {
++counter;
}
inline static int counter = 0;
inline static int counter = 0; // NOLINT
};
struct MetaDtor: ::testing::Test {

View File

@@ -31,7 +31,7 @@ struct base_t {
ref.value = v;
}
inline static int counter = 0;
inline static int counter = 0; // NOLINT
int value{3};
};
@@ -86,7 +86,7 @@ struct func_t {
return value;
}
inline static int value = 0;
inline static int value = 0; // NOLINT
};
double double_member(const double &value) {

View File

@@ -41,9 +41,9 @@ struct clazz {
int member{};
const int cmember{};
inline static int value{};
inline static const int cvalue{};
inline static int arr[3u]{};
inline static int value{}; // NOLINT
inline static const int cvalue{}; // NOLINT
inline static int arr[3u]{}; // NOLINT
};
struct MetaUtility: ::testing::Test {

View File

@@ -27,7 +27,7 @@ struct succeeded_process: entt::process<succeeded_process, entt::scheduler::delt
succeed();
}
inline static unsigned int invoked;
inline static unsigned int invoked; // NOLINT
};
struct failed_process: entt::process<failed_process, entt::scheduler::delta_type> {
@@ -36,7 +36,7 @@ struct failed_process: entt::process<failed_process, entt::scheduler::delta_type
fail();
}
inline static unsigned int invoked;
inline static unsigned int invoked; // NOLINT
};
struct Scheduler: ::testing::Test {