Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions ZEngine/tests/ECS/SchedulerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ class SchedulerFixture : public ::testing::Test
TEST_F(SchedulerFixture, IndependentSystemsInSameWave)
{
// A writes Transform, B writes Velocity — no overlap → same wave
auto SystemA = [](Scene&, float, WorldCommands&) {};
auto SystemB = [](Scene&, float, WorldCommands&) {};
auto SystemA = [](Scene&, float, WorldCommands&) {};
auto SystemB = [](Scene&, float, WorldCommands&) {};

m_tick.RegisterSystem(SystemA, {.WriteMask = MaskBit(ComponentTypeOf<TransformComponent>())});
m_tick.RegisterSystem(SystemB, {.WriteMask = MaskBit(ComponentTypeOf<VelocityComponent>())});
const auto _A = m_tick.RegisterSystem(SystemA, {.WriteMask = MaskBit(ComponentTypeOf<TransformComponent>())});
const auto _B = m_tick.RegisterSystem(SystemB, {.WriteMask = MaskBit(ComponentTypeOf<VelocityComponent>())});
m_tick.Commit();

EXPECT_EQ(m_tick.WaveCount(), 1u);
Expand Down Expand Up @@ -113,11 +113,11 @@ TEST_F(SchedulerFixture, WriteBeforeReadOrderVerifiedViaState)
TEST_F(SchedulerFixture, WorldCommandsSpawnAppliedAfterTick)
{
static EntityID s_spawned;
s_spawned = INVALID_ENTITY;
s_spawned = INVALID_ENTITY;

auto Spawner = [](Scene&, float, WorldCommands& cmds) { cmds.SpawnEntity({&s_spawned, [](void* ctx, EntityID id) { *static_cast<EntityID*>(ctx) = id; }}); };
auto Spawner = [](Scene&, float, WorldCommands& cmds) { cmds.SpawnEntity({&s_spawned, [](void* ctx, EntityID id) { *static_cast<EntityID*>(ctx) = id; }}); };

m_tick.RegisterSystem(Spawner, {});
const auto _ = m_tick.RegisterSystem(Spawner, {});
m_tick.Commit();

m_tick.Tick(m_scene, 0.016f, m_commands);
Expand Down Expand Up @@ -168,8 +168,8 @@ TEST_F(SchedulerFixture, ParallelSystemsBothSpawn_BothEntitiesCreated)
auto SpawnerB = [](Scene&, float, WorldCommands& cmds) { cmds.SpawnEntity({nullptr, [](void*, EntityID) { s_spawn_count.fetch_add(1, std::memory_order_relaxed); }}); };

// Disjoint masks → same wave (no conflict, no OrderBefore required).
m_tick.RegisterSystem(SpawnerA, {.UsesCommands = true});
m_tick.RegisterSystem(SpawnerB, {.UsesCommands = true});
const auto _A = m_tick.RegisterSystem(SpawnerA, {.UsesCommands = true});
const auto _B = m_tick.RegisterSystem(SpawnerB, {.UsesCommands = true});
m_tick.Commit();

EXPECT_EQ(m_tick.WaveCount(), 1u);
Expand All @@ -193,8 +193,8 @@ TEST_F(SchedulerFixture, ParallelSpawnCallbacks_IndicesRemappedCorrectly)
auto SpawnerA = [](Scene&, float, WorldCommands& cmds) { cmds.SpawnEntity({&s_from_a, [](void* ctx, EntityID id) { *static_cast<EntityID*>(ctx) = id; }}); };
auto SpawnerB = [](Scene&, float, WorldCommands& cmds) { cmds.SpawnEntity({&s_from_b, [](void* ctx, EntityID id) { *static_cast<EntityID*>(ctx) = id; }}); };

m_tick.RegisterSystem(SpawnerA, {.UsesCommands = true});
m_tick.RegisterSystem(SpawnerB, {.UsesCommands = true});
const auto _A = m_tick.RegisterSystem(SpawnerA, {.UsesCommands = true});
const auto _B = m_tick.RegisterSystem(SpawnerB, {.UsesCommands = true});
m_tick.Commit();

s_from_a = INVALID_ENTITY;
Expand Down
4 changes: 2 additions & 2 deletions ZEngine/tests/Input/InputManager_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ TEST_F(InputManagerTest, GetCurrentFrame_InitialActionCountIsZero)

TEST_F(InputManagerTest, GetCurrentFrame_AfterRegistration_ActionCountUpdatedOnNextPoll)
{
input.RegisterAction("A", InputActionType::Button);
input.RegisterAction("B", InputActionType::Axis1D);
const auto _A = input.RegisterAction("A", InputActionType::Button);
const auto _B = input.RegisterAction("B", InputActionType::Axis1D);
// ActionCount in the frame is set by Poll; before Poll it reflects the
// previous Poll's count (0 since Poll hasn't run).
EXPECT_EQ(input.GetCurrentFrame().ActionCount, 0u);
Expand Down
4 changes: 2 additions & 2 deletions ZEngine/tests/VFS/vfs_meta_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class MetaFileIOTest : public ::testing::Test
m_manager.Initialize(ZMega(16), {});
m_backend.Initialize(&m_manager.MainArena);
m_ctx.Initialize(&m_manager.MainArena, 4);
m_ctx.Mount(&m_backend, VFSPath::Root(), 0);
const auto _ = m_ctx.Mount(&m_backend, VFSPath::Root(), 0);
}

void TearDown() override
Expand All @@ -50,7 +50,7 @@ class MetaFileIOTest : public ::testing::Test

void WriteRaw(const char* path, const char* content)
{
m_backend.WriteFile(P(path), Bytes(content, std::strlen(content)));
const auto _ = m_backend.WriteFile(P(path), Bytes(content, std::strlen(content)));
}

bool FileExists(const char* path)
Expand Down
Loading