From 5f73b2e4f2b1704d03b0ee3cf43898f6f3a2ab97 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Mon, 22 Jan 2024 09:49:59 +0100 Subject: [PATCH] test: boxed_int -> boxed_type --- TODO | 1 - test/entt/common/boxed_int.h | 16 ---------------- test/entt/common/boxed_type.h | 20 ++++++++++++++++++++ test/entt/core/algorithm.cpp | 2 +- test/entt/core/iterator.cpp | 2 +- test/entt/entity/component.cpp | 2 +- test/entt/entity/group.cpp | 2 +- test/entt/entity/view.cpp | 2 +- 8 files changed, 25 insertions(+), 22 deletions(-) delete mode 100644 test/entt/common/boxed_int.h create mode 100644 test/entt/common/boxed_type.h diff --git a/TODO b/TODO index 369c525ab..4b6761f66 100644 --- a/TODO +++ b/TODO @@ -27,6 +27,5 @@ TODO: * review assure conflicts check, hash doesn't fit the purpose maybe * allow to zero-sized versions (with non-regression tests) * auto type info data from types if present -* boxed_int -> boxed_type with known specializations * sparse set sort_as should return the length to be a proper drop-in replacement for pack (then review registry destroy) * group review: use handler as base with protected members and arrays of common type (see view for further details) diff --git a/test/entt/common/boxed_int.h b/test/entt/common/boxed_int.h deleted file mode 100644 index 8148c3096..000000000 --- a/test/entt/common/boxed_int.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef ENTT_COMMON_BOXED_INT_H -#define ENTT_COMMON_BOXED_INT_H - -namespace test { - -struct boxed_int { - int value{}; -}; - -inline bool operator==(const boxed_int &lhs, const boxed_int &rhs) { - return lhs.value == rhs.value; -} - -} // namespace test - -#endif diff --git a/test/entt/common/boxed_type.h b/test/entt/common/boxed_type.h new file mode 100644 index 000000000..e6b84fa8c --- /dev/null +++ b/test/entt/common/boxed_type.h @@ -0,0 +1,20 @@ +#ifndef ENTT_COMMON_BOXED_TYPE_H +#define ENTT_COMMON_BOXED_TYPE_H + +namespace test { + +template +struct boxed_type { + Type value{}; +}; + +template +inline bool operator==(const boxed_type &lhs, const boxed_type &rhs) { + return lhs.value == rhs.value; +} + +using boxed_int = boxed_type; + +} // namespace test + +#endif diff --git a/test/entt/core/algorithm.cpp b/test/entt/core/algorithm.cpp index a951559b3..c747ac748 100644 --- a/test/entt/core/algorithm.cpp +++ b/test/entt/core/algorithm.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "../common/boxed_int.h" +#include "../common/boxed_type.h" TEST(Algorithm, StdSort) { // well, I'm pretty sure it works, it's std::sort!! diff --git a/test/entt/core/iterator.cpp b/test/entt/core/iterator.cpp index 22d06ffda..b7b8718f1 100644 --- a/test/entt/core/iterator.cpp +++ b/test/entt/core/iterator.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "../common/boxed_int.h" +#include "../common/boxed_type.h" TEST(InputIteratorPointer, Functionalities) { entt::input_iterator_pointer ptr{test::boxed_int{0}}; diff --git a/test/entt/entity/component.cpp b/test/entt/entity/component.cpp index aa7cab5f2..7b4eb0145 100644 --- a/test/entt/entity/component.cpp +++ b/test/entt/entity/component.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "../common/boxed_int.h" +#include "../common/boxed_type.h" #include "../common/empty.h" #include "../common/non_movable.h" diff --git a/test/entt/entity/group.cpp b/test/entt/entity/group.cpp index 35978583a..e9f6416ee 100644 --- a/test/entt/entity/group.cpp +++ b/test/entt/entity/group.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "../common/boxed_int.h" +#include "../common/boxed_type.h" #include "../common/config.h" #include "../common/empty.h" diff --git a/test/entt/entity/view.cpp b/test/entt/entity/view.cpp index 5cbc8492d..d21d26620 100644 --- a/test/entt/entity/view.cpp +++ b/test/entt/entity/view.cpp @@ -11,7 +11,7 @@ #include #include #include -#include "../common/boxed_int.h" +#include "../common/boxed_type.h" #include "../common/empty.h" #include "../common/pointer_stable.h"