Mercurial > sdl-ios-xcode
diff test/automated/render/render.c @ 3449:7bd010656baf
Fixes for the automated rendering test
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 18 Nov 2009 09:07:13 +0000 |
parents | de72b49bb695 |
children | bb35055cb101 |
line wrap: on
line diff
--- a/test/automated/render/render.c Wed Nov 18 08:54:13 2009 +0000 +++ b/test/automated/render/render.c Wed Nov 18 09:07:13 2009 +0000 @@ -67,7 +67,6 @@ return 1; /* Read pixels. */ - SDL_RenderPresent(); ret = SDL_RenderReadPixels( NULL, FORMAT, pix, 80*4 ); if (SDL_ATassert( "SDL_RenderReadPixels", ret==0) ) return 1; @@ -792,7 +791,7 @@ return -1; /* See if it's the same. */ if (render_compare( "Blit blending output not the same (using SDL_BLENDMODE_NONE).", - &img_blitAlpha )) + &img_blendNone )) return -1; /* Test Mask. */ @@ -964,9 +963,6 @@ if (driver == NULL) goto err; SDL_ATprintVerbose( 1, " %d) %s\n", i+1, driver ); - /* Hack to avoid dummy driver. */ - if (strcmp(driver,"dummy")==0) - continue; /* * Initialize testsuite. @@ -981,24 +977,24 @@ /* Initialize video mode. */ ret = SDL_VideoInit( driver, 0 ); if (SDL_ATvassert( ret==0, "SDL_VideoInit( %s, 0 )", driver )) - goto err; + goto err_cleanup; /* Check to see if it's the one we want. */ str = SDL_GetCurrentVideoDriver(); if (SDL_ATassert( "SDL_GetCurrentVideoDriver", strcmp(driver,str)==0)) - goto err; + goto err_cleanup; /* Create window. */ wid = SDL_CreateWindow( msg, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, - 80, 60, SDL_WINDOW_SHOWN ); + 80, 60, 0 ); if (SDL_ATassert( "SDL_CreateWindow", wid!=0 )) - goto err; + goto err_cleanup; /* Check title. */ str = SDL_GetWindowTitle( wid ); if (SDL_ATassert( "SDL_GetWindowTitle", strcmp(msg,str)==0)) - goto err; + goto err_cleanup; /* Get renderers. */ nr = SDL_GetNumRenderDrivers(); if (SDL_ATassert("SDL_GetNumRenderDrivers", nr>=0)) - goto err; + goto err_cleanup; SDL_ATprintVerbose( 1, " %d Render Drivers\n", nr ); SDL_ATend(); for (j=0; j<nr; j++) { @@ -1006,7 +1002,7 @@ /* Get renderer info. */ ret = SDL_GetRenderDriverInfo( j, &renderer ); if (ret != 0) - goto err; + goto err_cleanup; /* Set testcase name. */ snprintf( msg, sizeof(msg), "Renderer %s", renderer.name ); SDL_ATprintVerbose( 1, " %d) %s\n", j+1, renderer.name ); @@ -1014,7 +1010,7 @@ /* Set renderer. */ ret = SDL_CreateRenderer( wid, j, 0 ); if (SDL_ATassert( "SDL_CreateRenderer", ret==0 )) - goto err; + goto err_cleanup; /* * Run tests. @@ -1041,6 +1037,9 @@ return failed; +err_cleanup: + SDL_ATfinish(); + err: return 1; }