|
|
@@ -1,66 +0,0 @@ |
|
|
|
#include "../../../__mocks__/minIni.mock.h" |
|
|
|
#include "../__mocks__/IZ_config.mock.h" |
|
|
|
#include "IZ_video.h" |
|
|
|
|
|
|
|
spec("output/video") { |
|
|
|
describe("LoadVideoConfig") { |
|
|
|
static IZ_VideoConfig config; |
|
|
|
|
|
|
|
after_each() { |
|
|
|
mock_reset(IZ_GetConfigPath); |
|
|
|
} |
|
|
|
|
|
|
|
after_each() { |
|
|
|
mock_reset(ini_getl); |
|
|
|
} |
|
|
|
|
|
|
|
it("calls load method") { |
|
|
|
mock_set_expected_calls(ini_getl, 3); |
|
|
|
|
|
|
|
IZ_LoadVideoConfig(&config); |
|
|
|
|
|
|
|
check( |
|
|
|
mock_is_called(IZ_GetConfigPath), |
|
|
|
"SDL_GetBasePath() not called." |
|
|
|
); |
|
|
|
|
|
|
|
check( |
|
|
|
mock_get_expected_calls(ini_getl) == mock_get_actual_calls(ini_getl), |
|
|
|
"Call count mismatch for ini_getl() (expected %u, received %u).", |
|
|
|
mock_get_expected_calls(ini_getl), |
|
|
|
mock_get_actual_calls(ini_getl) |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
describe("SaveVideoConfig") { |
|
|
|
static IZ_VideoConfig config; |
|
|
|
|
|
|
|
after_each() { |
|
|
|
mock_reset(IZ_GetConfigPath); |
|
|
|
} |
|
|
|
|
|
|
|
after_each() { |
|
|
|
mock_reset(ini_putl); |
|
|
|
} |
|
|
|
|
|
|
|
before_each() { |
|
|
|
config.width = 1337; |
|
|
|
config.height = 420; |
|
|
|
config.max_fps = 69; |
|
|
|
} |
|
|
|
|
|
|
|
it("calls save method") { |
|
|
|
mock_set_expected_calls(ini_putl, 3); |
|
|
|
|
|
|
|
IZ_SaveVideoConfig(&config); |
|
|
|
|
|
|
|
check( |
|
|
|
mock_get_expected_calls(ini_putl) == mock_get_actual_calls(ini_putl), |
|
|
|
"Call count mismatch for ini_putl() (expected %u, received %u).", |
|
|
|
mock_get_expected_calls(ini_putl), |
|
|
|
mock_get_actual_calls(ini_putl) |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} |