Fixes for the automated rendering test
authorSam Lantinga <slouken@libsdl.org>
Wed, 18 Nov 2009 09:07:13 +0000
changeset 34497bd010656baf
parent 3448 bc27e1fdd3a7
child 3450 173199bce642
Fixes for the automated rendering test
test/automated/render/render.c
     1.1 --- a/test/automated/render/render.c	Wed Nov 18 08:54:13 2009 +0000
     1.2 +++ b/test/automated/render/render.c	Wed Nov 18 09:07:13 2009 +0000
     1.3 @@ -67,7 +67,6 @@
     1.4        return 1;
     1.5  
     1.6     /* Read pixels. */
     1.7 -   SDL_RenderPresent();
     1.8     ret = SDL_RenderReadPixels( NULL, FORMAT, pix, 80*4 );
     1.9     if (SDL_ATassert( "SDL_RenderReadPixels", ret==0) )
    1.10        return 1;
    1.11 @@ -792,7 +791,7 @@
    1.12        return -1;
    1.13     /* See if it's the same. */
    1.14     if (render_compare( "Blit blending output not the same (using SDL_BLENDMODE_NONE).",
    1.15 -            &img_blitAlpha ))
    1.16 +            &img_blendNone ))
    1.17        return -1;
    1.18  
    1.19     /* Test Mask. */
    1.20 @@ -964,9 +963,6 @@
    1.21        if (driver == NULL)
    1.22           goto err;
    1.23        SDL_ATprintVerbose( 1, " %d) %s\n", i+1, driver );
    1.24 -      /* Hack to avoid dummy driver. */
    1.25 -      if (strcmp(driver,"dummy")==0)
    1.26 -         continue;
    1.27  
    1.28        /*
    1.29         * Initialize testsuite.
    1.30 @@ -981,24 +977,24 @@
    1.31        /* Initialize video mode. */
    1.32        ret = SDL_VideoInit( driver, 0 );
    1.33        if (SDL_ATvassert( ret==0, "SDL_VideoInit( %s, 0 )", driver ))
    1.34 -         goto err;
    1.35 +         goto err_cleanup;
    1.36        /* Check to see if it's the one we want. */
    1.37        str = SDL_GetCurrentVideoDriver();
    1.38        if (SDL_ATassert( "SDL_GetCurrentVideoDriver", strcmp(driver,str)==0))
    1.39 -         goto err;
    1.40 +         goto err_cleanup;
    1.41        /* Create window. */
    1.42        wid = SDL_CreateWindow( msg, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
    1.43 -            80, 60, SDL_WINDOW_SHOWN );
    1.44 +            80, 60, 0 );
    1.45        if (SDL_ATassert( "SDL_CreateWindow", wid!=0 ))
    1.46 -         goto err;
    1.47 +         goto err_cleanup;
    1.48        /* Check title. */
    1.49        str = SDL_GetWindowTitle( wid );
    1.50        if (SDL_ATassert( "SDL_GetWindowTitle", strcmp(msg,str)==0))
    1.51 -         goto err;
    1.52 +         goto err_cleanup;
    1.53        /* Get renderers. */
    1.54        nr = SDL_GetNumRenderDrivers();
    1.55        if (SDL_ATassert("SDL_GetNumRenderDrivers", nr>=0))
    1.56 -         goto err;
    1.57 +         goto err_cleanup;
    1.58        SDL_ATprintVerbose( 1, "   %d Render Drivers\n", nr );
    1.59        SDL_ATend();
    1.60        for (j=0; j<nr; j++) {
    1.61 @@ -1006,7 +1002,7 @@
    1.62           /* Get renderer info. */
    1.63           ret = SDL_GetRenderDriverInfo( j, &renderer );
    1.64           if (ret != 0)
    1.65 -            goto err;
    1.66 +            goto err_cleanup;
    1.67           /* Set testcase name. */
    1.68           snprintf( msg, sizeof(msg), "Renderer %s", renderer.name );
    1.69           SDL_ATprintVerbose( 1, "    %d) %s\n", j+1, renderer.name );
    1.70 @@ -1014,7 +1010,7 @@
    1.71           /* Set renderer. */
    1.72           ret = SDL_CreateRenderer( wid, j, 0 );
    1.73           if (SDL_ATassert( "SDL_CreateRenderer", ret==0 ))
    1.74 -            goto err;
    1.75 +            goto err_cleanup;
    1.76  
    1.77           /*
    1.78            * Run tests.
    1.79 @@ -1041,6 +1037,9 @@
    1.80  
    1.81     return failed;
    1.82  
    1.83 +err_cleanup:
    1.84 +   SDL_ATfinish();
    1.85 +
    1.86  err:
    1.87     return 1;
    1.88  }