|
@@ -42,7 +42,7 @@ spec("input") { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
it("sets initial state") { |
|
|
it("sets initial state") { |
|
|
IZ_JoystickInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
|
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."); |
|
|
check(mock_is_called(SDL_NumJoysticks), "Connected joysticks not checked."); |
|
@@ -51,7 +51,7 @@ spec("input") { |
|
|
it("calls load method") { |
|
|
it("calls load method") { |
|
|
mock_set_expected_calls(ini_getl, ((IZ_CONTROLS - 4) + 2) * IZ_PLAYERS); |
|
|
mock_set_expected_calls(ini_getl, ((IZ_CONTROLS - 4) + 2) * IZ_PLAYERS); |
|
|
|
|
|
|
|
|
IZ_JoystickInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
|
IZ_JoystickInitialize(&state, IZ_CONFIG_GAME_PATH, 0, NULL); |
|
|
|
|
|
|
|
|
check( |
|
|
check( |
|
|
mock_get_expected_calls(ini_getl) == mock_get_actual_calls(ini_getl), |
|
|
mock_get_expected_calls(ini_getl) == mock_get_actual_calls(ini_getl), |
|
@@ -64,7 +64,7 @@ spec("input") { |
|
|
it("calls save method") { |
|
|
it("calls save method") { |
|
|
mock_set_expected_calls(ini_putl, ((IZ_CONTROLS - 4) + 2) * IZ_PLAYERS); |
|
|
mock_set_expected_calls(ini_putl, ((IZ_CONTROLS - 4) + 2) * IZ_PLAYERS); |
|
|
|
|
|
|
|
|
IZ_JoystickInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
|
IZ_JoystickInitialize(&state, IZ_CONFIG_GAME_PATH, 0, NULL); |
|
|
|
|
|
|
|
|
check( |
|
|
check( |
|
|
mock_get_expected_calls(ini_putl) == mock_get_actual_calls(ini_putl), |
|
|
mock_get_expected_calls(ini_putl) == mock_get_actual_calls(ini_putl), |
|
@@ -77,7 +77,7 @@ spec("input") { |
|
|
it("opens device handles") { |
|
|
it("opens device handles") { |
|
|
mock_set_expected_calls(SDL_JoystickOpen, MOCK_OPEN_JOYSTICKS); |
|
|
mock_set_expected_calls(SDL_JoystickOpen, MOCK_OPEN_JOYSTICKS); |
|
|
|
|
|
|
|
|
IZ_JoystickInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
|
IZ_JoystickInitialize(&state, IZ_CONFIG_GAME_PATH, 0, NULL); |
|
|
|
|
|
|
|
|
check( |
|
|
check( |
|
|
mock_get_expected_calls(SDL_JoystickOpen) == mock_get_actual_calls(SDL_JoystickOpen), |
|
|
mock_get_expected_calls(SDL_JoystickOpen) == mock_get_actual_calls(SDL_JoystickOpen), |
|
@@ -352,7 +352,7 @@ spec("input") { |
|
|
it("calls save method") { |
|
|
it("calls save method") { |
|
|
mock_set_expected_calls(ini_putl, ((IZ_CONTROLS - 4) + 2) * IZ_PLAYERS); |
|
|
mock_set_expected_calls(ini_putl, ((IZ_CONTROLS - 4) + 2) * IZ_PLAYERS); |
|
|
|
|
|
|
|
|
IZ_JoystickSaveConfig(&state, "config-game.ini"); |
|
|
|
|
|
|
|
|
IZ_JoystickSaveConfig(&state, IZ_CONFIG_GAME_PATH); |
|
|
|
|
|
|
|
|
check( |
|
|
check( |
|
|
mock_get_expected_calls(ini_putl) == mock_get_actual_calls(ini_putl), |
|
|
mock_get_expected_calls(ini_putl) == mock_get_actual_calls(ini_putl), |
|
@@ -417,7 +417,7 @@ spec("input") { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
it("sets initial state") { |
|
|
it("sets initial state") { |
|
|
IZ_KeyboardInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
|
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."); |
|
|
} |
|
|
} |
|
@@ -425,7 +425,7 @@ spec("input") { |
|
|
it("calls load method") { |
|
|
it("calls load method") { |
|
|
mock_set_expected_calls(ini_gets, IZ_CONTROLS * IZ_PLAYERS); |
|
|
mock_set_expected_calls(ini_gets, IZ_CONTROLS * IZ_PLAYERS); |
|
|
|
|
|
|
|
|
IZ_KeyboardInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
|
IZ_KeyboardInitialize(&state, IZ_CONFIG_GAME_PATH, 0, NULL); |
|
|
|
|
|
|
|
|
check( |
|
|
check( |
|
|
mock_get_expected_calls(ini_gets) == mock_get_actual_calls(ini_gets), |
|
|
mock_get_expected_calls(ini_gets) == mock_get_actual_calls(ini_gets), |
|
@@ -438,7 +438,7 @@ spec("input") { |
|
|
it("calls save method") { |
|
|
it("calls save method") { |
|
|
mock_set_expected_calls(ini_puts, IZ_CONTROLS * IZ_PLAYERS); |
|
|
mock_set_expected_calls(ini_puts, IZ_CONTROLS * IZ_PLAYERS); |
|
|
|
|
|
|
|
|
IZ_KeyboardInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
|
IZ_KeyboardInitialize(&state, IZ_CONFIG_GAME_PATH, 0, NULL); |
|
|
|
|
|
|
|
|
check( |
|
|
check( |
|
|
mock_get_expected_calls(ini_puts) == mock_get_actual_calls(ini_puts), |
|
|
mock_get_expected_calls(ini_puts) == mock_get_actual_calls(ini_puts), |
|
@@ -505,7 +505,7 @@ spec("input") { |
|
|
it("calls save method") { |
|
|
it("calls save method") { |
|
|
mock_set_expected_calls(ini_puts, IZ_CONTROLS * IZ_PLAYERS); |
|
|
mock_set_expected_calls(ini_puts, IZ_CONTROLS * IZ_PLAYERS); |
|
|
|
|
|
|
|
|
IZ_KeyboardSaveConfig("config-game.ini", &state); |
|
|
|
|
|
|
|
|
IZ_KeyboardSaveConfig(IZ_CONFIG_GAME_PATH, &state); |
|
|
|
|
|
|
|
|
check( |
|
|
check( |
|
|
mock_get_expected_calls(ini_puts) == mock_get_actual_calls(ini_puts), |
|
|
mock_get_expected_calls(ini_puts) == mock_get_actual_calls(ini_puts), |
|
@@ -550,7 +550,7 @@ spec("input") { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
it("sets initial state") { |
|
|
it("sets initial state") { |
|
|
IZ_MIDIInputInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
|
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."); |
|
|
check(mock_is_called(Pm_CountDevices), "Connected MIDI devices not checked."); |
|
@@ -560,7 +560,7 @@ spec("input") { |
|
|
mock_set_expected_calls(ini_gets, IZ_CONTROLS * IZ_PLAYERS); |
|
|
mock_set_expected_calls(ini_gets, IZ_CONTROLS * IZ_PLAYERS); |
|
|
mock_set_expected_calls(ini_getl, 2 * IZ_PLAYERS); |
|
|
mock_set_expected_calls(ini_getl, 2 * IZ_PLAYERS); |
|
|
|
|
|
|
|
|
IZ_MIDIInputInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
|
IZ_MIDIInputInitialize(&state, IZ_CONFIG_GAME_PATH, 0, NULL); |
|
|
|
|
|
|
|
|
check( |
|
|
check( |
|
|
mock_get_expected_calls(ini_gets) == mock_get_actual_calls(ini_gets), |
|
|
mock_get_expected_calls(ini_gets) == mock_get_actual_calls(ini_gets), |
|
@@ -581,7 +581,7 @@ spec("input") { |
|
|
mock_set_expected_calls(ini_puts, IZ_CONTROLS * IZ_PLAYERS); |
|
|
mock_set_expected_calls(ini_puts, IZ_CONTROLS * IZ_PLAYERS); |
|
|
mock_set_expected_calls(ini_putl, 2 * IZ_PLAYERS); |
|
|
mock_set_expected_calls(ini_putl, 2 * IZ_PLAYERS); |
|
|
|
|
|
|
|
|
IZ_MIDIInputInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
|
IZ_MIDIInputInitialize(&state, IZ_CONFIG_GAME_PATH, 0, NULL); |
|
|
|
|
|
|
|
|
check( |
|
|
check( |
|
|
mock_get_expected_calls(ini_puts) == mock_get_actual_calls(ini_puts), |
|
|
mock_get_expected_calls(ini_puts) == mock_get_actual_calls(ini_puts), |
|
@@ -601,7 +601,7 @@ spec("input") { |
|
|
it("opens device handles") { |
|
|
it("opens device handles") { |
|
|
mock_set_expected_calls(Pm_OpenInput, MOCK_OPEN_JOYSTICKS); |
|
|
mock_set_expected_calls(Pm_OpenInput, MOCK_OPEN_JOYSTICKS); |
|
|
|
|
|
|
|
|
IZ_MIDIInputInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
|
IZ_MIDIInputInitialize(&state, IZ_CONFIG_GAME_PATH, 0, NULL); |
|
|
|
|
|
|
|
|
check( |
|
|
check( |
|
|
mock_get_expected_calls(Pm_OpenInput) == mock_get_actual_calls(Pm_OpenInput), |
|
|
mock_get_expected_calls(Pm_OpenInput) == mock_get_actual_calls(Pm_OpenInput), |
|
@@ -627,7 +627,7 @@ spec("input") { |
|
|
mock_set_expected_calls(ini_puts, IZ_CONTROLS * IZ_PLAYERS); |
|
|
mock_set_expected_calls(ini_puts, IZ_CONTROLS * IZ_PLAYERS); |
|
|
mock_set_expected_calls(ini_putl, 2 * IZ_PLAYERS); |
|
|
mock_set_expected_calls(ini_putl, 2 * IZ_PLAYERS); |
|
|
|
|
|
|
|
|
IZ_MIDIInputSaveConfig("config-game.ini", &state); |
|
|
|
|
|
|
|
|
IZ_MIDIInputSaveConfig(IZ_CONFIG_GAME_PATH, &state); |
|
|
|
|
|
|
|
|
check( |
|
|
check( |
|
|
mock_get_expected_calls(ini_puts) == mock_get_actual_calls(ini_puts), |
|
|
mock_get_expected_calls(ini_puts) == mock_get_actual_calls(ini_puts), |
|
|