SDL 3.0
SDL_test_compare.h File Reference
#include <SDL3/SDL.h>
#include <SDL3/SDL_begin_code.h>
#include <SDL3/SDL_close_code.h>
+ Include dependency graph for SDL_test_compare.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int SDLTest_CompareSurfaces (SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error)
 
int SDLTest_CompareMemory (const void *actual, size_t size_actual, const void *reference, size_t size_reference)
 

Function Documentation

◆ SDLTest_CompareMemory()

int SDLTest_CompareMemory ( const void *  actual,
size_t  size_actual,
const void *  reference,
size_t  size_reference 
)

Compares 2 memory blocks for equality

Parameters
actualMemory used in comparison, displayed on the left
size_actualSize of actual in bytes
referenceReference memory, displayed on the right
size_referenceSize of reference in bytes
Returns
0 if the left and right memory block are equal, non-zero if they are non-equal.
Since
This function is available since SDL 3.1.3.

◆ SDLTest_CompareSurfaces()

int SDLTest_CompareSurfaces ( SDL_Surface surface,
SDL_Surface referenceSurface,
int  allowable_error 
)

Comparison function of SDL test framework.

This code is a part of the SDL test library, not the main SDL library. Compares a surface and with reference image data for equality

Parameters
surfaceSurface used in comparison
referenceSurfaceTest Surface used in comparison
allowable_errorAllowable difference (=sum of squared difference for each RGB component) in blending accuracy.
Returns
0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ.