From c0dbbbf2f6860074b5b6b251b4732f9e381ddd0a Mon Sep 17 00:00:00 2001 From: David Delassus Date: Sat, 27 Jan 2024 20:49:43 +0100 Subject: [PATCH] :white_check_mark: fix unit test --- tests/game-loop.spec.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/game-loop.spec.cpp b/tests/game-loop.spec.cpp index 7039d5a..c0f8af7 100644 --- a/tests/game-loop.spec.cpp +++ b/tests/game-loop.spec.cpp @@ -28,15 +28,16 @@ TEST_CASE("game_loop") { auto gs = game_state{}; auto l1 = listener{.gs = gs, .val = 1}; auto l2 = listener{.gs = gs, .val = 2}; + auto loop = tw::game_loop{}; - auto loop = tw::game_loop{} + loop .on_setup<&listener::on_setup>(l1) .on_teardown<&listener::on_teardown>(l1) .on_update<&listener::on_update>(l1) .on_setup<&listener::on_setup>(l2) - .on_teardown<&listener::on_teardown>(l2); + .on_teardown<&listener::on_teardown>(l2) + .run(); - loop.run(); CHECK(gs.setup == 2); CHECK(gs.teardown == 1); }