Browse Source

test: avoid static global functions

Michele Caini 2 years ago
parent
commit
ef914bad8c
2 changed files with 10 additions and 2 deletions
  1. 5 1
      test/entt/poly/poly.cpp
  2. 5 1
      test/example/reserved_bits.cpp

+ 5 - 1
test/entt/poly/poly.cpp

@@ -45,10 +45,14 @@ struct common_members {
     }
 };
 
-static int absolutely_random() {
+namespace {
+
+[[nodiscard]] int absolutely_random() {
     return 42;
 }
 
+} // namespace
+
 template<typename Type>
 using common_impl = entt::value_list<
     &Type::incr,

+ 5 - 1
test/example/reserved_bits.cpp

@@ -22,10 +22,14 @@ struct entt::entt_traits<my_entity>: entt::basic_entt_traits<custom_entity_trait
     static constexpr std::size_t page_size = ENTT_SPARSE_PAGE;
 };
 
-static bool is_disabled(const my_entity entity) {
+namespace {
+
+[[nodiscard]] bool is_disabled(const my_entity entity) {
     return ((entity & my_entity::disabled) == my_entity::disabled);
 }
 
+} // namespace
+
 TEST(Example, DisabledEntity) {
     entt::basic_registry<my_entity> registry{};
     auto view = registry.view<my_entity, int>();