mirror of
				https://github.com/libsdl-org/SDL.git
				synced 2025-11-04 01:34:38 +00:00 
			
		
		
		
	Fixed testautomation --filter pixels_allocFreeFormat
This commit is contained in:
		@@ -122,7 +122,7 @@ static int pixels_allocFreeFormat(void *arg)
 | 
			
		||||
 | 
			
		||||
    /* Blank/unknown format */
 | 
			
		||||
    format = 0;
 | 
			
		||||
    SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", unknownFormat, format);
 | 
			
		||||
    SDLTest_Log("Pixel Format: %s (%" SDL_PRIu32 ")", unknownFormat, format);
 | 
			
		||||
 | 
			
		||||
    /* Allocate format */
 | 
			
		||||
    result = SDL_CreatePixelFormat(format);
 | 
			
		||||
@@ -143,7 +143,7 @@ static int pixels_allocFreeFormat(void *arg)
 | 
			
		||||
    /* RGB formats */
 | 
			
		||||
    for (i = 0; i < g_numAllFormats; i++) {
 | 
			
		||||
        format = g_AllFormats[i];
 | 
			
		||||
        SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", g_AllFormatsVerbose[i], format);
 | 
			
		||||
        SDLTest_Log("Pixel Format: %s (%" SDL_PRIu32 ")", g_AllFormatsVerbose[i], format);
 | 
			
		||||
 | 
			
		||||
        /* Allocate format */
 | 
			
		||||
        result = SDL_CreatePixelFormat(format);
 | 
			
		||||
@@ -151,12 +151,14 @@ static int pixels_allocFreeFormat(void *arg)
 | 
			
		||||
        SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
 | 
			
		||||
        if (result != NULL) {
 | 
			
		||||
            SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %" SDL_PRIu32 ", got %" SDL_PRIu32, format, result->format);
 | 
			
		||||
            if (!SDL_ISPIXELFORMAT_FOURCC(format)) {
 | 
			
		||||
                SDLTest_AssertCheck(result->BitsPerPixel > 0, "Verify value of result.BitsPerPixel; expected: >0, got %u", result->BitsPerPixel);
 | 
			
		||||
                SDLTest_AssertCheck(result->BytesPerPixel > 0, "Verify value of result.BytesPerPixel; expected: >0, got %u", result->BytesPerPixel);
 | 
			
		||||
            if (result->palette != NULL && !SDL_ISPIXELFORMAT_FOURCC(result->format)) {
 | 
			
		||||
                if (!SDL_ISPIXELFORMAT_INDEXED(format)) {
 | 
			
		||||
                    masks = result->Rmask | result->Gmask | result->Bmask | result->Amask;
 | 
			
		||||
                    SDLTest_AssertCheck(masks > 0, "Verify value of result.[RGBA]mask combined; expected: >0, got %" SDL_PRIu32, masks);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            /* Deallocate again */
 | 
			
		||||
            SDL_DestroyPixelFormat(result);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user