diff --git a/test/test-automation/tests/testrwops/TestSupportRWops.h b/test/test-automation/tests/testrwops/TestSupportRWops.h new file mode 100644 index 000000000..110c00bf3 --- /dev/null +++ b/test/test-automation/tests/testrwops/TestSupportRWops.h @@ -0,0 +1,12 @@ +#ifndef TestSupportRWops_h +#define TestSupportRWops_h + +#include +#include + +FILE* TestSupportRWops_OpenFPFromReadDir(const char *file, const char *mode); +FILE* TestSupportRWops_OpenFPFromWriteDir(const char *file, const char *mode); +SDL_RWops* TestSupportRWops_OpenRWopsFromReadDir(const char *file, const char *mode); +SDL_RWops* TestSupportRWops_OpenRWopsFromWriteDir(const char *file, const char *mode); + +#endif diff --git a/test/test-automation/tests/testrwops/TestSupportRWops_Generic.c b/test/test-automation/tests/testrwops/TestSupportRWops_Generic.c new file mode 100644 index 000000000..1e267c80a --- /dev/null +++ b/test/test-automation/tests/testrwops/TestSupportRWops_Generic.c @@ -0,0 +1,31 @@ +/* Generic implementation for file opening routines. +* Customizations for specific platforms should go in alternative files. +*/ + +// quiet windows compiler warnings +#define _CRT_SECURE_NO_WARNINGS + +#include +#include + +#include "TestSupportRWops.h" + +FILE* TestSupportRWops_OpenFPFromReadDir(const char *file, const char *mode) +{ + return fopen(file, mode); +} + +FILE* TestSupportRWops_OpenFPFromWriteDir(const char *file, const char *mode) +{ + return fopen(file, mode); +} + +SDL_RWops* TestSupportRWops_OpenRWopsFromReadDir(const char *file, const char *mode) +{ + return SDL_RWFromFile(file, mode); +} + +SDL_RWops* TestSupportRWops_OpenRWopsFromWriteDir(const char *file, const char *mode) +{ + return SDL_RWFromFile(file, mode); +} diff --git a/test/test-automation/tests/testrwops/read b/test/test-automation/tests/testrwops/read new file mode 100644 index 000000000..c57eff55e --- /dev/null +++ b/test/test-automation/tests/testrwops/read @@ -0,0 +1 @@ +Hello World! \ No newline at end of file