|
123456789101112131415161718192021222324252627282930313233 |
- #ifndef SDL_JOYSTICK_MOCK_H
- #define SDL_JOYSTICK_MOCK_H
-
- #include <bdd-for-c-mocks.h>
- #include <SDL_joystick.h>
- #include "../../../src/packages/common/IZ_common.h"
-
- #define MOCK_OPEN_JOYSTICKS 1
-
- mock(SDL_JoystickOpen) SDL_Joystick* SDL_JoystickOpen(i32 device_index) {
- static void* joystick = (void*) 1;
- mock_return(SDL_JoystickOpen) (SDL_Joystick*) &joystick;
- }
-
- mock(SDL_NumJoysticks) i32 SDL_NumJoysticks(void) {
- mock_return(SDL_NumJoysticks) MOCK_OPEN_JOYSTICKS;
- }
-
- mock(SDL_JoystickInstanceID) i32 SDL_JoystickInstanceID(SDL_Joystick* joystick) {
- mock_return(SDL_JoystickInstanceID) 0;
- }
-
- mock(SDL_JoystickClose) void SDL_JoystickClose(SDL_Joystick* _joystick) {
- mock_return(SDL_JoystickClose);
- }
-
- mock(SDL_JoystickGetGUID) SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick* joystick) {
- mock_return(SDL_JoystickGetGUID) (SDL_JoystickGUID) {
- .data = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }
- };
- }
-
- #endif
|