Fix testautomation_pixels using really invalid pixel format

This commit is contained in:
Sylvain 2023-01-07 18:56:50 +01:00 committed by Sam Lantinga
parent 76e1c7c509
commit cbe01319e0

View File

@ -88,14 +88,13 @@ const char *g_AllFormatsVerbose[] = {
"SDL_PIXELFORMAT_YVYU", "SDL_PIXELFORMAT_YVYU",
"SDL_PIXELFORMAT_NV12", "SDL_PIXELFORMAT_NV12",
"SDL_PIXELFORMAT_NV21" "SDL_PIXELFORMAT_NV21"
}; };
/* Definition of some invalid formats for negative tests */ /* Definition of some invalid formats for negative tests */
const int g_numInvalidPixelFormats = 2; const int g_numInvalidPixelFormats = 2;
static Uint32 g_invalidPixelFormats[] = { static Uint32 g_invalidPixelFormats[] = {
0xfffffffe, SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_1010102 + 1, 32, 4),
0xffffffff SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_1010102 + 2, 32, 4)
}; };
const char *g_invalidPixelFormatsVerbose[] = { const char *g_invalidPixelFormatsVerbose[] = {
"SDL_PIXELFORMAT_UNKNOWN", "SDL_PIXELFORMAT_UNKNOWN",
@ -114,7 +113,7 @@ int pixels_allocFreeFormat(void *arg)
{ {
const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN"; const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN";
const char *expectedError = "Parameter 'format' is invalid"; const char *expectedError = "Parameter 'format' is invalid";
const char *expectedError2 = "Parameter 'pixel_format' is invalid"; const char *expectedError2 = "Unknown pixel format";
const char *error; const char *error;
int i; int i;
Uint32 format; Uint32 format;