test/automated/common/common.c
changeset 3439 0acec8c9f5c9
parent 3259 22ac66da0765
child 3441 5271ce790fed
     1.1 --- a/test/automated/common/common.c	Tue Nov 17 04:53:15 2009 +0000
     1.2 +++ b/test/automated/common/common.c	Tue Nov 17 05:17:11 2009 +0000
     1.3 @@ -46,9 +46,26 @@
     1.4                 break;
     1.5  
     1.6              case 4:
     1.7 -               ret += !( (p[0] == pd[0]) &&
     1.8 -                         (p[1] == pd[1]) &&
     1.9 -                         (p[2] == pd[2]) );
    1.10 +               {
    1.11 +                  int fail;
    1.12 +                  Uint8 R, G, B, A;
    1.13 +
    1.14 +                  SDL_GetRGBA(*(Uint32*)p, sur->format, &R, &G, &B, &A);
    1.15 +
    1.16 +                  if (img->bytes_per_pixel == 3) {
    1.17 +                     fail = !( (R == pd[0]) &&
    1.18 +                               (G == pd[1]) &&
    1.19 +                               (B == pd[2]) );
    1.20 +                  } else {
    1.21 +                     fail = !( (R == pd[0]) &&
    1.22 +                               (G == pd[1]) &&
    1.23 +                               (B == pd[2]) &&
    1.24 +                               (A == pd[3]) );
    1.25 +                  }
    1.26 +                  if (fail) {
    1.27 +                     ++ret;
    1.28 +                  }
    1.29 +               }
    1.30                 break;
    1.31           }
    1.32        }