22 int x1Ref,
int y1Ref,
int x2Ref,
int y2Ref)
25 "Check for correct intersection result: expected %s, got %s intersecting rect (%d,%d,%d,%d) with line (%d,%d - %d,%d)",
26 (expectedIntersection ==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE",
27 (intersection ==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE",
28 refRect->
x, refRect->
y, refRect->
w, refRect->
h,
29 x1Ref, y1Ref, x2Ref, y2Ref);
31 "Check that source rectangle was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
32 rect->
x, rect->
y, rect->
w, rect->
h,
33 refRect->
x, refRect->
y, refRect->
w, refRect->
h);
35 "Check if line was incorrectly clipped or modified: got (%d,%d - %d,%d) expected (%d,%d - %d,%d)",
37 x1Ref, y1Ref, x2Ref, y2Ref);
68 _validateIntersectRectAndLineResults(intersected,
SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 0, 15, 31, 15);
76 _validateIntersectRectAndLineResults(intersected,
SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 15, 0, 15, 31);
84 _validateIntersectRectAndLineResults(intersected,
SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 0, 0, 31, 31);
92 _validateIntersectRectAndLineResults(intersected,
SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 31, 31, 0, 0);
100 _validateIntersectRectAndLineResults(intersected,
SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 0, 31, 31, 0);
108 _validateIntersectRectAndLineResults(intersected,
SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 31, 0, 0, 31);
122 SDL_Rect refRect = { 0, 0, 32, 32 };
128 int xmin = refRect.
x;
129 int xmax = refRect.
x + refRect.
w - 1;
130 int ymin = refRect.
y;
131 int ymax = refRect.
y + refRect.
h - 1;
143 _validateIntersectRectAndLineResults(intersected,
SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, x1Ref, y1Ref, x2Ref, y2Ref);
151 _validateIntersectRectAndLineResults(intersected,
SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, x1Ref, y1Ref, xmax, ymax);
159 _validateIntersectRectAndLineResults(intersected,
SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, xmin, ymin, x2Ref, y2Ref);
167 _validateIntersectRectAndLineResults(intersected,
SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, xmin, ymin, xmax, ymax);
175 _validateIntersectRectAndLineResults(intersected,
SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, xmin, ymax, xmax, ymin);
189 SDL_Rect refRect = { 0, 0, 32, 32 };
206 _validateIntersectRectAndLineResults(intersected,
SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, xLeft, 0, xLeft, 31);
214 _validateIntersectRectAndLineResults(intersected,
SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, xRight, 0, xRight, 31);
222 _validateIntersectRectAndLineResults(intersected,
SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, 0, yTop, 31, yTop);
230 _validateIntersectRectAndLineResults(intersected,
SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, 0, yBottom, 31, yBottom);
246 int x1,
y1, x1Ref, y1Ref;
247 int x2,
y2, x2Ref, y2Ref;
265 _validateIntersectRectAndLineResults(intersected,
SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, x1Ref, y1Ref, x2Ref, y2Ref);
313 "Check intersection result: expected %s, got %s intersecting A (%d,%d,%d,%d) with B (%d,%d,%d,%d)",
314 (expectedIntersection ==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE",
315 (intersection ==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE",
316 rectA->
x, rectA->
y, rectA->
w, rectA->
h,
317 rectB->
x, rectB->
y, rectB->
w, rectB->
h);
319 "Check that source rectangle A was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
320 rectA->
x, rectA->
y, rectA->
w, rectA->
h,
321 refRectA->
x, refRectA->
y, refRectA->
w, refRectA->
h);
323 "Check that source rectangle B was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
324 rectB->
x, rectB->
y, rectB->
w, rectB->
h,
325 refRectB->
x, refRectB->
y, refRectB->
w, refRectB->
h);
337 if (result && expectedResult) {
338 SDLTest_AssertCheck(result->
x == expectedResult->
x && result->
y == expectedResult->
y && result->
w == expectedResult->
w && result->
h == expectedResult->
h,
339 "Check that intersection of rectangles A (%d,%d,%d,%d) and B (%d,%d,%d,%d) was correctly calculated, got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
340 rectA->
x, rectA->
y, rectA->
w, rectA->
h,
341 rectB->
x, rectB->
y, rectB->
w, rectB->
h,
342 result->
x, result->
y, result->
w, result->
h,
343 expectedResult->
x, expectedResult->
y, expectedResult->
w, expectedResult->
h);
355 "Check that source rectangle A was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
356 rectA->
x, rectA->
y, rectA->
w, rectA->
h,
357 refRectA->
x, refRectA->
y, refRectA->
w, refRectA->
h);
359 "Check that source rectangle B was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
360 rectB->
x, rectB->
y, rectB->
w, rectB->
h,
361 refRectB->
x, refRectB->
y, refRectB->
w, refRectB->
h);
362 SDLTest_AssertCheck(result->
x == expectedResult->
x && result->
y == expectedResult->
y && result->
w == expectedResult->
w && result->
h == expectedResult->
h,
363 "Check that union of rectangles A (%d,%d,%d,%d) and B (%d,%d,%d,%d) was correctly calculated, got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
364 rectA->
x, rectA->
y, rectA->
w, rectA->
h,
365 rectB->
x, rectB->
y, rectB->
w, rectB->
h,
366 result->
x, result->
y, result->
w, result->
h,
367 expectedResult->
x, expectedResult->
y, expectedResult->
w, expectedResult->
h);
378 "Check for correct empty result: expected %s, got %s testing (%d,%d,%d,%d)",
379 (expectedEmpty ==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE",
380 (empty ==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE",
381 rect->
x, rect->
y, rect->
w, rect->
h);
383 "Check that source rectangle was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
384 rect->
x, rect->
y, rect->
w, rect->
h,
385 refRect->
x, refRect->
y, refRect->
w, refRect->
h);
396 "Check for correct equals result: expected %s, got %s testing (%d,%d,%d,%d) and (%d,%d,%d,%d)",
397 (expectedEquals ==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE",
398 (equals ==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE",
399 rectA->
x, rectA->
y, rectA->
w, rectA->
h,
400 rectB->
x, rectB->
y, rectB->
w, rectB->
h);
402 "Check that source rectangle A was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
403 rectA->
x, rectA->
y, rectA->
w, rectA->
h,
404 refRectA->
x, refRectA->
y, refRectA->
w, refRectA->
h);
406 "Check that source rectangle B was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
407 rectB->
x, rectB->
y, rectB->
w, rectB->
h,
408 refRectB->
x, refRectB->
y, refRectB->
w, refRectB->
h);
419 SDL_Rect refRectA = { 0, 0, 32, 32 };
447 SDL_Rect refRectA = { 0, 0, 32, 32 };
457 refRectB.
w = refRectA.
w;
458 refRectB.
h = refRectA.
h;
475 SDL_Rect refRectA = { 0, 0, 32, 32 };
486 refRectB.
w = refRectA.
w;
487 refRectB.
h = refRectA.
h;
490 expectedResult.
x = refRectB.
x;
491 expectedResult.
y = refRectB.
y;
492 expectedResult.
w = refRectA.
w - refRectB.
x;
493 expectedResult.
h = refRectA.
h - refRectB.
y;
498 refRectB.
x = rectA.
w - 1;
499 refRectB.
y = rectA.
y;
504 expectedResult.
x = refRectB.
x;
505 expectedResult.
y = refRectB.
y;
506 expectedResult.
w = 1;
507 expectedResult.
h = refRectB.
h;
512 refRectB.
x = 1 - rectA.
w;
513 refRectB.
y = rectA.
y;
514 refRectB.
w = refRectA.
w;
518 expectedResult.
x = 0;
519 expectedResult.
y = refRectB.
y;
520 expectedResult.
w = 1;
521 expectedResult.
h = refRectB.
h;
526 refRectB.
x = rectA.
x;
527 refRectB.
y = rectA.
h - 1;
532 expectedResult.
x = refRectB.
x;
533 expectedResult.
y = refRectB.
y;
534 expectedResult.
w = refRectB.
w;
535 expectedResult.
h = 1;
540 refRectB.
x = rectA.
x;
541 refRectB.
y = 1 - rectA.
h;
543 refRectB.
h = rectA.
h;
546 expectedResult.
x = refRectB.
x;
547 expectedResult.
y = 0;
548 expectedResult.
w = refRectB.
w;
549 expectedResult.
h = 1;
570 int offsetX, offsetY;
575 refRectB.
x = refRectA.
x;
576 refRectB.
y = refRectA.
y;
583 for (offsetX = -1; offsetX <= 1; offsetX++) {
584 for (offsetY = -1; offsetY <= 1; offsetY++) {
585 if (offsetX != 0 || offsetY != 0) {
588 refRectB.
x = refRectA.
x;
589 refRectB.
y = refRectA.
y;
590 refRectB.
x += offsetX;
591 refRectB.
y += offsetY;
713 SDL_Rect refRectA = { 0, 0, 32, 32 };
740 SDL_Rect refRectA = { 0, 0, 32, 32 };
749 refRectB.
w = refRectA.
w;
750 refRectB.
h = refRectA.
h;
767 SDL_Rect refRectA = { 0, 0, 32, 32 };
776 refRectB.
w = refRectA.
w;
777 refRectB.
h = refRectA.
h;
784 refRectB.
x = rectA.
w - 1;
785 refRectB.
y = rectA.
y;
794 refRectB.
x = 1 - rectA.
w;
795 refRectB.
y = rectA.
y;
796 refRectB.
w = refRectA.
w;
804 refRectB.
x = rectA.
x;
805 refRectB.
y = rectA.
h - 1;
814 refRectB.
x = rectA.
x;
815 refRectB.
y = 1 - rectA.
h;
817 refRectB.
h = rectA.
h;
839 int offsetX, offsetY;
844 refRectB.
x = refRectA.
x;
845 refRectB.
y = refRectA.
y;
852 for (offsetX = -1; offsetX <= 1; offsetX++) {
853 for (offsetY = -1; offsetY <= 1; offsetY++) {
854 if (offsetX != 0 || offsetY != 0) {
857 refRectB.
x = refRectA.
x;
858 refRectB.
y = refRectA.
y;
859 refRectB.
x += offsetX;
860 refRectB.
y += offsetY;
961 const int numPoints = 16;
969 int minx = 0, maxx = 0, miny = 0, maxy = 0;
973 for (i=0; i<numPoints; i++) {
976 refPoints[
i].
x = newx;
977 refPoints[
i].
y = newy;
986 if (newx < minx) minx = newx;
987 if (newx > maxx) maxx = newx;
988 if (newy < miny) miny = newy;
989 if (newy > maxy) maxy = newy;
996 "Check expected return value %s, got %s",
997 (expectedEnclosed==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE",
998 (anyEnclosedNoResult==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE");
999 for (i=0; i<numPoints; i++) {
1001 "Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)",
1002 i, refPoints[i].
x, refPoints[i].y, points[i].x, points[i].y);
1008 "Check return value %s, got %s",
1009 (expectedEnclosed==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE",
1010 (anyEnclosed==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE");
1011 for (i=0; i<numPoints; i++) {
1013 "Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)",
1014 i, refPoints[i].
x, refPoints[i].y, points[i].x, points[i].y);
1016 SDLTest_AssertCheck(result.
x==minx && result.
y==miny && result.
w==(maxx - minx + 1) && result.
h==(maxy - miny + 1),
1017 "Resulting enclosing rectangle incorrect: expected (%i,%i - %i,%i), actual (%i,%i - %i,%i)",
1018 minx, miny, maxx, maxy, result.
x, result.
y, result.
x + result.
w - 1, result.
y + result.
h - 1);
1031 const int numPoints = 8;
1032 const int halfPoints = 4;
1040 int minx = 0, maxx = 0, miny = 0, maxy = 0;
1044 for (i=0; i<numPoints; i++) {
1045 if (i < halfPoints) {
1049 newx = refPoints[i-halfPoints].
x;
1050 newy = refPoints[i-halfPoints].
y;
1052 refPoints[
i].
x = newx;
1053 refPoints[
i].
y = newy;
1062 if (newx < minx) minx = newx;
1063 if (newx > maxx) maxx = newx;
1064 if (newy < miny) miny = newy;
1065 if (newy > maxy) maxy = newy;
1072 "Check return value %s, got %s",
1073 (expectedEnclosed==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE",
1074 (anyEnclosedNoResult==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE");
1075 for (i=0; i<numPoints; i++) {
1077 "Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)",
1078 i, refPoints[i].
x, refPoints[i].y, points[i].x, points[i].y);
1084 "Check return value %s, got %s",
1085 (expectedEnclosed==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE",
1086 (anyEnclosed==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE");
1087 for (i=0; i<numPoints; i++) {
1089 "Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)",
1090 i, refPoints[i].
x, refPoints[i].y, points[i].x, points[i].y);
1092 SDLTest_AssertCheck(result.
x==minx && result.
y==miny && result.
w==(maxx - minx + 1) && result.
h==(maxy - miny + 1),
1093 "Check resulting enclosing rectangle: expected (%i,%i - %i,%i), actual (%i,%i - %i,%i)",
1094 minx, miny, maxx, maxy, result.
x, result.
y, result.
x + result.
w - 1, result.
y + result.
h - 1);
1107 const int numPoints = 16;
1117 int minx = 0, maxx = 0, miny = 0, maxy = 0;
1127 for (i=0; i<numPoints; i++) {
1130 refPoints[
i].
x = newx;
1131 refPoints[
i].
y = newy;
1134 if ((newx>=refClip.
x) && (newx<(refClip.
x + refClip.
w)) &&
1135 (newy>=refClip.
y) && (newy<(refClip.
y + refClip.
h))) {
1142 if (newx < minx) minx = newx;
1143 if (newx > maxx) maxx = newx;
1144 if (newy < miny) miny = newy;
1145 if (newy > maxy) maxy = newy;
1155 "Expected return value %s, got %s",
1156 (expectedEnclosed==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE",
1157 (anyEnclosedNoResult==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE");
1158 for (i=0; i<numPoints; i++) {
1160 "Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)",
1161 i, refPoints[i].
x, refPoints[i].y, points[i].x, points[i].y);
1164 "Check that source clipping rectangle was not modified");
1169 "Check return value %s, got %s",
1170 (expectedEnclosed==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE",
1171 (anyEnclosed==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE");
1172 for (i=0; i<numPoints; i++) {
1174 "Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)",
1175 i, refPoints[i].
x, refPoints[i].y, points[i].x, points[i].y);
1178 "Check that source clipping rectangle was not modified");
1180 SDLTest_AssertCheck(result.
x==minx && result.
y==miny && result.
w==(maxx - minx + 1) && result.
h==(maxy - miny + 1),
1181 "Check resulting enclosing rectangle: expected (%i,%i - %i,%i), actual (%i,%i - %i,%i)",
1182 minx, miny, maxx, maxy, result.
x, result.
y, result.
x + result.
w - 1, result.
y + result.
h - 1);
1191 "Check return value %s, got %s",
1192 (expectedEnclosed==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE",
1193 (anyEnclosed==
SDL_TRUE) ?
"SDL_TRUE" :
"SDL_FALSE");
1221 SDLTest_AssertCheck(anyEnclosed ==
SDL_FALSE,
"Check that functions returns SDL_FALSE when 1st parameter is NULL and 2nd parameter was 0");
1238 int minx, maxx, miny, maxy;
1242 for (dx = -1; dx < 2; dx++) {
1243 for (dy = -1; dy < 2; dy++) {
1244 if ((dx != 0) || (dy != 0)) {
1253 minx = (refRectA.
x<refRectB.
x) ? refRectA.
x : refRectB.
x;
1254 maxx = (refRectA.
x>refRectB.
x) ? refRectA.
x : refRectB.
x;
1255 miny = (refRectA.
y<refRectB.
y) ? refRectA.
y : refRectB.
y;
1256 maxy = (refRectA.
y>refRectB.
y) ? refRectA.
y : refRectB.
y;
1257 expectedResult.
x = minx;
1258 expectedResult.
y = miny;
1259 expectedResult.
w = maxx - minx + 1;
1260 expectedResult.
h = maxy - miny + 1;
1270 for (dx = -1; dx < 2; dx++) {
1271 for (dy = -1; dy < 2; dy++) {
1272 if ((dx != 0) || (dy != 0)) {
1277 refRectB.
x=refRectA.
x + 1 + dx*2;
1278 refRectB.
y=refRectA.
y + 1 + dy*2;
1279 refRectB.
w=refRectA.
w - 2;
1280 refRectB.
h=refRectA.
h - 2;
1281 expectedResult = refRectA;
1282 if (dx == -1) expectedResult.
x--;
1283 if (dy == -1) expectedResult.
y--;
1284 if ((dx == 1) || (dx == -1)) expectedResult.
w++;
1285 if ((dy == 1) || (dy == -1)) expectedResult.
h++;
1319 expectedResult = refRectB;
1334 expectedResult = refRectA;
1381 expectedResult = refRectA;
1395 expectedResult = refRectA;
1402 for (dx = -1; dx < 2; dx++) {
1403 for (dy = -1; dy < 2; dy++) {
1404 if ((dx != 0) || (dy != 0)) {
1409 refRectB = refRectA;
1410 if (dx == -1) refRectB.
x++;
1411 if ((dx == 1) || (dx == -1)) refRectB.
w--;
1412 if (dy == -1) refRectB.
y++;
1413 if ((dy == 1) || (dy == -1)) refRectB.
h--;
1414 expectedResult = refRectA;
1445 SDLTest_AssertPass(
"Check that function returns when 1st and 3rd parameter are NULL");
1447 SDLTest_AssertPass(
"Check that function returns when 2nd and 3rd parameter are NULL");
1479 for (w=-1; w<2; w++) {
1480 for (h=-1; h<2; h++) {
1481 if ((w != 1) || (h != 1)) {
1534 refRectB = refRectA;
1684 &
rectTest1, &
rectTest2, &
rectTest3, &
rectTest4, &
rectTest5, &
rectTest6, &
rectTest7, &
rectTest8, &
rectTest9, &
rectTest10, &
rectTest11, &
rectTest12, &
rectTest13, &
rectTest14,
1685 &
rectTest15, &
rectTest16, &
rectTest17, &
rectTest18, &
rectTest19, &
rectTest20, &
rectTest21, &
rectTest22, &
rectTest23, &
rectTest24, &
rectTest25, &
rectTest26, &
rectTest27,
int rect_testUnionRectParam(void *arg)
static const SDLTest_TestCaseReference rectTest21
#define SDL_HasIntersection
int rect_testIntersectRectPartial(void *arg)
int rect_testHasIntersectionParam(void *arg)
int rect_testHasIntersectionOutside(void *arg)
int rect_testEnclosePoints(void *arg)
static const SDLTest_TestCaseReference rectTest8
int rect_testUnionRectOutside(void *arg)
GLuint GLfloat GLfloat GLfloat x1
void _validateRectEmptyResults(SDL_bool empty, SDL_bool expectedEmpty, SDL_Rect *rect, SDL_Rect *refRect)
int rect_testIntersectRectAndLineInside(void *arg)
int rect_testRectEqualsParam(void *arg)
SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b)
Returns true if the two rectangles are equal.
static const SDLTest_TestCaseReference rectTest20
static const SDLTest_TestCaseReference rectTest13
static const SDLTest_TestCaseReference rectTest6
GLint GLint GLint GLint GLint x
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
static const SDLTest_TestCaseReference rectTest19
GLuint GLuint GLsizei count
static const SDLTest_TestCaseReference rectTest29
void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(1)
Explicitly pass without checking an assertion condition. Updates assertion counter.
static const SDLTest_TestCaseReference rectTest17
GLfloat GLfloat GLfloat GLfloat h
static const SDLTest_TestCaseReference rectTest4
GLfixed GLfixed GLfixed y2
int rect_testIntersectRectOutside(void *arg)
void _validateHasIntersectionResults(SDL_bool intersection, SDL_bool expectedIntersection, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB)
The structure that defines a point.
static const SDLTest_TestCaseReference rectTest22
static const SDLTest_TestCaseReference rectTest27
static const SDLTest_TestCaseReference rectTest15
static const SDLTest_TestCaseReference rectTest14
SDLTest_TestSuiteReference rectTestSuite
static const SDLTest_TestCaseReference rectTest9
#define SDL_IntersectRect
SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
Returns true if the rectangle has no area.
GLfixed GLfixed GLint GLint GLfixed points
int rect_testUnionRectEmpty(void *arg)
static const SDLTest_TestCaseReference * rectTests[]
void _validateRectEqualsResults(SDL_bool equals, SDL_bool expectedEquals, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB)
static const SDLTest_TestCaseReference rectTest11
static const SDLTest_TestCaseReference rectTest7
int rect_testIntersectRectEmpty(void *arg)
int(* SDLTest_TestCaseFp)(void *arg)
static const SDLTest_TestCaseReference rectTest25
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
int rect_testIntersectRectParam(void *arg)
int rect_testRectEquals(void *arg)
static const SDLTest_TestCaseReference rectTest18
void _validateIntersectRectAndLineResults(SDL_bool intersection, SDL_bool expectedIntersection, SDL_Rect *rect, SDL_Rect *refRect, int x1, int y1, int x2, int y2, int x1Ref, int y1Ref, int x2Ref, int y2Ref)
static const SDLTest_TestCaseReference rectTest28
static const SDLTest_TestCaseReference rectTest26
int rect_testIntersectRectInside(void *arg)
int rect_testHasIntersectionPartial(void *arg)
static const SDLTest_TestCaseReference rectTest24
GLubyte GLubyte GLubyte GLubyte w
void _validateIntersectRectResults(SDL_bool intersection, SDL_bool expectedIntersection, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB, SDL_Rect *result, SDL_Rect *expectedResult)
static const SDLTest_TestCaseReference rectTest5
int rect_testIntersectRectAndLineParam(void *arg)
int rect_testIntersectRectAndLineOutside(void *arg)
int rect_testHasIntersectionEmpty(void *arg)
GLint GLint GLint GLint GLint GLint y
static const SDLTest_TestCaseReference rectTest10
int rect_testUnionRectInside(void *arg)
int rect_testEnclosePointsWithClipping(void *arg)
static const SDLTest_TestCaseReference rectTest3
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
int rect_testIntersectRectPoint(void *arg)
static const SDLTest_TestCaseReference rectTest23
int rect_testIntersectRectAndLine(void *arg)
static const SDLTest_TestCaseReference rectTest1
static const SDLTest_TestCaseReference rectTest16
int rect_testHasIntersectionInside(void *arg)
int rect_testIntersectRectAndLineEmpty(void *arg)
int rect_testRectEmpty(void *arg)
int rect_testEnclosePointsRepeatedInput(void *arg)
static const SDLTest_TestCaseReference rectTest2
#define SDL_EnclosePoints
int rect_testRectEmptyParam(void *arg)
int rect_testHasIntersectionPoint(void *arg)
int rect_testEnclosePointsParam(void *arg)
#define SDL_IntersectRectAndLine
static const SDLTest_TestCaseReference rectTest12
A rectangle, with the origin at the upper left.
void _validateUnionRectResults(SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB, SDL_Rect *result, SDL_Rect *expectedResult)