Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fixes for the automated rendering test

  • Loading branch information
slouken committed Nov 18, 2009
1 parent 66177f0 commit e470c6cd0768f52bb61111e3fec3fafd2d63e627
Showing with 12 additions and 13 deletions.
  1. +12 −13 test/automated/render/render.c
@@ -67,7 +67,6 @@ static int render_compare( const char *msg, const SurfaceImage_t *s )
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 @@ static int render_testBlitBlend (void)
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 @@ int test_render (void)
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,40 +977,40 @@ int test_render (void)
/* 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++) {

/* 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 );
SDL_ATbegin( msg );
/* 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 @@ int test_render (void)

return failed;

err_cleanup:
SDL_ATfinish();

err:
return 1;
}

0 comments on commit e470c6c

Please sign in to comment.