build: review example tests

This commit is contained in:
skypjack
2025-12-24 10:26:01 +01:00
parent 9bcd14f31f
commit 1f7efe511d
5 changed files with 104 additions and 94 deletions

View File

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