diff options
author | sanine <sanine.not@pm.me> | 2021-10-21 21:33:06 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2021-10-21 21:33:06 -0500 |
commit | 9c238237597de90c73cc65c3fccf2f49bfaa46b4 (patch) | |
tree | bd7bb7846568e64104c63eba57a0adae1300d3ef /src/test/mock | |
parent | d356c9bb873092e9d8ed53ee5f15a560accbf5bb (diff) |
move test files to the same directories as the files they test
Diffstat (limited to 'src/test/mock')
-rw-r--r-- | src/test/mock/mock_GLFW.c | 39 | ||||
-rw-r--r-- | src/test/mock/mock_GLFW.h | 9 |
2 files changed, 48 insertions, 0 deletions
diff --git a/src/test/mock/mock_GLFW.c b/src/test/mock/mock_GLFW.c new file mode 100644 index 0000000..f1942fd --- /dev/null +++ b/src/test/mock/mock_GLFW.c @@ -0,0 +1,39 @@ +#include "minunit.h" +#include "test/mock_queue.h" +#include "mock_GLFW.h" + +void glfwGetVersion(int *major, int *minor, int *rev) +{ + *major = mock_front(int); + mock_pop(); + *minor = mock_front(int); + mock_pop(); + *rev = mock_front(int); + mock_pop(); +} + + +int glfwInit() +{ + int result = mock_front(int); + mock_pop(); + return result; +} + + +void glfwTerminate() +{ + mock_queue(bool, true); +} + + +int glfwGetError(const char **description) +{ + int error_code = mock_front(int); + mock_pop(); + if (description != NULL) { + *description = mock_front(const char *); + mock_pop(); + } + return error_code; +} diff --git a/src/test/mock/mock_GLFW.h b/src/test/mock/mock_GLFW.h new file mode 100644 index 0000000..d8689ab --- /dev/null +++ b/src/test/mock/mock_GLFW.h @@ -0,0 +1,9 @@ +#ifndef MOCK_GLFW_H +#define MOCK_GLFW_H + +void glfwGetVersion(int *major, int *minor, int *rev); +int glfwInit(); +void glfwTerminate(); +int glfwGetError(const char **description); + +#endif |