build: review example tests
This commit is contained in:
@@ -3,30 +3,32 @@
|
||||
#include <entt/entity/entity.hpp>
|
||||
#include <entt/entity/registry.hpp>
|
||||
|
||||
struct entity_id final {
|
||||
using entity_type = std::uint32_t;
|
||||
static constexpr auto null = entt::null;
|
||||
struct CustomIdentifier: testing::Test {
|
||||
struct entity_id final {
|
||||
using entity_type = std::uint32_t;
|
||||
static constexpr auto null = entt::null;
|
||||
|
||||
constexpr entity_id(entity_type value = null) noexcept
|
||||
: entt{value} {}
|
||||
constexpr entity_id(entity_type value = null) noexcept
|
||||
: entt{value} {}
|
||||
|
||||
~entity_id() = default;
|
||||
~entity_id() = default;
|
||||
|
||||
constexpr entity_id(const entity_id &other) = default;
|
||||
constexpr entity_id(entity_id &&other) noexcept = default;
|
||||
constexpr entity_id(const entity_id &other) = default;
|
||||
constexpr entity_id(entity_id &&other) noexcept = default;
|
||||
|
||||
constexpr entity_id &operator=(const entity_id &other) = default;
|
||||
constexpr entity_id &operator=(entity_id &&other) noexcept = default;
|
||||
constexpr entity_id &operator=(const entity_id &other) = default;
|
||||
constexpr entity_id &operator=(entity_id &&other) noexcept = default;
|
||||
|
||||
constexpr operator entity_type() const noexcept {
|
||||
return entt;
|
||||
}
|
||||
constexpr operator entity_type() const noexcept {
|
||||
return entt;
|
||||
}
|
||||
|
||||
private:
|
||||
entity_type entt;
|
||||
private:
|
||||
entity_type entt;
|
||||
};
|
||||
};
|
||||
|
||||
TEST(Example, CustomIdentifier) {
|
||||
TEST_F(CustomIdentifier, Example) {
|
||||
entt::basic_registry<entity_id> registry{};
|
||||
entity_id entity{};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user