Go to the documentation of this file.
30 #include "SDL_config.h"
43 int bpp, bpp_reference;
46 int sampleErrorX = 0, sampleErrorY = 0, sampleDist = 0;
49 char imageFilename[128];
50 char referenceFilename[128];
63 if (allowable_error<0) {
83 dist += (R-Rd)*(R-Rd);
84 dist += (
G-Gd)*(
G-Gd);
85 dist += (B-Bd)*(B-Bd);
88 if (dist > allowable_error) {
105 SDLTest_LogError(
"Comparison of pixels with allowable error of %i failed %i times.", allowable_error, ret);
106 SDLTest_LogError(
"First detected occurrence at position %i,%i with a squared RGB-difference of %i.", sampleErrorX, sampleErrorY, sampleDist);
111 SDLTest_LogError(
"Surfaces from failed comparison saved as '%s' and '%s'", imageFilename, referenceFilename);
#define SDL_UnlockSurface
A collection of pixels used in software blitting.
static SDL_Surface * referenceSurface
static int _CompareSurfaceCount
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp
int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error)
Compares a surface and with reference image data for equality.
void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt,...) SDL_PRINTF_VARARG_FUNC(1)
Prints given message with a timestamp in the TEST category and the ERROR priority.
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)
#define SDL_SaveBMP(surface, file)
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)