|
|
@@ -41,7 +41,7 @@ spec("input") { |
|
|
|
} |
|
|
|
|
|
|
|
it("sets initial state") { |
|
|
|
IZ_JoystickInitialize(&state, "config.ini", 0, NULL); |
|
|
|
IZ_JoystickInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
check(mock_is_called(SDL_memcpy), "Initial state not loaded."); |
|
|
|
check(mock_is_called(SDL_NumJoysticks), "Connected joysticks not checked."); |
|
|
@@ -50,7 +50,7 @@ spec("input") { |
|
|
|
it("calls load method") { |
|
|
|
mock_set_expected_calls(ini_getl, ((CONTROLS - 4) + 2) * IZ_PLAYERS); |
|
|
|
|
|
|
|
IZ_JoystickInitialize(&state, "config.ini", 0, NULL); |
|
|
|
IZ_JoystickInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
check( |
|
|
|
mock_get_expected_calls(ini_getl) == mock_get_actual_calls(ini_getl), |
|
|
@@ -63,7 +63,7 @@ spec("input") { |
|
|
|
it("calls save method") { |
|
|
|
mock_set_expected_calls(ini_putl, ((CONTROLS - 4) + 2) * IZ_PLAYERS); |
|
|
|
|
|
|
|
IZ_JoystickInitialize(&state, "config.ini", 0, NULL); |
|
|
|
IZ_JoystickInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
check( |
|
|
|
mock_get_expected_calls(ini_putl) == mock_get_actual_calls(ini_putl), |
|
|
@@ -76,7 +76,7 @@ spec("input") { |
|
|
|
it("opens device handles") { |
|
|
|
mock_set_expected_calls(SDL_JoystickOpen, MOCK_OPEN_JOYSTICKS); |
|
|
|
|
|
|
|
IZ_JoystickInitialize(&state, "config.ini", 0, NULL); |
|
|
|
IZ_JoystickInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
check( |
|
|
|
mock_get_expected_calls(SDL_JoystickOpen) == mock_get_actual_calls(SDL_JoystickOpen), |
|
|
@@ -351,7 +351,7 @@ spec("input") { |
|
|
|
it("calls save method") { |
|
|
|
mock_set_expected_calls(ini_putl, ((CONTROLS - 4) + 2) * IZ_PLAYERS); |
|
|
|
|
|
|
|
IZ_JoystickSaveConfig(&state, "config.ini"); |
|
|
|
IZ_JoystickSaveConfig(&state, "config-game.ini"); |
|
|
|
|
|
|
|
check( |
|
|
|
mock_get_expected_calls(ini_putl) == mock_get_actual_calls(ini_putl), |
|
|
@@ -416,7 +416,7 @@ spec("input") { |
|
|
|
} |
|
|
|
|
|
|
|
it("sets initial state") { |
|
|
|
IZ_KeyboardInitialize(&state, "config.ini", 0, NULL); |
|
|
|
IZ_KeyboardInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
check(mock_is_called(SDL_memcpy), "Initial state not loaded."); |
|
|
|
} |
|
|
@@ -424,7 +424,7 @@ spec("input") { |
|
|
|
it("calls load method") { |
|
|
|
mock_set_expected_calls(ini_gets, CONTROLS * IZ_PLAYERS); |
|
|
|
|
|
|
|
IZ_KeyboardInitialize(&state, "config.ini", 0, NULL); |
|
|
|
IZ_KeyboardInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
check( |
|
|
|
mock_get_expected_calls(ini_gets) == mock_get_actual_calls(ini_gets), |
|
|
@@ -437,7 +437,7 @@ spec("input") { |
|
|
|
it("calls save method") { |
|
|
|
mock_set_expected_calls(ini_puts, CONTROLS * IZ_PLAYERS); |
|
|
|
|
|
|
|
IZ_KeyboardInitialize(&state, "config.ini", 0, NULL); |
|
|
|
IZ_KeyboardInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
check( |
|
|
|
mock_get_expected_calls(ini_puts) == mock_get_actual_calls(ini_puts), |
|
|
@@ -504,7 +504,7 @@ spec("input") { |
|
|
|
it("calls save method") { |
|
|
|
mock_set_expected_calls(ini_puts, CONTROLS * IZ_PLAYERS); |
|
|
|
|
|
|
|
IZ_KeyboardSaveConfig("config.ini", &state); |
|
|
|
IZ_KeyboardSaveConfig("config-game.ini", &state); |
|
|
|
|
|
|
|
check( |
|
|
|
mock_get_expected_calls(ini_puts) == mock_get_actual_calls(ini_puts), |
|
|
@@ -549,7 +549,7 @@ spec("input") { |
|
|
|
} |
|
|
|
|
|
|
|
it("sets initial state") { |
|
|
|
IZ_MIDIInputInitialize(&state, "config.ini", 0, NULL); |
|
|
|
IZ_MIDIInputInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
check(mock_is_called(SDL_memcpy), "Initial state not loaded."); |
|
|
|
check(mock_is_called(Pm_CountDevices), "Connected MIDI devices not checked."); |
|
|
@@ -559,7 +559,7 @@ spec("input") { |
|
|
|
mock_set_expected_calls(ini_gets, CONTROLS * IZ_PLAYERS); |
|
|
|
mock_set_expected_calls(ini_getl, 2 * IZ_PLAYERS); |
|
|
|
|
|
|
|
IZ_MIDIInputInitialize(&state, "config.ini", 0, NULL); |
|
|
|
IZ_MIDIInputInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
check( |
|
|
|
mock_get_expected_calls(ini_gets) == mock_get_actual_calls(ini_gets), |
|
|
@@ -580,7 +580,7 @@ spec("input") { |
|
|
|
mock_set_expected_calls(ini_puts, CONTROLS * IZ_PLAYERS); |
|
|
|
mock_set_expected_calls(ini_putl, 2 * IZ_PLAYERS); |
|
|
|
|
|
|
|
IZ_MIDIInputInitialize(&state, "config.ini", 0, NULL); |
|
|
|
IZ_MIDIInputInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
check( |
|
|
|
mock_get_expected_calls(ini_puts) == mock_get_actual_calls(ini_puts), |
|
|
@@ -600,7 +600,7 @@ spec("input") { |
|
|
|
it("opens device handles") { |
|
|
|
mock_set_expected_calls(Pm_OpenInput, MOCK_OPEN_JOYSTICKS); |
|
|
|
|
|
|
|
IZ_MIDIInputInitialize(&state, "config.ini", 0, NULL); |
|
|
|
IZ_MIDIInputInitialize(&state, "config-game.ini", 0, NULL); |
|
|
|
|
|
|
|
check( |
|
|
|
mock_get_expected_calls(Pm_OpenInput) == mock_get_actual_calls(Pm_OpenInput), |
|
|
@@ -626,7 +626,7 @@ spec("input") { |
|
|
|
mock_set_expected_calls(ini_puts, CONTROLS * IZ_PLAYERS); |
|
|
|
mock_set_expected_calls(ini_putl, 2 * IZ_PLAYERS); |
|
|
|
|
|
|
|
IZ_MIDIInputSaveConfig("config.ini", &state); |
|
|
|
IZ_MIDIInputSaveConfig("config-game.ini", &state); |
|
|
|
|
|
|
|
check( |
|
|
|
mock_get_expected_calls(ini_puts) == mock_get_actual_calls(ini_puts), |
|
|
|