2D Run-and-gun shooter inspired by One Man's Doomsday, Counter-Strike, and Metal Slug.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

44 lines
1.3 KiB

  1. #ifndef SDL_JOYSTICK_MOCK_H
  2. #define SDL_JOYSTICK_MOCK_H
  3. #include <bdd-for-c-mocks.h>
  4. #include <SDL_joystick.h>
  5. #include <SDL_rwops.h>
  6. #include "../../../src/packages/common/IZ_common.h"
  7. #define MOCK_OPEN_JOYSTICKS 1
  8. mock(SDL_JoystickOpen) SDL_Joystick* SDL_JoystickOpen(i32 device_index) {
  9. static void* joystick = (void*) 1;
  10. mock_return(SDL_JoystickOpen) (SDL_Joystick*) &joystick;
  11. }
  12. mock(SDL_NumJoysticks) i32 SDL_NumJoysticks(void) {
  13. mock_return(SDL_NumJoysticks) MOCK_OPEN_JOYSTICKS;
  14. }
  15. mock(SDL_JoystickInstanceID) i32 SDL_JoystickInstanceID(SDL_Joystick* joystick) {
  16. mock_return(SDL_JoystickInstanceID) 0;
  17. }
  18. mock(SDL_JoystickClose) void SDL_JoystickClose(SDL_Joystick* _joystick) {
  19. mock_return(SDL_JoystickClose);
  20. }
  21. mock(SDL_JoystickGetGUID) SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick* joystick) {
  22. mock_return(SDL_JoystickGetGUID) (SDL_JoystickGUID) {
  23. .data = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }
  24. };
  25. }
  26. mock(SDL_GameControllerAddMappingsFromRW) int SDL_GameControllerAddMappingsFromRW(SDL_RWops *rw, int freerw) {
  27. mock_return(SDL_GameControllerAddMappingsFromRW) 0;
  28. }
  29. mock(SDL_JoystickFromInstanceID) SDL_Joystick* SDL_JoystickFromInstanceID(SDL_JoystickID instance_id) {
  30. static void* joystick = (void*) 1;
  31. mock_return(SDL_JoystickFromInstanceID) (SDL_Joystick*) &joystick;
  32. }
  33. #endif