From 3ad8fc6d2130bb05d43485e96defe35028f314af Mon Sep 17 00:00:00 2001 From: NukeBird Date: Sat, 22 Feb 2025 17:45:53 +0300 Subject: [PATCH] Typo --- tests/zecsy.cpp | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/zecsy.cpp b/tests/zecsy.cpp index e69c697..abaffd4 100644 --- a/tests/zecsy.cpp +++ b/tests/zecsy.cpp @@ -37,7 +37,7 @@ TEST_CASE("Entity #0 should be reserved and never used", "[test]") REQUIRE_FALSE(w.is_alive(0)); } -struct ChoosenOne +struct ChosenOne { }; @@ -48,7 +48,7 @@ TEST_CASE("Entity shouldn't have a component that wasn't attached to it", auto e = w.make_entity(); - REQUIRE_FALSE(w.has(e)); + REQUIRE_FALSE(w.has(e)); } TEST_CASE("Attempt of getting non-owned component should throw", "[test]") @@ -57,7 +57,7 @@ TEST_CASE("Attempt of getting non-owned component should throw", "[test]") auto e = w.make_entity(); - REQUIRE_THROWS(w.get(e)); + REQUIRE_THROWS(w.get(e)); } TEST_CASE("Attach a simple component to an entity and verify it is correctly " @@ -68,12 +68,12 @@ TEST_CASE("Attach a simple component to an entity and verify it is correctly " auto e1 = w.make_entity(); - w.set(e1, ChoosenOne{}); - REQUIRE(w.has(e1)); + w.set(e1, ChosenOne{}); + REQUIRE(w.has(e1)); auto e2 = w.make_entity(); - w.set(e2, ChoosenOne{}); - REQUIRE(w.has(e2)); + w.set(e2, ChosenOne{}); + REQUIRE(w.has(e2)); } struct Comp @@ -111,21 +111,21 @@ TEST_CASE( world w; auto e = w.make_entity(); - w.set(e, ChoosenOne{}); - REQUIRE_NOTHROW(w.remove(e)); + w.set(e, ChosenOne{}); + REQUIRE_NOTHROW(w.remove(e)); - REQUIRE_FALSE(w.has(e)); + REQUIRE_FALSE(w.has(e)); - w.set(e, ChoosenOne{}); - REQUIRE_NOTHROW(w.remove(e)); - REQUIRE_FALSE(w.has(e)); + w.set(e, ChosenOne{}); + REQUIRE_NOTHROW(w.remove(e)); + REQUIRE_FALSE(w.has(e)); } TEST_CASE("Addresses of removed components should be reused", "[test]") { world w; std::vector entities; - std::vector addr; + std::vector addr; const int N = 4; @@ -134,14 +134,14 @@ TEST_CASE("Addresses of removed components should be reused", "[test]") for(int j = 0; j < N; ++j) { entities.emplace_back(w.make_entity()); - w.set(entities.back()); + w.set(entities.back()); } if(addr.empty()) { for(int j = 0; j < N; ++j) { - addr.emplace_back(&w.get(entities[j])); + addr.emplace_back(&w.get(entities[j])); } } else @@ -153,13 +153,13 @@ TEST_CASE("Addresses of removed components should be reused", "[test]") for(int j = 0; j < N; ++j) { - REQUIRE(&w.get(entities[j]) == addr[j]); + REQUIRE(&w.get(entities[j]) == addr[j]); } } for(auto e: entities) { - w.remove(e); + w.remove(e); } entities.clear(); } @@ -172,14 +172,14 @@ TEST_CASE("Attach multiple components to an entity and verify all are " world w; auto e = w.make_entity(); - w.set(e, ChoosenOne{}, Comp{}); + w.set(e, ChosenOne{}, Comp{}); - REQUIRE(w.has(e)); + REQUIRE(w.has(e)); - w.remove(e); + w.remove(e); - REQUIRE_FALSE(w.has(e)); - REQUIRE_FALSE(w.has(e)); + REQUIRE_FALSE(w.has(e)); + REQUIRE_FALSE(w.has(e)); REQUIRE_FALSE(w.has(e)); }