From c45ec22ff8f55cad55e36c068dfec6466e274030 Mon Sep 17 00:00:00 2001 From: TheoryOfNekomata Date: Thu, 16 Feb 2023 15:48:01 +0800 Subject: [PATCH] Update input test Ensure states are loaded and initialized to defaults. --- src/packages/game/input/input.test.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/packages/game/input/input.test.c b/src/packages/game/input/input.test.c index de2074a..af57d77 100644 --- a/src/packages/game/input/input.test.c +++ b/src/packages/game/input/input.test.c @@ -24,9 +24,9 @@ spec("input") { describe("Initialize") { static IZ_JoystickState state[IZ_PLAYERS]; -// after_each() { -// mock_reset(IZ_memcpy); -// } + after_each() { + mock_reset(IZ_memcpy); + } after_each() { mock_reset(SDL_NumJoysticks); @@ -47,7 +47,7 @@ spec("input") { it("sets initial state") { IZ_JoystickInitialize(&state, IZ_CONFIG_GAME_PATH, 0, NULL); -// check(mock_is_called(IZ_memcpy), "Initial state not loaded."); + check(mock_is_called(IZ_memcpy), "Initial state not loaded."); check(mock_is_called(SDL_NumJoysticks), "Connected joysticks not checked."); } @@ -378,9 +378,9 @@ spec("input") { describe("Initialize") { static IZ_KeyboardState state[IZ_PLAYERS] = {}; -// after_each() { -// mock_reset(IZ_memcpy); -// } + after_each() { + mock_reset(IZ_memcpy); + } after_each() { mock_reset(IZ_ConfigInitialize); @@ -401,7 +401,7 @@ spec("input") { it("sets initial state") { IZ_KeyboardInitialize(&state, IZ_CONFIG_GAME_PATH, 0, NULL); -// check(mock_is_called(IZ_memcpy), "Initial state not loaded."); + check(mock_is_called(IZ_memcpy), "Initial state not loaded."); } it("calls load method") { @@ -482,9 +482,9 @@ spec("input") { describe("Initialize") { static IZ_MIDIInputState state[IZ_PLAYERS]; -// after_each() { -// mock_reset(IZ_memcpy); -// } + after_each() { + mock_reset(IZ_memcpy); + } after_each() { mock_reset(Pm_CountDevices); @@ -513,7 +513,7 @@ spec("input") { it("sets initial state") { IZ_MIDIInputInitialize(&state, IZ_CONFIG_GAME_PATH, 0, NULL); -// check(mock_is_called(IZ_memcpy), "Initial state not loaded."); + check(mock_is_called(IZ_memcpy), "Initial state not loaded."); check(mock_is_called(Pm_CountDevices), "Connected MIDI devices not checked."); }