34 lines
614 B
C++
34 lines
614 B
C++
#include <catch2/catch_test_macros.hpp>
|
|
#define CATCH_CONFIG_MAIN
|
|
#include <catch2/catch_all.hpp>
|
|
#include "../zecsy.hpp"
|
|
|
|
using namespace zecsy;
|
|
|
|
TEST_CASE("Create a single entity and verify its existence")
|
|
{
|
|
world w;
|
|
|
|
auto e = w.make_entity();
|
|
|
|
REQUIRE(w.is_alive(e));
|
|
}
|
|
|
|
TEST_CASE("Destroy an entity and ensure it no longer exists in the world")
|
|
{
|
|
world w;
|
|
|
|
auto e = w.make_entity();
|
|
w.destroy_entity(e);
|
|
|
|
REQUIRE_FALSE(w.is_alive(e));
|
|
}
|
|
|
|
TEST_CASE("Entity #0 should be reserved and never used")
|
|
{
|
|
world w;
|
|
|
|
auto e = w.make_entity();
|
|
|
|
REQUIRE(e != 0);
|
|
}
|