test/testautomation_rect.c
changeset 7074 0545811b3543
parent 6772 5229a117ef97
child 7191 75360622e65f
     1.1 --- a/test/testautomation_rect.c	Wed Apr 17 07:35:30 2013 -0700
     1.2 +++ b/test/testautomation_rect.c	Wed Apr 17 08:09:11 2013 -0700
     1.3 @@ -614,8 +614,11 @@
     1.4      SDL_Rect rectB;
     1.5      SDL_Rect result;
     1.6      SDL_bool intersection;
     1.7 +    SDL_bool empty;
     1.8  
     1.9      // Rect A empty
    1.10 +    result.w = SDLTest_RandomIntegerInRange(1, 100);
    1.11 +    result.h = SDLTest_RandomIntegerInRange(1, 100);
    1.12      refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
    1.13      refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
    1.14      refRectA.w = SDLTest_RandomIntegerInRange(1, 100);
    1.15 @@ -627,8 +630,12 @@
    1.16      rectB = refRectB;
    1.17      intersection = SDL_IntersectRect(&rectA, &rectB, &result);
    1.18      _validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL);
    1.19 -
    1.20 +    empty = (SDL_bool)SDL_RectEmpty(&result);
    1.21 +    SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE");
    1.22 +    
    1.23      // Rect B empty
    1.24 +    result.w = SDLTest_RandomIntegerInRange(1, 100);
    1.25 +    result.h = SDLTest_RandomIntegerInRange(1, 100);
    1.26      refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
    1.27      refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
    1.28      refRectA.w = SDLTest_RandomIntegerInRange(1, 100);
    1.29 @@ -640,8 +647,12 @@
    1.30      rectB = refRectB;
    1.31      intersection = SDL_IntersectRect(&rectA, &rectB, &result);
    1.32      _validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL);
    1.33 +    empty = (SDL_bool)SDL_RectEmpty(&result);
    1.34 +    SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE");
    1.35  
    1.36      // Rect A and B empty
    1.37 +    result.w = SDLTest_RandomIntegerInRange(1, 100);
    1.38 +    result.h = SDLTest_RandomIntegerInRange(1, 100);
    1.39      refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
    1.40      refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
    1.41      refRectA.w = SDLTest_RandomIntegerInRange(1, 100);
    1.42 @@ -655,8 +666,10 @@
    1.43      rectB = refRectB;
    1.44      intersection = SDL_IntersectRect(&rectA, &rectB, &result);
    1.45      _validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL);
    1.46 +    empty = (SDL_bool)SDL_RectEmpty(&result);
    1.47 +    SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE");
    1.48  
    1.49 -	return TEST_COMPLETED;
    1.50 +    return TEST_COMPLETED;
    1.51  }
    1.52  
    1.53  /*!