SDL
2.0
|
Go to the source code of this file.
Macros | |
#define | _CRT_SECURE_NO_WARNINGS |
Functions | |
void | RWopsSetUp (void *arg) |
void | RWopsTearDown (void *arg) |
void | _testGenericRWopsValidations (SDL_RWops *rw, int write) |
Makes sure parameters work properly. Local helper function. More... | |
int | rwops_testParamNegative (void) |
int | rwops_testMem (void) |
Tests opening from memory. More... | |
int | rwops_testConstMem (void) |
Tests opening from memory. More... | |
int | rwops_testFileRead (void) |
Tests reading from file. More... | |
int | rwops_testFileWrite (void) |
Tests writing from file. More... | |
int | rwops_testFPRead (void) |
Tests reading from file handle. More... | |
int | rwops_testFPWrite (void) |
Tests writing to file handle. More... | |
int | rwops_testAllocFree (void) |
Tests alloc and free RW context. More... | |
int | rwops_testCompareRWFromMemWithRWFromFile (void) |
Compare memory and file reads. More... | |
int | rwops_testFileWriteReadEndian (void) |
Tests writing and reading from file using endian aware functions. More... | |
Variables | |
const char * | RWopsReadTestFilename = "rwops_read" |
const char * | RWopsWriteTestFilename = "rwops_write" |
const char * | RWopsAlphabetFilename = "rwops_alphabet" |
static const char | RWopsHelloWorldTestString [] = "Hello World!" |
static const char | RWopsHelloWorldCompString [] = "Hello World!" |
static const char | RWopsAlphabetString [] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
static const SDLTest_TestCaseReference | rwopsTest1 |
static const SDLTest_TestCaseReference | rwopsTest2 |
static const SDLTest_TestCaseReference | rwopsTest3 |
static const SDLTest_TestCaseReference | rwopsTest4 |
static const SDLTest_TestCaseReference | rwopsTest5 |
static const SDLTest_TestCaseReference | rwopsTest6 |
static const SDLTest_TestCaseReference | rwopsTest7 |
static const SDLTest_TestCaseReference | rwopsTest8 |
static const SDLTest_TestCaseReference | rwopsTest9 |
static const SDLTest_TestCaseReference | rwopsTest10 |
static const SDLTest_TestCaseReference * | rwopsTests [] |
SDLTest_TestSuiteReference | rwopsTestSuite |
#define _CRT_SECURE_NO_WARNINGS |
Automated SDL_RWops test.
Original code written by Edgar Simo "bobbens" Ported by Markus Kauppila (marku) Updated and extended for SDL_test by aschiffler at ferzkopp dot net s.ka uppil a@gm ail.c om
Released under Public Domain.
Definition at line 13 of file testautomation_rwops.c.
Makes sure parameters work properly. Local helper function.
Definition at line 95 of file testautomation_rwops.c.
References i, RW_SEEK_CUR, RW_SEEK_END, RW_SEEK_SET, RWopsHelloWorldTestString, SDL_memcmp, SDL_PRIs64, SDL_RWread, SDL_RWseek, SDL_RWwrite, SDL_zero, SDLTest_AssertCheck(), SDLTest_AssertPass(), and SDLTest_RandomIntegerInRange().
Referenced by rwops_testConstMem(), rwops_testFileRead(), rwops_testFileWrite(), rwops_testFPRead(), rwops_testFPWrite(), and rwops_testMem().
int rwops_testAllocFree | ( | void | ) |
Tests alloc and free RW context.
Definition at line 491 of file testautomation_rwops.c.
References NULL, SDL_AllocRW, SDL_FreeRW, SDL_RWOPS_UNKNOWN, SDLTest_AssertCheck(), SDLTest_AssertPass(), TEST_ABORTED, TEST_COMPLETED, and SDL_RWops::type.
int rwops_testCompareRWFromMemWithRWFromFile | ( | void | ) |
Compare memory and file reads.
Definition at line 518 of file testautomation_rwops.c.
References RWopsAlphabetFilename, RWopsAlphabetString, SDL_RWclose, SDL_RWFromFile, SDL_RWFromMem, SDL_RWread, SDL_RWseek, SDL_strncmp, SDLTest_AssertCheck(), SDLTest_AssertPass(), and TEST_COMPLETED.
int rwops_testConstMem | ( | void | ) |
Tests opening from memory.
Definition at line 262 of file testautomation_rwops.c.
References _testGenericRWopsValidations(), NULL, RWopsHelloWorldCompString, SDL_RWclose, SDL_RWFromConstMem, SDL_RWOPS_MEMORY_RO, SDLTest_AssertCheck(), SDLTest_AssertPass(), TEST_ABORTED, TEST_COMPLETED, and SDL_RWops::type.
int rwops_testFileRead | ( | void | ) |
Tests reading from file.
Definition at line 298 of file testautomation_rwops.c.
References _testGenericRWopsValidations(), NULL, RWopsReadTestFilename, SDL_RWclose, SDL_RWFromFile, SDL_RWOPS_JNIFILE, SDL_RWOPS_STDFILE, SDL_RWOPS_WINFILE, SDLTest_AssertCheck(), SDLTest_AssertPass(), TEST_ABORTED, TEST_COMPLETED, and SDL_RWops::type.
int rwops_testFileWrite | ( | void | ) |
Tests writing from file.
Definition at line 345 of file testautomation_rwops.c.
References _testGenericRWopsValidations(), NULL, RWopsWriteTestFilename, SDL_RWclose, SDL_RWFromFile, SDL_RWOPS_JNIFILE, SDL_RWOPS_STDFILE, SDL_RWOPS_WINFILE, SDLTest_AssertCheck(), SDLTest_AssertPass(), TEST_ABORTED, TEST_COMPLETED, and SDL_RWops::type.
int rwops_testFileWriteReadEndian | ( | void | ) |
Tests writing and reading from file using endian aware functions.
Definition at line 587 of file testautomation_rwops.c.
References NULL, RW_SEEK_SET, RWopsWriteTestFilename, SDL_PRIu64, SDL_ReadBE16, SDL_ReadBE32, SDL_ReadBE64, SDL_ReadLE16, SDL_ReadLE32, SDL_ReadLE64, SDL_RWclose, SDL_RWFromFile, SDL_RWseek, SDL_WriteBE16, SDL_WriteBE32, SDL_WriteBE64, SDL_WriteLE16, SDL_WriteLE32, SDL_WriteLE64, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_Log(), SDLTest_RandomUint16(), SDLTest_RandomUint32(), SDLTest_RandomUint64(), TEST_ABORTED, and TEST_COMPLETED.
int rwops_testFPRead | ( | void | ) |
Tests reading from file handle.
Definition at line 394 of file testautomation_rwops.c.
References _testGenericRWopsValidations(), NULL, RWopsReadTestFilename, SDL_RWclose, SDL_RWFromFP, SDL_RWOPS_STDFILE, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), TEST_ABORTED, TEST_COMPLETED, and SDL_RWops::type.
int rwops_testFPWrite | ( | void | ) |
Tests writing to file handle.
Definition at line 444 of file testautomation_rwops.c.
References _testGenericRWopsValidations(), NULL, RWopsWriteTestFilename, SDL_RWclose, SDL_RWFromFP, SDL_RWOPS_STDFILE, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), TEST_ABORTED, TEST_COMPLETED, and SDL_RWops::type.
int rwops_testMem | ( | void | ) |
Tests opening from memory.
Definition at line 222 of file testautomation_rwops.c.
References _testGenericRWopsValidations(), NULL, RWopsHelloWorldTestString, SDL_RWclose, SDL_RWFromMem, SDL_RWOPS_MEMORY, SDL_zero, SDLTest_AssertCheck(), SDLTest_AssertPass(), TEST_ABORTED, and TEST_COMPLETED.
int rwops_testParamNegative | ( | void | ) |
Definition at line 175 of file testautomation_rwops.c.
References NULL, RWopsAlphabetString, SDL_RWFromConstMem, SDL_RWFromFile, SDL_RWFromMem, SDLTest_AssertCheck(), SDLTest_AssertPass(), and TEST_COMPLETED.
Definition at line 33 of file testautomation_rwops.c.
References NULL, RWopsAlphabetFilename, RWopsAlphabetString, RWopsHelloWorldTestString, RWopsReadTestFilename, RWopsWriteTestFilename, SDL_strlen, SDLTest_AssertCheck(), and SDLTest_AssertPass().
Definition at line 73 of file testautomation_rwops.c.
References RWopsAlphabetFilename, RWopsReadTestFilename, RWopsWriteTestFilename, SDLTest_AssertCheck(), and SDLTest_AssertPass().
const char* RWopsAlphabetFilename = "rwops_alphabet" |
Definition at line 24 of file testautomation_rwops.c.
Referenced by rwops_testCompareRWFromMemWithRWFromFile(), RWopsSetUp(), and RWopsTearDown().
|
static |
Definition at line 28 of file testautomation_rwops.c.
Referenced by rwops_testCompareRWFromMemWithRWFromFile(), rwops_testParamNegative(), and RWopsSetUp().
|
static |
Definition at line 27 of file testautomation_rwops.c.
Referenced by rwops_testConstMem().
|
static |
Definition at line 26 of file testautomation_rwops.c.
Referenced by _testGenericRWopsValidations(), rwops_testMem(), and RWopsSetUp().
const char* RWopsReadTestFilename = "rwops_read" |
Definition at line 22 of file testautomation_rwops.c.
Referenced by rwops_testFileRead(), rwops_testFPRead(), RWopsSetUp(), and RWopsTearDown().
|
static |
Definition at line 706 of file testautomation_rwops.c.
|
static |
Definition at line 733 of file testautomation_rwops.c.
|
static |
Definition at line 709 of file testautomation_rwops.c.
|
static |
Definition at line 712 of file testautomation_rwops.c.
|
static |
Definition at line 715 of file testautomation_rwops.c.
|
static |
Definition at line 718 of file testautomation_rwops.c.
|
static |
Definition at line 721 of file testautomation_rwops.c.
|
static |
Definition at line 724 of file testautomation_rwops.c.
|
static |
Definition at line 727 of file testautomation_rwops.c.
|
static |
Definition at line 730 of file testautomation_rwops.c.
|
static |
Definition at line 737 of file testautomation_rwops.c.
SDLTest_TestSuiteReference rwopsTestSuite |
Definition at line 743 of file testautomation_rwops.c.
const char* RWopsWriteTestFilename = "rwops_write" |
Definition at line 23 of file testautomation_rwops.c.
Referenced by rwops_testFileWrite(), rwops_testFileWriteReadEndian(), rwops_testFPWrite(), RWopsSetUp(), and RWopsTearDown().