diff --git a/Makefile b/Makefile index 9319a13..da39fe7 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ tracy_build: meson compile -j 10 -C builddir test: asset_build build - ./builddir/runtests "[spatialmap-neighbors]" + ./builddir/runtests -d yes run: build test ifeq '$(OS)' 'Windows_NT' diff --git a/tests/dinkyecs.cpp b/tests/dinkyecs.cpp index 4393956..7eec0c0 100644 --- a/tests/dinkyecs.cpp +++ b/tests/dinkyecs.cpp @@ -157,19 +157,15 @@ TEST_CASE("confirm that the event system works", "[ecs]") { // just count down and should get the same number while(world.has_event()) { + auto [event, entity, data] = world.recv(); + REQUIRE(event == GUIEvent::HIT); + REQUIRE(entity == player); + auto &str_data = std::any_cast(data); + REQUIRE(string{"hello"} == str_data); i--; } REQUIRE(i == 0); - - auto [event, entity, data] = world.recv(); - REQUIRE(event == GUIEvent::HIT); - REQUIRE(entity == player); - auto &str_data = std::any_cast(data); - REQUIRE(string{"hello"} == str_data); - - bool ready = world.has_event(); - REQUIRE(ready == false); }