test/testautomation_rect.c
changeset 7663 53fe1b64eb2d
parent 7191 75360622e65f
child 7678 286c42d7c5ed
     1.1 --- a/test/testautomation_rect.c	Tue Aug 20 19:49:24 2013 -0300
     1.2 +++ b/test/testautomation_rect.c	Tue Aug 20 20:34:40 2013 -0300
     1.3 @@ -423,7 +423,7 @@
     1.4      SDL_Rect result;
     1.5      SDL_bool intersection;
     1.6  
     1.7 -    // rectB fully contained in rectA
     1.8 +    /* rectB fully contained in rectA */
     1.9      refRectB.x = 0;
    1.10      refRectB.y = 0;
    1.11      refRectB.w = SDLTest_RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1);
    1.12 @@ -451,7 +451,7 @@
    1.13      SDL_Rect result;
    1.14      SDL_bool intersection;
    1.15  
    1.16 -    // rectB fully outside of rectA
    1.17 +    /* rectB fully outside of rectA */
    1.18      refRectB.x = refRectA.x + refRectA.w + SDLTest_RandomIntegerInRange(1, 10);
    1.19      refRectB.y = refRectA.y + refRectA.h + SDLTest_RandomIntegerInRange(1, 10);
    1.20      refRectB.w = refRectA.w;
    1.21 @@ -480,7 +480,7 @@
    1.22      SDL_Rect expectedResult;
    1.23      SDL_bool intersection;
    1.24  
    1.25 -    // rectB partially contained in rectA
    1.26 +    /* rectB partially contained in rectA */
    1.27      refRectB.x = SDLTest_RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1);
    1.28      refRectB.y = SDLTest_RandomIntegerInRange(refRectA.y + 1, refRectA.y + refRectA.h - 1);
    1.29      refRectB.w = refRectA.w;
    1.30 @@ -494,7 +494,7 @@
    1.31      intersection = SDL_IntersectRect(&rectA, &rectB, &result);
    1.32      _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult);
    1.33  
    1.34 -    // rectB right edge
    1.35 +    /* rectB right edge */
    1.36      refRectB.x = rectA.w - 1;
    1.37      refRectB.y = rectA.y;
    1.38      refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1);
    1.39 @@ -508,7 +508,7 @@
    1.40      intersection = SDL_IntersectRect(&rectA, &rectB, &result);
    1.41      _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult);
    1.42  
    1.43 -    // rectB left edge
    1.44 +    /* rectB left edge */
    1.45      refRectB.x = 1 - rectA.w;
    1.46      refRectB.y = rectA.y;
    1.47      refRectB.w = refRectA.w;
    1.48 @@ -522,7 +522,7 @@
    1.49      intersection = SDL_IntersectRect(&rectA, &rectB, &result);
    1.50      _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult);
    1.51  
    1.52 -    // rectB bottom edge
    1.53 +    /* rectB bottom edge */
    1.54      refRectB.x = rectA.x;
    1.55      refRectB.y = rectA.h - 1;
    1.56      refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1);
    1.57 @@ -536,7 +536,7 @@
    1.58      intersection = SDL_IntersectRect(&rectA, &rectB, &result);
    1.59      _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult);
    1.60  
    1.61 -    // rectB top edge
    1.62 +    /* rectB top edge */
    1.63      refRectB.x = rectA.x;
    1.64      refRectB.y = 1 - rectA.h;
    1.65      refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1);
    1.66 @@ -569,7 +569,7 @@
    1.67      SDL_bool intersection;
    1.68      int offsetX, offsetY;
    1.69  
    1.70 -    // intersecting pixels
    1.71 +    /* intersecting pixels */
    1.72      refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
    1.73      refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
    1.74      refRectB.x = refRectA.x;
    1.75 @@ -579,7 +579,7 @@
    1.76      intersection = SDL_IntersectRect(&rectA, &rectB, &result);
    1.77      _validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &refRectA);
    1.78  
    1.79 -    // non-intersecting pixels cases
    1.80 +    /* non-intersecting pixels cases */
    1.81      for (offsetX = -1; offsetX <= 1; offsetX++) {
    1.82          for (offsetY = -1; offsetY <= 1; offsetY++) {
    1.83              if (offsetX != 0 || offsetY != 0) {
    1.84 @@ -616,7 +616,7 @@
    1.85      SDL_bool intersection;
    1.86      SDL_bool empty;
    1.87  
    1.88 -    // Rect A empty
    1.89 +    /* Rect A empty */
    1.90      result.w = SDLTest_RandomIntegerInRange(1, 100);
    1.91      result.h = SDLTest_RandomIntegerInRange(1, 100);
    1.92      refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
    1.93 @@ -633,7 +633,7 @@
    1.94      empty = (SDL_bool)SDL_RectEmpty(&result);
    1.95      SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE");
    1.96  
    1.97 -    // Rect B empty
    1.98 +    /* Rect B empty */
    1.99      result.w = SDLTest_RandomIntegerInRange(1, 100);
   1.100      result.h = SDLTest_RandomIntegerInRange(1, 100);
   1.101      refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
   1.102 @@ -650,7 +650,7 @@
   1.103      empty = (SDL_bool)SDL_RectEmpty(&result);
   1.104      SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE");
   1.105  
   1.106 -    // Rect A and B empty
   1.107 +    /* Rect A and B empty */
   1.108      result.w = SDLTest_RandomIntegerInRange(1, 100);
   1.109      result.h = SDLTest_RandomIntegerInRange(1, 100);
   1.110      refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
   1.111 @@ -685,7 +685,7 @@
   1.112      SDL_Rect result;
   1.113      SDL_bool intersection;
   1.114  
   1.115 -    // invalid parameter combinations
   1.116 +    /* invalid parameter combinations */
   1.117      intersection = SDL_IntersectRect((SDL_Rect *)NULL, &rectB, &result);
   1.118      SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL");
   1.119      intersection = SDL_IntersectRect(&rectA, (SDL_Rect *)NULL, &result);
   1.120 @@ -716,7 +716,7 @@
   1.121      SDL_Rect rectB;
   1.122      SDL_bool intersection;
   1.123  
   1.124 -    // rectB fully contained in rectA
   1.125 +    /* rectB fully contained in rectA */
   1.126      refRectB.x = 0;
   1.127      refRectB.y = 0;
   1.128      refRectB.w = SDLTest_RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1);
   1.129 @@ -743,7 +743,7 @@
   1.130      SDL_Rect rectB;
   1.131      SDL_bool intersection;
   1.132  
   1.133 -    // rectB fully outside of rectA
   1.134 +    /* rectB fully outside of rectA */
   1.135      refRectB.x = refRectA.x + refRectA.w + SDLTest_RandomIntegerInRange(1, 10);
   1.136      refRectB.y = refRectA.y + refRectA.h + SDLTest_RandomIntegerInRange(1, 10);
   1.137      refRectB.w = refRectA.w;
   1.138 @@ -770,7 +770,7 @@
   1.139      SDL_Rect rectB;
   1.140      SDL_bool intersection;
   1.141  
   1.142 -    // rectB partially contained in rectA
   1.143 +    /* rectB partially contained in rectA */
   1.144      refRectB.x = SDLTest_RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1);
   1.145      refRectB.y = SDLTest_RandomIntegerInRange(refRectA.y + 1, refRectA.y + refRectA.h - 1);
   1.146      refRectB.w = refRectA.w;
   1.147 @@ -780,7 +780,7 @@
   1.148      intersection = SDL_HasIntersection(&rectA, &rectB);
   1.149      _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB);
   1.150  
   1.151 -    // rectB right edge
   1.152 +    /* rectB right edge */
   1.153      refRectB.x = rectA.w - 1;
   1.154      refRectB.y = rectA.y;
   1.155      refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1);
   1.156 @@ -790,7 +790,7 @@
   1.157      intersection = SDL_HasIntersection(&rectA, &rectB);
   1.158      _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB);
   1.159  
   1.160 -    // rectB left edge
   1.161 +    /* rectB left edge */
   1.162      refRectB.x = 1 - rectA.w;
   1.163      refRectB.y = rectA.y;
   1.164      refRectB.w = refRectA.w;
   1.165 @@ -800,7 +800,7 @@
   1.166      intersection = SDL_HasIntersection(&rectA, &rectB);
   1.167      _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB);
   1.168  
   1.169 -    // rectB bottom edge
   1.170 +    /* rectB bottom edge */
   1.171      refRectB.x = rectA.x;
   1.172      refRectB.y = rectA.h - 1;
   1.173      refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1);
   1.174 @@ -810,7 +810,7 @@
   1.175      intersection = SDL_HasIntersection(&rectA, &rectB);
   1.176      _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB);
   1.177  
   1.178 -    // rectB top edge
   1.179 +    /* rectB top edge */
   1.180      refRectB.x = rectA.x;
   1.181      refRectB.y = 1 - rectA.h;
   1.182      refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1);
   1.183 @@ -838,7 +838,7 @@
   1.184      SDL_bool intersection;
   1.185      int offsetX, offsetY;
   1.186  
   1.187 -    // intersecting pixels
   1.188 +    /* intersecting pixels */
   1.189      refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
   1.190      refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
   1.191      refRectB.x = refRectA.x;
   1.192 @@ -848,7 +848,7 @@
   1.193      intersection = SDL_HasIntersection(&rectA, &rectB);
   1.194      _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB);
   1.195  
   1.196 -    // non-intersecting pixels cases
   1.197 +    /* non-intersecting pixels cases */
   1.198      for (offsetX = -1; offsetX <= 1; offsetX++) {
   1.199          for (offsetY = -1; offsetY <= 1; offsetY++) {
   1.200              if (offsetX != 0 || offsetY != 0) {
   1.201 @@ -883,7 +883,7 @@
   1.202      SDL_Rect rectB;
   1.203      SDL_bool intersection;
   1.204  
   1.205 -    // Rect A empty
   1.206 +    /* Rect A empty */
   1.207      refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
   1.208      refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
   1.209      refRectA.w = SDLTest_RandomIntegerInRange(1, 100);
   1.210 @@ -896,7 +896,7 @@
   1.211      intersection = SDL_HasIntersection(&rectA, &rectB);
   1.212      _validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB);
   1.213  
   1.214 -    // Rect B empty
   1.215 +    /* Rect B empty */
   1.216      refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
   1.217      refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
   1.218      refRectA.w = SDLTest_RandomIntegerInRange(1, 100);
   1.219 @@ -909,7 +909,7 @@
   1.220      intersection = SDL_HasIntersection(&rectA, &rectB);
   1.221      _validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB);
   1.222  
   1.223 -    // Rect A and B empty
   1.224 +    /* Rect A and B empty */
   1.225      refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
   1.226      refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
   1.227      refRectA.w = SDLTest_RandomIntegerInRange(1, 100);
   1.228 @@ -939,7 +939,7 @@
   1.229      SDL_Rect rectB;
   1.230      SDL_bool intersection;
   1.231  
   1.232 -    // invalid parameter combinations
   1.233 +    /* invalid parameter combinations */
   1.234      intersection = SDL_HasIntersection((SDL_Rect *)NULL, &rectB);
   1.235      SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL");
   1.236      intersection = SDL_HasIntersection(&rectA, (SDL_Rect *)NULL);
   1.237 @@ -969,7 +969,7 @@
   1.238      int minx = 0, maxx = 0, miny = 0, maxy = 0;
   1.239      int i;
   1.240  
   1.241 -    // Create input data, tracking result
   1.242 +    /* Create input data, tracking result */
   1.243      for (i=0; i<numPoints; i++) {
   1.244          newx = SDLTest_RandomIntegerInRange(-1024, 1024);
   1.245          newy = SDLTest_RandomIntegerInRange(-1024, 1024);
   1.246 @@ -990,7 +990,7 @@
   1.247          }
   1.248      }
   1.249  
   1.250 -    // Call function and validate - special case: no result requested
   1.251 +    /* Call function and validate - special case: no result requested */
   1.252      anyEnclosedNoResult = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)NULL, (SDL_Rect *)NULL);
   1.253      SDLTest_AssertCheck(expectedEnclosed==anyEnclosedNoResult,
   1.254          "Check expected return value %s, got %s",
   1.255 @@ -1002,7 +1002,7 @@
   1.256              i, refPoints[i].x, refPoints[i].y, points[i].x, points[i].y);
   1.257      }
   1.258  
   1.259 -    // Call function and validate
   1.260 +    /* Call function and validate */
   1.261      anyEnclosed = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)NULL, &result);
   1.262      SDLTest_AssertCheck(expectedEnclosed==anyEnclosed,
   1.263          "Check return value %s, got %s",
   1.264 @@ -1040,7 +1040,7 @@
   1.265      int minx = 0, maxx = 0, miny = 0, maxy = 0;
   1.266      int i;
   1.267  
   1.268 -    // Create input data, tracking result
   1.269 +    /* Create input data, tracking result */
   1.270      for (i=0; i<numPoints; i++) {
   1.271          if (i < halfPoints) {
   1.272              newx = SDLTest_RandomIntegerInRange(-1024, 1024);
   1.273 @@ -1066,7 +1066,7 @@
   1.274          }
   1.275      }
   1.276  
   1.277 -    // Call function and validate - special case: no result requested
   1.278 +    /* Call function and validate - special case: no result requested */
   1.279      anyEnclosedNoResult = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)NULL, (SDL_Rect *)NULL);
   1.280      SDLTest_AssertCheck(expectedEnclosed==anyEnclosedNoResult,
   1.281          "Check return value %s, got %s",
   1.282 @@ -1078,7 +1078,7 @@
   1.283              i, refPoints[i].x, refPoints[i].y, points[i].x, points[i].y);
   1.284      }
   1.285  
   1.286 -    // Call function and validate
   1.287 +    /* Call function and validate */
   1.288      anyEnclosed = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)NULL, &result);
   1.289      SDLTest_AssertCheck(expectedEnclosed==anyEnclosed,
   1.290          "Check return value %s, got %s",
   1.291 @@ -1117,13 +1117,13 @@
   1.292      int minx = 0, maxx = 0, miny = 0, maxy = 0;
   1.293      int i;
   1.294  
   1.295 -    // Setup clipping rectangle
   1.296 +    /* Setup clipping rectangle */
   1.297      refClip.x = SDLTest_RandomIntegerInRange(-1024, 1024);
   1.298      refClip.y = SDLTest_RandomIntegerInRange(-1024, 1024);
   1.299      refClip.w = SDLTest_RandomIntegerInRange(1, 1024);
   1.300      refClip.h = SDLTest_RandomIntegerInRange(1, 1024);
   1.301  
   1.302 -    // Create input data, tracking result
   1.303 +    /* Create input data, tracking result */
   1.304      for (i=0; i<numPoints; i++) {
   1.305          newx = SDLTest_RandomIntegerInRange(-1024, 1024);
   1.306          newy = SDLTest_RandomIntegerInRange(-1024, 1024);
   1.307 @@ -1148,7 +1148,7 @@
   1.308          }
   1.309      }
   1.310  
   1.311 -    // Call function and validate - special case: no result requested
   1.312 +    /* Call function and validate - special case: no result requested */
   1.313      clip = refClip;
   1.314      anyEnclosedNoResult = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)&clip, (SDL_Rect *)NULL);
   1.315      SDLTest_AssertCheck(expectedEnclosed==anyEnclosedNoResult,
   1.316 @@ -1163,7 +1163,7 @@
   1.317      SDLTest_AssertCheck(refClip.x==clip.x && refClip.y==clip.y && refClip.w==clip.w && refClip.h==clip.h,
   1.318          "Check that source clipping rectangle was not modified");
   1.319  
   1.320 -    // Call function and validate
   1.321 +    /* Call function and validate */
   1.322      anyEnclosed = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)&clip, &result);
   1.323      SDLTest_AssertCheck(expectedEnclosed==anyEnclosed,
   1.324          "Check return value %s, got %s",
   1.325 @@ -1209,7 +1209,7 @@
   1.326      SDL_Rect result;
   1.327      SDL_bool anyEnclosed;
   1.328  
   1.329 -    // invalid parameter combinations
   1.330 +    /* invalid parameter combinations */
   1.331      anyEnclosed = SDL_EnclosePoints((SDL_Point *)NULL, 1, (const SDL_Rect *)&clip, &result);
   1.332      SDLTest_AssertCheck(anyEnclosed == SDL_FALSE, "Check that functions returns SDL_FALSE when 1st parameter is NULL");
   1.333      anyEnclosed = SDL_EnclosePoints((const SDL_Point *)points, 0, (const SDL_Rect *)&clip, &result);
   1.334 @@ -1434,7 +1434,7 @@
   1.335      SDL_Rect rectA, rectB;
   1.336      SDL_Rect result;
   1.337  
   1.338 -    // invalid parameter combinations
   1.339 +    /* invalid parameter combinations */
   1.340      SDL_UnionRect((SDL_Rect *)NULL, &rectB, &result);
   1.341      SDLTest_AssertPass("Check that function returns when 1st parameter is NULL");
   1.342      SDL_UnionRect(&rectA, (SDL_Rect *)NULL, &result);
   1.343 @@ -1465,7 +1465,7 @@
   1.344      SDL_bool result;
   1.345      int w, h;
   1.346  
   1.347 -    // Non-empty case
   1.348 +    /* Non-empty case */
   1.349      refRect.x=SDLTest_RandomIntegerInRange(-1024, 1024);
   1.350      refRect.y=SDLTest_RandomIntegerInRange(-1024, 1024);
   1.351      refRect.w=SDLTest_RandomIntegerInRange(256, 1024);
   1.352 @@ -1475,7 +1475,7 @@
   1.353      result = (SDL_bool)SDL_RectEmpty((const SDL_Rect *)&rect);
   1.354      _validateRectEmptyResults(result, expectedResult, &rect, &refRect);
   1.355  
   1.356 -    // Empty case
   1.357 +    /* Empty case */
   1.358      for (w=-1; w<2; w++) {
   1.359          for (h=-1; h<2; h++) {
   1.360              if ((w != 1) || (h != 1)) {
   1.361 @@ -1504,7 +1504,7 @@
   1.362  {
   1.363      SDL_bool result;
   1.364  
   1.365 -    // invalid parameter combinations
   1.366 +    /* invalid parameter combinations */
   1.367      result = (SDL_bool)SDL_RectEmpty((const SDL_Rect *)NULL);
   1.368      SDLTest_AssertCheck(result == SDL_TRUE, "Check that function returns TRUE when 1st parameter is NULL");
   1.369  
   1.370 @@ -1526,7 +1526,7 @@
   1.371      SDL_bool expectedResult;
   1.372      SDL_bool result;
   1.373  
   1.374 -    // Equals
   1.375 +    /* Equals */
   1.376      refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024);
   1.377      refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024);
   1.378      refRectA.w=SDLTest_RandomIntegerInRange(1, 1024);
   1.379 @@ -1563,7 +1563,7 @@
   1.380      rectB.w=SDLTest_RandomIntegerInRange(1, 1024);
   1.381      rectB.h=SDLTest_RandomIntegerInRange(1, 1024);
   1.382  
   1.383 -    // invalid parameter combinations
   1.384 +    /* invalid parameter combinations */
   1.385      result = (SDL_bool)SDL_RectEquals((const SDL_Rect *)NULL, (const SDL_Rect *)&rectB);
   1.386      SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL");
   1.387      result = (SDL_bool)SDL_RectEquals((const SDL_Rect *)&rectA, (const SDL_Rect *)NULL);