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.
 
 
 
 
 
 

54 line
1.3 KiB

  1. #ifndef SDL_RENDER_MOCK_H
  2. #define SDL_RENDER_MOCK_H
  3. #include "../src/packages/test/IZ_test.h"
  4. typedef struct SDL_Renderer SDL_Renderer;
  5. typedef struct SDL_Window SDL_Window;
  6. typedef struct SDL_FRect SDL_FRect;
  7. mock(SDL_CreateWindow) SDL_Window* SDL_CreateWindow(
  8. const char *title,
  9. int x, int y, int w,
  10. int h, unsigned int flags
  11. ) {
  12. static SDL_Window* window = (SDL_Window*) 1;
  13. mock_return(SDL_CreateWindow) window;
  14. }
  15. mock(SDL_CreateRenderer) SDL_Renderer* SDL_CreateRenderer(SDL_Window* window, int index, unsigned int flags) {
  16. static SDL_Renderer* renderer = (SDL_Renderer*) 1;
  17. mock_return(SDL_CreateRenderer) renderer;
  18. }
  19. mock(SDL_SetRenderDrawColor) int SDL_SetRenderDrawColor(
  20. SDL_Renderer* renderer,
  21. unsigned char r, unsigned char g, unsigned char b,
  22. unsigned char a
  23. ) {
  24. mock_return(SDL_SetRenderDrawColor) 0;
  25. }
  26. mock(SDL_RenderFillRectF) int SDL_RenderFillRectF(
  27. SDL_Renderer* renderer,
  28. const SDL_FRect* rect
  29. ) {
  30. mock_return(SDL_RenderFillRectF) 0;
  31. }
  32. mock(SDL_RenderClear) int SDL_RenderClear(SDL_Renderer* renderer) {
  33. mock_return(SDL_RenderClear) 0;
  34. }
  35. mock(SDL_RenderPresent) void SDL_RenderPresent(SDL_Renderer* renderer) {
  36. mock_return(SDL_RenderPresent);
  37. }
  38. mock(SDL_DestroyWindow) void SDL_DestroyWindow(SDL_Window* window) {
  39. mock_return(SDL_DestroyWindow);
  40. }
  41. #endif