|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #ifndef SDL_RENDER_MOCK_H
- #define SDL_RENDER_MOCK_H
-
- #include "../src/packages/test/IZ_test.h"
-
- typedef struct SDL_Renderer SDL_Renderer;
-
- typedef struct SDL_Window SDL_Window;
-
- typedef struct SDL_FRect SDL_FRect;
-
- mock(SDL_CreateWindow) SDL_Window* SDL_CreateWindow(
- const char *title,
- int x, int y, int w,
- int h, unsigned int flags
- ) {
- static SDL_Window* window = (SDL_Window*) 1;
- mock_return(SDL_CreateWindow) window;
- }
-
- mock(SDL_CreateRenderer) SDL_Renderer* SDL_CreateRenderer(SDL_Window* window, int index, unsigned int flags) {
- static SDL_Renderer* renderer = (SDL_Renderer*) 1;
- mock_return(SDL_CreateRenderer) renderer;
- }
-
- mock(SDL_SetRenderDrawColor) int SDL_SetRenderDrawColor(
- SDL_Renderer* renderer,
- unsigned char r, unsigned char g, unsigned char b,
- unsigned char a
- ) {
- mock_return(SDL_SetRenderDrawColor) 0;
- }
-
- mock(SDL_RenderFillRectF) int SDL_RenderFillRectF(
- SDL_Renderer* renderer,
- const SDL_FRect* rect
- ) {
- mock_return(SDL_RenderFillRectF) 0;
- }
-
- mock(SDL_RenderClear) int SDL_RenderClear(SDL_Renderer* renderer) {
- mock_return(SDL_RenderClear) 0;
- }
-
- mock(SDL_RenderPresent) void SDL_RenderPresent(SDL_Renderer* renderer) {
- mock_return(SDL_RenderPresent);
- }
-
- mock(SDL_DestroyWindow) void SDL_DestroyWindow(SDL_Window* window) {
- mock_return(SDL_DestroyWindow);
- }
-
- #endif
|