From 5d5b972d0be5fa9ee86377164da0f275f7244589 Mon Sep 17 00:00:00 2001 From: Markus Kauppila Date: Wed, 10 Aug 2011 17:01:22 +0300 Subject: [PATCH] Fixing previous commit. Forgot to add a few files. --- .../tests/testrwops/TestSupportRWops.h | 12 +++++++ .../testrwops/TestSupportRWops_Generic.c | 31 +++++++++++++++++++ test/test-automation/tests/testrwops/read | 1 + 3 files changed, 44 insertions(+) create mode 100644 test/test-automation/tests/testrwops/TestSupportRWops.h create mode 100644 test/test-automation/tests/testrwops/TestSupportRWops_Generic.c create mode 100644 test/test-automation/tests/testrwops/read 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