diff test/automated/surface/surface.c @ 3439:0acec8c9f5c9

Fixed some bugs in the automated test suite, revealed by working SDL_RenderReadPixels()
author Sam Lantinga <slouken@libsdl.org>
date Tue, 17 Nov 2009 05:17:11 +0000
parents 22ac66da0765
children da53c4046c65
line wrap: on
line diff
--- a/test/automated/surface/surface.c	Tue Nov 17 04:53:15 2009 +0000
+++ b/test/automated/surface/surface.c	Tue Nov 17 05:17:11 2009 +0000
@@ -97,12 +97,6 @@
    if (SDL_ATassert( "SDL_FillRect", ret == 0))
       return;
 
-   /* Create the surface. */
-   testsur = SDL_CreateRGBSurface( 0, 80, 60, 32, 
-         RMASK, GMASK, BMASK, AMASK );
-   if (SDL_ATassert( "SDL_CreateRGBSurface", testsur != NULL))
-      return;
-
    /* Draw a rectangle. */
    rect.x = 40;
    rect.y = 0;
@@ -263,7 +257,18 @@
    /* Create face surface. */
    face = SDL_CreateRGBSurfaceFrom( (void*)img_face.pixel_data,
          img_face.width, img_face.height, 32, img_face.width*4,
-         RMASK, GMASK, BMASK, AMASK );
+#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+         0xff000000, /* Red bit mask. */
+         0x00ff0000, /* Green bit mask. */
+         0x0000ff00, /* Blue bit mask. */
+         0x000000ff /* Alpha bit mask. */
+#else
+         0x000000ff, /* Red bit mask. */
+         0x0000ff00, /* Green bit mask. */
+         0x00ff0000, /* Blue bit mask. */
+         0xff000000 /* Alpha bit mask. */
+#endif
+         );
    if (SDL_ATassert( "SDL_CreateRGBSurfaceFrom", face != NULL))
       return;
 
@@ -424,7 +429,18 @@
    /* Create the blit surface. */
    face = SDL_CreateRGBSurfaceFrom( (void*)img_face.pixel_data,
          img_face.width, img_face.height, 32, img_face.width*4,
-         RMASK, GMASK, BMASK, AMASK );
+#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+         0xff000000, /* Red bit mask. */
+         0x00ff0000, /* Green bit mask. */
+         0x0000ff00, /* Blue bit mask. */
+         0x000000ff /* Alpha bit mask. */
+#else
+         0x000000ff, /* Red bit mask. */
+         0x0000ff00, /* Green bit mask. */
+         0x00ff0000, /* Blue bit mask. */
+         0xff000000 /* Alpha bit mask. */
+#endif
+         );
    if (SDL_ATassert( "SDL_CreateRGBSurfaceFrom", face != NULL))
       return;