7#define _CRT_SECURE_NO_DEPRECATE
8#define _CRT_NONSTDC_NO_DEPRECATE
32#define TEST_SURFACE_WIDTH testSurface->w
33#define TEST_SURFACE_HEIGHT testSurface->h
44 Uint32 rmask, gmask, bmask, amask;
45#if SDL_BYTEORDER == SDL_BIG_ENDIAN
92 SDLTest_AssertCheck(ret == 0,
"Verify result from SDL_FillRect, expected: 0, got: %i", ret);
123 SDLTest_AssertCheck(ret == 0,
"Verify result from SDL_SetSurfaceAlphaMod(), expected: 0, got: %i", ret);
128 SDLTest_AssertCheck(ret == 0,
"Verify result from SDL_SetSurfaceColorMod(), expected: 0, got: %i", ret);
133 SDLTest_AssertCheck(ret == 0,
"Verify result from SDL_SetColorKey(), expected: 0, got: %i", ret);
150 SDLTest_AssertCheck(ret == 0,
"Verify result from SDL_SetSurfaceBlendMode(..., %i), expected: 0, got: %i",
mode, ret);
158 for (
j=0;
j <= nj;
j+=4) {
159 for (
i=0;
i <= ni;
i+=4) {
163 if (ret != 0) checkFailCount2++;
165 else if (
mode == -3) {
168 if (ret != 0) checkFailCount3++;
170 else if (
mode == -4) {
172 nmode = (
i/4*
j/4) % 4;
175 }
else if (nmode==1) {
177 }
else if (nmode==2) {
179 }
else if (nmode==3) {
183 if (ret != 0) checkFailCount4++;
190 if (ret != 0) checkFailCount1++;
193 SDLTest_AssertCheck(checkFailCount1 == 0,
"Validate results from calls to SDL_BlitSurface, expected: 0, got: %i", checkFailCount1);
194 SDLTest_AssertCheck(checkFailCount2 == 0,
"Validate results from calls to SDL_SetSurfaceColorMod, expected: 0, got: %i", checkFailCount2);
195 SDLTest_AssertCheck(checkFailCount3 == 0,
"Validate results from calls to SDL_SetSurfaceAlphaMod, expected: 0, got: %i", checkFailCount3);
196 SDLTest_AssertCheck(checkFailCount4 == 0,
"Validate results from calls to SDL_SetSurfaceBlendMode, expected: 0, got: %i", checkFailCount4);
223 const char *sampleFilename =
"testSaveLoadBitmap.bmp";
233 unlink(sampleFilename);
238 SDLTest_AssertCheck(ret == 0,
"Verify result from SDL_SaveBMP, expected: 0, got: %i", ret);
251 unlink(sampleFilename);
278 if (
face->format->palette) {
281 SDLTest_AssertCheck(ret == 0,
"Verify result from SDL_SetColorKey, expected: 0, got: %i", ret);
291 SDLTest_AssertCheck(ret == 0,
"Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
309 Uint32 pixel_formats[] = {
348 if (
face->format->palette) {
351 SDLTest_AssertCheck(ret == 0,
"Verify result from SDL_SetColorKey, expected: 0, got: %i", ret);
368 (fmt1->
Amask != 0) == (
face->format->Amask != 0) &&
369 (fmt2->
Amask != 0) == (
face->format->Amask != 0) ) {
375 SDLTest_AssertCheck(ret == 0,
"Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
420 SDLTest_AssertCheck(ret == 0,
"Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
443 SDLTest_AssertCheck(ret == 0,
"Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
466 SDLTest_AssertCheck(ret == 0,
"Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
490 SDLTest_AssertCheck(ret == 0,
"Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
513 SDLTest_AssertCheck(ret == 0,
"Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
536 SDLTest_AssertCheck(ret == 0,
"Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
559 SDLTest_AssertCheck(ret == 0,
"Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
582 SDLTest_AssertCheck(ret == 0,
"Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
#define SDL_assert(condition)
SDL_BlendMode
The blend mode used in SDL_RenderCopy() and drawing operations.
#define SDL_GetSurfaceBlendMode
#define SDL_SetSurfaceColorMod
#define SDL_SetSurfaceAlphaMod
#define SDL_SetSurfaceBlendMode
#define SDL_CreateRGBSurface
#define SDL_ConvertSurface
GLenum GLuint GLint GLenum face
@ SDL_PIXELFORMAT_ABGR4444
@ SDL_PIXELFORMAT_BGRA4444
@ SDL_PIXELFORMAT_RGBA8888
@ SDL_PIXELFORMAT_RGBA5551
@ SDL_PIXELFORMAT_ARGB1555
@ SDL_PIXELFORMAT_BGRX8888
@ SDL_PIXELFORMAT_ABGR8888
@ SDL_PIXELFORMAT_BGRA8888
@ SDL_PIXELFORMAT_ABGR1555
@ SDL_PIXELFORMAT_ARGB8888
@ SDL_PIXELFORMAT_ARGB4444
@ SDL_PIXELFORMAT_RGBX8888
@ SDL_PIXELFORMAT_BGRA5551
@ SDL_PIXELFORMAT_ARGB2101010
@ SDL_PIXELFORMAT_RGBA4444
#define SDL_arraysize(array)
#define SDL_SaveBMP(surface, file)
#define SDL_LoadBMP(file)
void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(1)
Explicitly pass without checking an assertion condition. Updates assertion counter.
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error)
Compares a surface and with reference image data for equality.
int(* SDLTest_TestCaseFp)(void *arg)
SDL_Surface * SDLTest_ImageBlitBlendNone(void)
Returns the BlitBlendNone test image as SDL_Surface.
SDL_Surface * SDLTest_ImageBlitBlend(void)
Returns the BlitBlend test image as SDL_Surface.
SDL_Surface * SDLTest_ImageBlitBlendAdd(void)
Returns the BlitBlendAdd test image as SDL_Surface.
SDL_Surface * SDLTest_ImageBlitBlendAll(void)
Returns the BlitBlendAll test image as SDL_Surface.
SDL_Surface * SDLTest_ImageFace(void)
Returns the Face test image as SDL_Surface.
SDL_Surface * SDLTest_ImageBlit(void)
Returns the Blit test image as SDL_Surface.
SDL_Surface * SDLTest_ImageBlitAlpha(void)
Returns the BlitAlpha test image as SDL_Surface.
SDL_Surface * SDLTest_ImageBlitBlendMod(void)
Returns the BlitBlendMod test image as SDL_Surface.
SDL_Surface * SDLTest_ImageBlitColor(void)
Returns the BlitColor test image as SDL_Surface.
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
A rectangle, with the origin at the upper left (integer).
A collection of pixels used in software blitting.
static const SDLTest_TestCaseReference surfaceTest4
static const SDLTest_TestCaseReference surfaceTest7
static const SDLTest_TestCaseReference surfaceTest5
static const SDLTest_TestCaseReference surfaceTest10
int surface_testCompleteSurfaceConversion(void *arg)
static const SDLTest_TestCaseReference surfaceTest6
static SDL_Surface * testSurface
int surface_testSurfaceConversion(void *arg)
static const SDLTest_TestCaseReference surfaceTest9
void _AssertFileExist(const char *filename)
int surface_testSaveLoadBitmap(void *arg)
Tests sprite saving and loading.
int surface_testBlitBlendMod(void *arg)
Tests some more blitting routines.
int surface_testBlitBlendAdd(void *arg)
Tests some more blitting routines.
void _surfaceTearDown(void *arg)
void _testBlitBlendMode(int mode)
static const SDLTest_TestCaseReference surfaceTest3
int surface_testBlitBlendBlend(void *arg)
Tests some more blitting routines.
SDLTest_TestSuiteReference surfaceTestSuite
static const SDLTest_TestCaseReference surfaceTest12
int surface_testLoadFailure(void *arg)
Tests sprite loading. A failure case.
int surface_testBlitAlphaMod(void *arg)
Tests some blitting routines with alpha mod.
static const SDLTest_TestCaseReference surfaceTest11
int surface_testBlitBlendNone(void *arg)
Tests some more blitting routines.
int surface_testBlitColorMod(void *arg)
Tests some blitting routines with color mod.
static const SDLTest_TestCaseReference * surfaceTests[]
int surface_testBlit(void *arg)
Tests some blitting routines.
static const SDLTest_TestCaseReference surfaceTest2
static const SDLTest_TestCaseReference surfaceTest8
void _surfaceSetUp(void *arg)
int surface_testBlitBlendLoop(void *arg)
Tests some more blitting routines with loop.
static SDL_Surface * referenceSurface
static const SDLTest_TestCaseReference surfaceTest1
static SDL_BlendMode blendMode