Add SDLTest_CompareMemory function to compare memory ranges

This commit is contained in:
Anonymous Maarten 2024-02-03 04:45:48 +01:00 committed by Sam Lantinga
parent 875ddb4969
commit 07b7ec68eb
2 changed files with 81 additions and 0 deletions

View file

@ -55,6 +55,19 @@ extern "C" {
*/
int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error);
/**
* Compares 2 memory blocks for equality
*
* \param actual Memory used in comparison, displayed on the left
* \param size_actual Size of actual in bytes
* \param reference Reference memory, displayed on the right
* \param size_reference Size 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.0.0.
*/
extern int SDLTest_CompareMemory(const void *actual, size_t size_actual, const void *reference, size_t size_reference);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus