Refactored automated rwops tests so read and write directories can be more easily customized.
The refactored tests were written in recognition that Mac and iPhone current working directories are usually not going to work. Resource directories are in bundles and write directories are restricted to certain areas. In theory, other platforms may have this problem too, hence the refactoring. Also updated the Xcode iPhone project to use 3.2 as the Base SDK, but 3.1 as the Deployment SDK (for iPhone/iPad compatibility.) --HG-- rename : test/automated/rwops/Test_rwopsbundlesupport.h => test/automated/rwops/TestSupportRWops.h rename : test/automated/rwops/Test_rwopsbundlesupport.m => test/automated/rwops/TestSupportRWops_Cocoa.m
This commit is contained in:
parent
4d5a9e42ba
commit
6c9da257a1
7 changed files with 102 additions and 58 deletions
28
test/automated/rwops/TestSupportRWops_Generic.c
Normal file
28
test/automated/rwops/TestSupportRWops_Generic.c
Normal file
|
@ -0,0 +1,28 @@
|
|||
/* Generic implementation for file opening routines.
|
||||
* Customizations for specific platforms should go in alternative files.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "SDL.h"
|
||||
|
||||
const char* RWOPS_READ = "rwops/read";
|
||||
const char* RWOPS_WRITE = "rwops/write";
|
||||
|
||||
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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue