testautomation_rect.c File Reference
`#include <stdio.h>`
`#include "SDL.h"`
`#include "SDL_test.h"`
Include dependency graph for testautomation_rect.c:

Go to the source code of this file.

## Functions

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)
int | rect_testIntersectRectAndLine (void *arg)
int | rect_testIntersectRectAndLineInside (void *arg)
int | rect_testIntersectRectAndLineOutside (void *arg)
int | rect_testIntersectRectAndLineEmpty (void *arg)
int | rect_testIntersectRectAndLineParam (void *arg)
void | _validateHasIntersectionResults (SDL_bool intersection, SDL_bool expectedIntersection, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB)
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)
void | _validateUnionRectResults (SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB, SDL_Rect *result, SDL_Rect *expectedResult)
void | _validateRectEmptyResults (SDL_bool empty, SDL_bool expectedEmpty, SDL_Rect *rect, SDL_Rect *refRect)
void | _validateRectEqualsResults (SDL_bool equals, SDL_bool expectedEquals, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB)
int | rect_testIntersectRectInside (void *arg)
int | rect_testIntersectRectOutside (void *arg)
int | rect_testIntersectRectPartial (void *arg)
int | rect_testIntersectRectPoint (void *arg)
int | rect_testIntersectRectEmpty (void *arg)
int | rect_testIntersectRectParam (void *arg)
int | rect_testHasIntersectionInside (void *arg)
int | rect_testHasIntersectionOutside (void *arg)
int | rect_testHasIntersectionPartial (void *arg)
int | rect_testHasIntersectionPoint (void *arg)
int | rect_testHasIntersectionEmpty (void *arg)
int | rect_testHasIntersectionParam (void *arg)
int | rect_testEnclosePoints (void *arg)
int | rect_testEnclosePointsRepeatedInput (void *arg)
int | rect_testEnclosePointsWithClipping (void *arg)
int | rect_testEnclosePointsParam (void *arg)
int | rect_testUnionRectOutside (void *arg)
int | rect_testUnionRectEmpty (void *arg)
int | rect_testUnionRectInside (void *arg)
int | rect_testUnionRectParam (void *arg)
int | rect_testRectEmpty (void *arg)
int | rect_testRectEmptyParam (void *arg)
int | rect_testRectEquals (void *arg)
int | rect_testRectEqualsParam (void *arg)

## Variables

static const SDLTest_TestCaseReference | rectTest1
static const SDLTest_TestCaseReference | rectTest2
static const SDLTest_TestCaseReference | rectTest3
static const SDLTest_TestCaseReference | rectTest4
static const SDLTest_TestCaseReference | rectTest5
static const SDLTest_TestCaseReference | rectTest6
static const SDLTest_TestCaseReference | rectTest7
static const SDLTest_TestCaseReference | rectTest8
static const SDLTest_TestCaseReference | rectTest9
static const SDLTest_TestCaseReference | rectTest10
static const SDLTest_TestCaseReference | rectTest11
static const SDLTest_TestCaseReference | rectTest12
static const SDLTest_TestCaseReference | rectTest13
static const SDLTest_TestCaseReference | rectTest14
static const SDLTest_TestCaseReference | rectTest15
static const SDLTest_TestCaseReference | rectTest16
static const SDLTest_TestCaseReference | rectTest17
static const SDLTest_TestCaseReference | rectTest18
static const SDLTest_TestCaseReference | rectTest19
static const SDLTest_TestCaseReference | rectTest20
static const SDLTest_TestCaseReference | rectTest21
static const SDLTest_TestCaseReference | rectTest22
static const SDLTest_TestCaseReference | rectTest23
static const SDLTest_TestCaseReference | rectTest24
static const SDLTest_TestCaseReference | rectTest25
static const SDLTest_TestCaseReference | rectTest26
static const SDLTest_TestCaseReference | rectTest27
static const SDLTest_TestCaseReference | rectTest28
static const SDLTest_TestCaseReference | rectTest29
static const SDLTest_TestCaseReference * | rectTests []
SDLTest_TestSuiteReference | rectTestSuite

## Function Documentation

## _validateHasIntersectionResults()

void _validateHasIntersectionResults | ( | SDL_bool | intersection,
|  | SDL_bool | expectedIntersection,
|  | SDL_Rect * | rectA,
|  | SDL_Rect * | rectB,
|  | SDL_Rect * | refRectA,
|  | SDL_Rect * | refRectB
| ) |  |

Definition at line 308 of file testautomation_rect.c.

References SDL_Rect::h, SDL_TRUE, SDLTest_AssertCheck(), SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

Referenced by _validateIntersectRectResults(), rect_testHasIntersectionEmpty(), rect_testHasIntersectionInside(), rect_testHasIntersectionOutside(), rect_testHasIntersectionPartial(), and rect_testHasIntersectionPoint().

{
SDLTest_AssertCheck(intersection == expectedIntersection,
"Check intersection result: expected %s, got %s intersecting A (%d,%d,%d,%d) with B (%d,%d,%d,%d)",
(expectedIntersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE",
(intersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE",
rectA->x, rectA->y, rectA->w, rectA->h,
rectB->x, rectB->y, rectB->w, rectB->h);
SDLTest_AssertCheck(rectA->x == refRectA->x && rectA->y == refRectA->y && rectA->w == refRectA->w && rectA->h == refRectA->h,
"Check that source rectangle A was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
rectA->x, rectA->y, rectA->w, rectA->h,
refRectA->x, refRectA->y, refRectA->w, refRectA->h);
SDLTest_AssertCheck(rectB->x == refRectB->x && rectB->y == refRectB->y && rectB->w == refRectB->w && rectB->h == refRectB->h,
"Check that source rectangle B was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
rectB->x, rectB->y, rectB->w, rectB->h,
refRectB->x, refRectB->y, refRectB->w, refRectB->h);
}
SDL_TRUE
Definition: SDL_stdinc.h:142
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
SDL_Rect::x
int x
Definition: SDL_rect.h:66
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66

## _validateIntersectRectAndLineResults()

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
| ) |  |

Original code: automated SDL rect test written by Edgar Simo "bobbens" New/updated tests: aschiffler at ferzkopp dot net

Definition at line 18 of file testautomation_rect.c.

References SDL_Rect::h, SDL_TRUE, SDLTest_AssertCheck(), SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

Referenced by rect_testIntersectRectAndLine(), rect_testIntersectRectAndLineEmpty(), rect_testIntersectRectAndLineInside(), and rect_testIntersectRectAndLineOutside().

{
SDLTest_AssertCheck(intersection == expectedIntersection,
"Check for correct intersection result: expected %s, got %s intersecting rect (%d,%d,%d,%d) with line (%d,%d - %d,%d)",
(expectedIntersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE",
(intersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE",
refRect->x, refRect->y, refRect->w, refRect->h,
x1Ref, y1Ref, x2Ref, y2Ref);
SDLTest_AssertCheck(rect->x == refRect->x && rect->y == refRect->y && rect->w == refRect->w && rect->h == refRect->h,
"Check that source rectangle was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
rect->x, rect->y, rect->w, rect->h,
refRect->x, refRect->y, refRect->w, refRect->h);
SDLTest_AssertCheck(x1 == x1Ref && y1 == y1Ref && x2 == x2Ref && y2 == y2Ref,
"Check if line was incorrectly clipped or modified: got (%d,%d - %d,%d) expected (%d,%d - %d,%d)",
x1, y1, x2, y2,
x1Ref, y1Ref, x2Ref, y2Ref);
}
x1
GLuint GLfloat GLfloat GLfloat x1
Definition: SDL_opengl_glext.h:8583
SDL_TRUE
Definition: SDL_stdinc.h:142
y2
GLfixed GLfixed GLfixed y2
Definition: SDL_opengl_glext.h:4583
x2
GLfixed GLfixed x2
Definition: SDL_opengl_glext.h:4583
y1
GLfixed y1
Definition: SDL_opengl_glext.h:4583
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
SDL_Rect::x
int x
Definition: SDL_rect.h:66
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66

## _validateIntersectRectResults()

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
| ) |  |

Definition at line 331 of file testautomation_rect.c.

References _validateHasIntersectionResults(), SDL_Rect::h, SDLTest_AssertCheck(), SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

Referenced by rect_testIntersectRectEmpty(), rect_testIntersectRectInside(), rect_testIntersectRectOutside(), rect_testIntersectRectPartial(), and rect_testIntersectRectPoint().

{
_validateHasIntersectionResults(intersection, expectedIntersection, rectA, rectB, refRectA, refRectB);
if (result && expectedResult) {
SDLTest_AssertCheck(result->x == expectedResult->x && result->y == expectedResult->y && result->w == expectedResult->w && result->h == expectedResult->h,
"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)",
rectA->x, rectA->y, rectA->w, rectA->h,
rectB->x, rectB->y, rectB->w, rectB->h,
result->x, result->y, result->w, result->h,
expectedResult->x, expectedResult->y, expectedResult->w, expectedResult->h);
}
}
_validateHasIntersectionResults
void _validateHasIntersectionResults(SDL_bool intersection, SDL_bool expectedIntersection, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB)
Definition: testautomation_rect.c:308
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
SDL_Rect::x
int x
Definition: SDL_rect.h:66
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66

## _validateRectEmptyResults()

void _validateRectEmptyResults | ( | SDL_bool | empty,
|  | SDL_bool | expectedEmpty,
|  | SDL_Rect * | rect,
|  | SDL_Rect * | refRect
| ) |  |

Definition at line 373 of file testautomation_rect.c.

References SDL_Rect::h, SDL_TRUE, SDLTest_AssertCheck(), SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

Referenced by rect_testRectEmpty().

{
SDLTest_AssertCheck(empty == expectedEmpty,
"Check for correct empty result: expected %s, got %s testing (%d,%d,%d,%d)",
(expectedEmpty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE",
(empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE",
rect->x, rect->y, rect->w, rect->h);
SDLTest_AssertCheck(rect->x == refRect->x && rect->y == refRect->y && rect->w == refRect->w && rect->h == refRect->h,
"Check that source rectangle was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
rect->x, rect->y, rect->w, rect->h,
refRect->x, refRect->y, refRect->w, refRect->h);
}
SDL_TRUE
Definition: SDL_stdinc.h:142
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
SDL_Rect::x
int x
Definition: SDL_rect.h:66
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66

## _validateRectEqualsResults()

void _validateRectEqualsResults | ( | SDL_bool | equals,
|  | SDL_bool | expectedEquals,
|  | SDL_Rect * | rectA,
|  | SDL_Rect * | rectB,
|  | SDL_Rect * | refRectA,
|  | SDL_Rect * | refRectB
| ) |  |

Definition at line 391 of file testautomation_rect.c.

References SDL_Rect::h, SDL_TRUE, SDLTest_AssertCheck(), SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

Referenced by rect_testRectEquals().

{
SDLTest_AssertCheck(equals == expectedEquals,
"Check for correct equals result: expected %s, got %s testing (%d,%d,%d,%d) and (%d,%d,%d,%d)",
(expectedEquals == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE",
(equals == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE",
rectA->x, rectA->y, rectA->w, rectA->h,
rectB->x, rectB->y, rectB->w, rectB->h);
SDLTest_AssertCheck(rectA->x == refRectA->x && rectA->y == refRectA->y && rectA->w == refRectA->w && rectA->h == refRectA->h,
"Check that source rectangle A was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
rectA->x, rectA->y, rectA->w, rectA->h,
refRectA->x, refRectA->y, refRectA->w, refRectA->h);
SDLTest_AssertCheck(rectB->x == refRectB->x && rectB->y == refRectB->y && rectB->w == refRectB->w && rectB->h == refRectB->h,
"Check that source rectangle B was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
rectB->x, rectB->y, rectB->w, rectB->h,
refRectB->x, refRectB->y, refRectB->w, refRectB->h);
}
SDL_TRUE
Definition: SDL_stdinc.h:142
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
SDL_Rect::x
int x
Definition: SDL_rect.h:66
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66

## _validateUnionRectResults()

void _validateUnionRectResults | ( | SDL_Rect * | rectA,
|  | SDL_Rect * | rectB,
|  | SDL_Rect * | refRectA,
|  | SDL_Rect * | refRectB,
|  | SDL_Rect * | result,
|  | SDL_Rect * | expectedResult
| ) |  |

Definition at line 350 of file testautomation_rect.c.

References SDL_Rect::h, SDLTest_AssertCheck(), SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

Referenced by rect_testUnionRectEmpty(), rect_testUnionRectInside(), and rect_testUnionRectOutside().

{
SDLTest_AssertCheck(rectA->x == refRectA->x && rectA->y == refRectA->y && rectA->w == refRectA->w && rectA->h == refRectA->h,
"Check that source rectangle A was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
rectA->x, rectA->y, rectA->w, rectA->h,
refRectA->x, refRectA->y, refRectA->w, refRectA->h);
SDLTest_AssertCheck(rectB->x == refRectB->x && rectB->y == refRectB->y && rectB->w == refRectB->w && rectB->h == refRectB->h,
"Check that source rectangle B was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)",
rectB->x, rectB->y, rectB->w, rectB->h,
refRectB->x, refRectB->y, refRectB->w, refRectB->h);
SDLTest_AssertCheck(result->x == expectedResult->x && result->y == expectedResult->y && result->w == expectedResult->w && result->h == expectedResult->h,
"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)",
rectA->x, rectA->y, rectA->w, rectA->h,
rectB->x, rectB->y, rectB->w, rectB->h,
result->x, result->y, result->w, result->h,
expectedResult->x, expectedResult->y, expectedResult->w, expectedResult->h);
}
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
SDL_Rect::x
int x
Definition: SDL_rect.h:66
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66

## rect_testEnclosePoints()

int rect_testEnclosePoints | ( | void * | arg | ) |

Definition at line 959 of file testautomation_rect.c.

References SDL_Rect::h, i, NULL, SDL_EnclosePoints, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Point::x, SDL_Rect::x, SDL_Point::y, and SDL_Rect::y.

{
const int numPoints = 16;
SDL_Point refPoints[16];
SDL_Point points[16];
SDL_Rect result;
SDL_bool anyEnclosed;
SDL_bool anyEnclosedNoResult;
SDL_bool expectedEnclosed = SDL_TRUE;
int newx, newy;
int minx = 0, maxx = 0, miny = 0, maxy = 0;
int i;
/* Create input data, tracking result */
for (i=0; i<numPoints; i++) {
newx = SDLTest_RandomIntegerInRange(-1024, 1024);
newy = SDLTest_RandomIntegerInRange(-1024, 1024);
refPoints[i].x = newx;
refPoints[i].y = newy;
points[i].x = newx;
points[i].y = newy;
if (i==0) {
minx = newx;
maxx = newx;
miny = newy;
maxy = newy;
} else {
if (newx < minx) minx = newx;
if (newx > maxx) maxx = newx;
if (newy < miny) miny = newy;
if (newy > maxy) maxy = newy;
}
}
/* Call function and validate - special case: no result requested */
anyEnclosedNoResult = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)NULL, (SDL_Rect *)NULL);
SDLTest_AssertCheck(expectedEnclosed==anyEnclosedNoResult,
"Check expected return value %s, got %s",
(expectedEnclosed==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE",
(anyEnclosedNoResult==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE");
for (i=0; i<numPoints; i++) {
SDLTest_AssertCheck(refPoints[i].x==points[i].x && refPoints[i].y==points[i].y,
"Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)",
i, refPoints[i].x, refPoints[i].y, points[i].x, points[i].y);
}
/* Call function and validate */
anyEnclosed = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)NULL, &result);
SDLTest_AssertCheck(expectedEnclosed==anyEnclosed,
"Check return value %s, got %s",
(expectedEnclosed==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE",
(anyEnclosed==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE");
for (i=0; i<numPoints; i++) {
SDLTest_AssertCheck(refPoints[i].x==points[i].x && refPoints[i].y==points[i].y,
"Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)",
i, refPoints[i].x, refPoints[i].y, points[i].x, points[i].y);
}
SDLTest_AssertCheck(result.x==minx && result.y==miny && result.w==(maxx - minx + 1) && result.h==(maxy - miny + 1),
"Resulting enclosing rectangle incorrect: expected (%i,%i - %i,%i), actual (%i,%i - %i,%i)",
minx, miny, maxx, maxy, result.x, result.y, result.x + result.w - 1, result.y + result.h - 1);
return TEST_COMPLETED;
}
SDL_TRUE
Definition: SDL_stdinc.h:142
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
SDL_Point
The structure that defines a point.
Definition: SDL_rect.h:48
points
GLfixed GLfixed GLint GLint GLfixed points
Definition: SDL_opengl_glext.h:4558
SDL_Point::x
int x
Definition: SDL_rect.h:50
SDL_Point::y
int y
Definition: SDL_rect.h:51
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
i
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)
Definition: SDL_x11sym.h:50
NULL
#define NULL
Definition: begin_code.h:164
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_EnclosePoints
#define SDL_EnclosePoints
Definition: SDL_dynapi_overrides.h:296
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testEnclosePointsParam()

int rect_testEnclosePointsParam | ( | void * | arg | ) |

Definition at line 1204 of file testautomation_rect.c.

References NULL, SDL_EnclosePoints, SDL_FALSE, SDLTest_AssertCheck(), SDLTest_RandomIntegerInRange(), and TEST_COMPLETED.

{
SDL_Point points[1];
int count;
SDL_Rect clip;
SDL_Rect result;
SDL_bool anyEnclosed;
/* invalid parameter combinations */
anyEnclosed = SDL_EnclosePoints((SDL_Point *)NULL, 1, (const SDL_Rect *)&clip, &result);
SDLTest_AssertCheck(anyEnclosed == SDL_FALSE, "Check that functions returns SDL_FALSE when 1st parameter is NULL");
anyEnclosed = SDL_EnclosePoints((const SDL_Point *)points, 0, (const SDL_Rect *)&clip, &result);
SDLTest_AssertCheck(anyEnclosed == SDL_FALSE, "Check that functions returns SDL_FALSE when 2nd parameter is 0");
count = SDLTest_RandomIntegerInRange(-100, -1);
anyEnclosed = SDL_EnclosePoints((const SDL_Point *)points, count, (const SDL_Rect *)&clip, &result);
SDLTest_AssertCheck(anyEnclosed == SDL_FALSE, "Check that functions returns SDL_FALSE when 2nd parameter is %i (negative)", count);
anyEnclosed = SDL_EnclosePoints((SDL_Point *)NULL, 0, (const SDL_Rect *)&clip, &result);
SDLTest_AssertCheck(anyEnclosed == SDL_FALSE, "Check that functions returns SDL_FALSE when 1st parameter is NULL and 2nd parameter was 0");
return TEST_COMPLETED;
}
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
count
GLuint GLuint GLsizei count
Definition: SDL_opengl.h:1571
SDL_FALSE
Definition: SDL_stdinc.h:141
SDL_Point
The structure that defines a point.
Definition: SDL_rect.h:48
points
GLfixed GLfixed GLint GLint GLfixed points
Definition: SDL_opengl_glext.h:4558
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
NULL
#define NULL
Definition: begin_code.h:164
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_EnclosePoints
#define SDL_EnclosePoints
Definition: SDL_dynapi_overrides.h:296
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testEnclosePointsRepeatedInput()

int rect_testEnclosePointsRepeatedInput | ( | void * | arg | ) |

Definition at line 1029 of file testautomation_rect.c.

References SDL_Rect::h, i, NULL, SDL_EnclosePoints, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Point::x, SDL_Rect::x, SDL_Point::y, and SDL_Rect::y.

{
const int numPoints = 8;
const int halfPoints = 4;
SDL_Point refPoints[8];
SDL_Point points[8];
SDL_Rect result;
SDL_bool anyEnclosed;
SDL_bool anyEnclosedNoResult;
SDL_bool expectedEnclosed = SDL_TRUE;
int newx, newy;
int minx = 0, maxx = 0, miny = 0, maxy = 0;
int i;
/* Create input data, tracking result */
for (i=0; i<numPoints; i++) {
if (i < halfPoints) {
newx = SDLTest_RandomIntegerInRange(-1024, 1024);
newy = SDLTest_RandomIntegerInRange(-1024, 1024);
} else {
newx = refPoints[i-halfPoints].x;
newy = refPoints[i-halfPoints].y;
}
refPoints[i].x = newx;
refPoints[i].y = newy;
points[i].x = newx;
points[i].y = newy;
if (i==0) {
minx = newx;
maxx = newx;
miny = newy;
maxy = newy;
} else {
if (newx < minx) minx = newx;
if (newx > maxx) maxx = newx;
if (newy < miny) miny = newy;
if (newy > maxy) maxy = newy;
}
}
/* Call function and validate - special case: no result requested */
anyEnclosedNoResult = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)NULL, (SDL_Rect *)NULL);
SDLTest_AssertCheck(expectedEnclosed==anyEnclosedNoResult,
"Check return value %s, got %s",
(expectedEnclosed==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE",
(anyEnclosedNoResult==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE");
for (i=0; i<numPoints; i++) {
SDLTest_AssertCheck(refPoints[i].x==points[i].x && refPoints[i].y==points[i].y,
"Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)",
i, refPoints[i].x, refPoints[i].y, points[i].x, points[i].y);
}
/* Call function and validate */
anyEnclosed = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)NULL, &result);
SDLTest_AssertCheck(expectedEnclosed==anyEnclosed,
"Check return value %s, got %s",
(expectedEnclosed==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE",
(anyEnclosed==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE");
for (i=0; i<numPoints; i++) {
SDLTest_AssertCheck(refPoints[i].x==points[i].x && refPoints[i].y==points[i].y,
"Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)",
i, refPoints[i].x, refPoints[i].y, points[i].x, points[i].y);
}
SDLTest_AssertCheck(result.x==minx && result.y==miny && result.w==(maxx - minx + 1) && result.h==(maxy - miny + 1),
"Check resulting enclosing rectangle: expected (%i,%i - %i,%i), actual (%i,%i - %i,%i)",
minx, miny, maxx, maxy, result.x, result.y, result.x + result.w - 1, result.y + result.h - 1);
return TEST_COMPLETED;
}
SDL_TRUE
Definition: SDL_stdinc.h:142
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
SDL_Point
The structure that defines a point.
Definition: SDL_rect.h:48
points
GLfixed GLfixed GLint GLint GLfixed points
Definition: SDL_opengl_glext.h:4558
SDL_Point::x
int x
Definition: SDL_rect.h:50
SDL_Point::y
int y
Definition: SDL_rect.h:51
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
i
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)
Definition: SDL_x11sym.h:50
NULL
#define NULL
Definition: begin_code.h:164
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_EnclosePoints
#define SDL_EnclosePoints
Definition: SDL_dynapi_overrides.h:296
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testEnclosePointsWithClipping()

int rect_testEnclosePointsWithClipping | ( | void * | arg | ) |

Definition at line 1105 of file testautomation_rect.c.

References SDL_Rect::h, i, NULL, SDL_EnclosePoints, SDL_FALSE, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Point::x, SDL_Rect::x, SDL_Point::y, and SDL_Rect::y.

{
const int numPoints = 16;
SDL_Point refPoints[16];
SDL_Point points[16];
SDL_Rect refClip;
SDL_Rect clip;
SDL_Rect result;
SDL_bool anyEnclosed;
SDL_bool anyEnclosedNoResult;
SDL_bool expectedEnclosed = SDL_FALSE;
int newx, newy;
int minx = 0, maxx = 0, miny = 0, maxy = 0;
int i;
/* Setup clipping rectangle */
refClip.x = SDLTest_RandomIntegerInRange(-1024, 1024);
refClip.y = SDLTest_RandomIntegerInRange(-1024, 1024);
refClip.w = SDLTest_RandomIntegerInRange(1, 1024);
refClip.h = SDLTest_RandomIntegerInRange(1, 1024);
/* Create input data, tracking result */
for (i=0; i<numPoints; i++) {
newx = SDLTest_RandomIntegerInRange(-1024, 1024);
newy = SDLTest_RandomIntegerInRange(-1024, 1024);
refPoints[i].x = newx;
refPoints[i].y = newy;
points[i].x = newx;
points[i].y = newy;
if ((newx>=refClip.x) && (newx<(refClip.x + refClip.w)) &&
(newy>=refClip.y) && (newy<(refClip.y + refClip.h))) {
if (expectedEnclosed==SDL_FALSE) {
minx = newx;
maxx = newx;
miny = newy;
maxy = newy;
} else {
if (newx < minx) minx = newx;
if (newx > maxx) maxx = newx;
if (newy < miny) miny = newy;
if (newy > maxy) maxy = newy;
}
expectedEnclosed = SDL_TRUE;
}
}
/* Call function and validate - special case: no result requested */
clip = refClip;
anyEnclosedNoResult = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)&clip, (SDL_Rect *)NULL);
SDLTest_AssertCheck(expectedEnclosed==anyEnclosedNoResult,
"Expected return value %s, got %s",
(expectedEnclosed==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE",
(anyEnclosedNoResult==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE");
for (i=0; i<numPoints; i++) {
SDLTest_AssertCheck(refPoints[i].x==points[i].x && refPoints[i].y==points[i].y,
"Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)",
i, refPoints[i].x, refPoints[i].y, points[i].x, points[i].y);
}
SDLTest_AssertCheck(refClip.x==clip.x && refClip.y==clip.y && refClip.w==clip.w && refClip.h==clip.h,
"Check that source clipping rectangle was not modified");
/* Call function and validate */
anyEnclosed = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)&clip, &result);
SDLTest_AssertCheck(expectedEnclosed==anyEnclosed,
"Check return value %s, got %s",
(expectedEnclosed==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE",
(anyEnclosed==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE");
for (i=0; i<numPoints; i++) {
SDLTest_AssertCheck(refPoints[i].x==points[i].x && refPoints[i].y==points[i].y,
"Check that source point %i was not modified: expected (%i,%i) actual (%i,%i)",
i, refPoints[i].x, refPoints[i].y, points[i].x, points[i].y);
}
SDLTest_AssertCheck(refClip.x==clip.x && refClip.y==clip.y && refClip.w==clip.w && refClip.h==clip.h,
"Check that source clipping rectangle was not modified");
if (expectedEnclosed==SDL_TRUE) {
SDLTest_AssertCheck(result.x==minx && result.y==miny && result.w==(maxx - minx + 1) && result.h==(maxy - miny + 1),
"Check resulting enclosing rectangle: expected (%i,%i - %i,%i), actual (%i,%i - %i,%i)",
minx, miny, maxx, maxy, result.x, result.y, result.x + result.w - 1, result.y + result.h - 1);
}
/* Empty clipping rectangle */
clip.w = 0;
clip.h = 0;
expectedEnclosed = SDL_FALSE;
anyEnclosed = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)&clip, &result);
SDLTest_AssertCheck(expectedEnclosed==anyEnclosed,
"Check return value %s, got %s",
(expectedEnclosed==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE",
(anyEnclosed==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE");
return TEST_COMPLETED;
}
SDL_TRUE
Definition: SDL_stdinc.h:142
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
SDL_FALSE
Definition: SDL_stdinc.h:141
SDL_Point
The structure that defines a point.
Definition: SDL_rect.h:48
points
GLfixed GLfixed GLint GLint GLfixed points
Definition: SDL_opengl_glext.h:4558
SDL_Point::x
int x
Definition: SDL_rect.h:50
SDL_Point::y
int y
Definition: SDL_rect.h:51
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
i
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)
Definition: SDL_x11sym.h:50
NULL
#define NULL
Definition: begin_code.h:164
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_EnclosePoints
#define SDL_EnclosePoints
Definition: SDL_dynapi_overrides.h:296
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testHasIntersectionEmpty()

int rect_testHasIntersectionEmpty | ( | void * | arg | ) |

Definition at line 878 of file testautomation_rect.c.

References _validateHasIntersectionResults(), SDL_Rect::h, SDL_FALSE, SDL_HasIntersection, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRectA;
SDL_Rect refRectB;
SDL_Rect rectA;
SDL_Rect rectB;
SDL_bool intersection;
/* Rect A empty */
refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
refRectA.w = SDLTest_RandomIntegerInRange(1, 100);
refRectA.h = SDLTest_RandomIntegerInRange(1, 100);
refRectB = refRectA;
refRectA.w = 0;
refRectA.h = 0;
rectA = refRectA;
rectB = refRectB;
intersection = SDL_HasIntersection(&rectA, &rectB);
_validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB);
/* Rect B empty */
refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
refRectA.w = SDLTest_RandomIntegerInRange(1, 100);
refRectA.h = SDLTest_RandomIntegerInRange(1, 100);
refRectB = refRectA;
refRectB.w = 0;
refRectB.h = 0;
rectA = refRectA;
rectB = refRectB;
intersection = SDL_HasIntersection(&rectA, &rectB);
_validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB);
/* Rect A and B empty */
refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
refRectA.w = SDLTest_RandomIntegerInRange(1, 100);
refRectA.h = SDLTest_RandomIntegerInRange(1, 100);
refRectB = refRectA;
refRectA.w = 0;
refRectA.h = 0;
refRectB.w = 0;
refRectB.h = 0;
rectA = refRectA;
rectB = refRectB;
intersection = SDL_HasIntersection(&rectA, &rectB);
_validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB);
return TEST_COMPLETED;
}
SDL_HasIntersection
#define SDL_HasIntersection
Definition: SDL_dynapi_overrides.h:293
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
SDL_FALSE
Definition: SDL_stdinc.h:141
_validateHasIntersectionResults
void _validateHasIntersectionResults(SDL_bool intersection, SDL_bool expectedIntersection, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB)
Definition: testautomation_rect.c:308
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testHasIntersectionInside()

int rect_testHasIntersectionInside | ( | void * | arg | ) |

Definition at line 711 of file testautomation_rect.c.

References _validateHasIntersectionResults(), SDL_Rect::h, SDL_HasIntersection, SDL_TRUE, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRectA = { 0, 0, 32, 32 };
SDL_Rect refRectB;
SDL_Rect rectA;
SDL_Rect rectB;
SDL_bool intersection;
/* rectB fully contained in rectA */
refRectB.x = 0;
refRectB.y = 0;
refRectB.w = SDLTest_RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1);
refRectB.h = SDLTest_RandomIntegerInRange(refRectA.y + 1, refRectA.y + refRectA.h - 1);
rectA = refRectA;
rectB = refRectB;
intersection = SDL_HasIntersection(&rectA, &rectB);
_validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB);
return TEST_COMPLETED;
}
SDL_HasIntersection
#define SDL_HasIntersection
Definition: SDL_dynapi_overrides.h:293
SDL_TRUE
Definition: SDL_stdinc.h:142
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
_validateHasIntersectionResults
void _validateHasIntersectionResults(SDL_bool intersection, SDL_bool expectedIntersection, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB)
Definition: testautomation_rect.c:308
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testHasIntersectionOutside()

int rect_testHasIntersectionOutside | ( | void * | arg | ) |

Definition at line 738 of file testautomation_rect.c.

References _validateHasIntersectionResults(), SDL_Rect::h, SDL_FALSE, SDL_HasIntersection, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRectA = { 0, 0, 32, 32 };
SDL_Rect refRectB;
SDL_Rect rectA;
SDL_Rect rectB;
SDL_bool intersection;
/* rectB fully outside of rectA */
refRectB.x = refRectA.x + refRectA.w + SDLTest_RandomIntegerInRange(1, 10);
refRectB.y = refRectA.y + refRectA.h + SDLTest_RandomIntegerInRange(1, 10);
refRectB.w = refRectA.w;
refRectB.h = refRectA.h;
rectA = refRectA;
rectB = refRectB;
intersection = SDL_HasIntersection(&rectA, &rectB);
_validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB);
return TEST_COMPLETED;
}
SDL_HasIntersection
#define SDL_HasIntersection
Definition: SDL_dynapi_overrides.h:293
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
SDL_FALSE
Definition: SDL_stdinc.h:141
_validateHasIntersectionResults
void _validateHasIntersectionResults(SDL_bool intersection, SDL_bool expectedIntersection, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB)
Definition: testautomation_rect.c:308
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testHasIntersectionParam()

int rect_testHasIntersectionParam | ( | void * | arg | ) |

Definition at line 936 of file testautomation_rect.c.

References NULL, SDL_FALSE, SDL_HasIntersection, SDLTest_AssertCheck(), and TEST_COMPLETED.

{
SDL_Rect rectA;
SDL_Rect rectB;
SDL_bool intersection;
/* invalid parameter combinations */
intersection = SDL_HasIntersection((SDL_Rect *)NULL, &rectB);
SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL");
intersection = SDL_HasIntersection(&rectA, (SDL_Rect *)NULL);
SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 2st parameter is NULL");
intersection = SDL_HasIntersection((SDL_Rect *)NULL, (SDL_Rect *)NULL);
SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when all parameters are NULL");
return TEST_COMPLETED;
}
SDL_HasIntersection
#define SDL_HasIntersection
Definition: SDL_dynapi_overrides.h:293
SDL_FALSE
Definition: SDL_stdinc.h:141
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
NULL
#define NULL
Definition: begin_code.h:164
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testHasIntersectionPartial()

int rect_testHasIntersectionPartial | ( | void * | arg | ) |

Definition at line 765 of file testautomation_rect.c.

References _validateHasIntersectionResults(), SDL_Rect::h, SDL_HasIntersection, SDL_TRUE, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRectA = { 0, 0, 32, 32 };
SDL_Rect refRectB;
SDL_Rect rectA;
SDL_Rect rectB;
SDL_bool intersection;
/* rectB partially contained in rectA */
refRectB.x = SDLTest_RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1);
refRectB.y = SDLTest_RandomIntegerInRange(refRectA.y + 1, refRectA.y + refRectA.h - 1);
refRectB.w = refRectA.w;
refRectB.h = refRectA.h;
rectA = refRectA;
rectB = refRectB;
intersection = SDL_HasIntersection(&rectA, &rectB);
_validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB);
/* rectB right edge */
refRectB.x = rectA.w - 1;
refRectB.y = rectA.y;
refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1);
refRectB.h = SDLTest_RandomIntegerInRange(1, refRectA.h - 1);
rectA = refRectA;
rectB = refRectB;
intersection = SDL_HasIntersection(&rectA, &rectB);
_validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB);
/* rectB left edge */
refRectB.x = 1 - rectA.w;
refRectB.y = rectA.y;
refRectB.w = refRectA.w;
refRectB.h = SDLTest_RandomIntegerInRange(1, refRectA.h - 1);
rectA = refRectA;
rectB = refRectB;
intersection = SDL_HasIntersection(&rectA, &rectB);
_validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB);
/* rectB bottom edge */
refRectB.x = rectA.x;
refRectB.y = rectA.h - 1;
refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1);
refRectB.h = SDLTest_RandomIntegerInRange(1, refRectA.h - 1);
rectA = refRectA;
rectB = refRectB;
intersection = SDL_HasIntersection(&rectA, &rectB);
_validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB);
/* rectB top edge */
refRectB.x = rectA.x;
refRectB.y = 1 - rectA.h;
refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1);
refRectB.h = rectA.h;
rectA = refRectA;
rectB = refRectB;
intersection = SDL_HasIntersection(&rectA, &rectB);
_validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB);
return TEST_COMPLETED;
}
SDL_HasIntersection
#define SDL_HasIntersection
Definition: SDL_dynapi_overrides.h:293
SDL_TRUE
Definition: SDL_stdinc.h:142
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
_validateHasIntersectionResults
void _validateHasIntersectionResults(SDL_bool intersection, SDL_bool expectedIntersection, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB)
Definition: testautomation_rect.c:308
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testHasIntersectionPoint()

int rect_testHasIntersectionPoint | ( | void * | arg | ) |

Definition at line 832 of file testautomation_rect.c.

References _validateHasIntersectionResults(), SDL_FALSE, SDL_HasIntersection, SDL_TRUE, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRectA = { 0, 0, 1, 1 };
SDL_Rect refRectB = { 0, 0, 1, 1 };
SDL_Rect rectA;
SDL_Rect rectB;
SDL_bool intersection;
int offsetX, offsetY;
/* intersecting pixels */
refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
refRectB.x = refRectA.x;
refRectB.y = refRectA.y;
rectA = refRectA;
rectB = refRectB;
intersection = SDL_HasIntersection(&rectA, &rectB);
_validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB);
/* non-intersecting pixels cases */
for (offsetX = -1; offsetX <= 1; offsetX++) {
for (offsetY = -1; offsetY <= 1; offsetY++) {
if (offsetX != 0 || offsetY != 0) {
refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
refRectB.x = refRectA.x;
refRectB.y = refRectA.y;
refRectB.x += offsetX;
refRectB.y += offsetY;
rectA = refRectA;
rectB = refRectB;
intersection = SDL_HasIntersection(&rectA, &rectB);
_validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB);
}
}
}
return TEST_COMPLETED;
}
SDL_HasIntersection
#define SDL_HasIntersection
Definition: SDL_dynapi_overrides.h:293
SDL_TRUE
Definition: SDL_stdinc.h:142
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
SDL_FALSE
Definition: SDL_stdinc.h:141
_validateHasIntersectionResults
void _validateHasIntersectionResults(SDL_bool intersection, SDL_bool expectedIntersection, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB)
Definition: testautomation_rect.c:308
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testIntersectRectAndLine()

int rect_testIntersectRectAndLine | ( | void * | arg | ) |

Definition at line 49 of file testautomation_rect.c.

References _validateIntersectRectAndLineResults(), SDL_Rect::h, rect, SDL_IntersectRectAndLine, SDL_TRUE, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, and SDL_Rect::w.

{
SDL_Rect refRect = { 0, 0, 32, 32 };
SDL_Rect rect;
int x1, y1;
int x2, y2;
SDL_bool intersected;
int xLeft = -SDLTest_RandomIntegerInRange(1, refRect.w);
int xRight = refRect.w + SDLTest_RandomIntegerInRange(1, refRect.w);
int yTop = -SDLTest_RandomIntegerInRange(1, refRect.h);
int yBottom = refRect.h + SDLTest_RandomIntegerInRange(1, refRect.h);
x1 = xLeft;
y1 = 15;
x2 = xRight;
y2 = 15;
rect = refRect;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
_validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 0, 15, 31, 15);
x1 = 15;
y1 = yTop;
x2 = 15;
y2 = yBottom;
rect = refRect;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
_validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 15, 0, 15, 31);
x1 = -refRect.w;
y1 = -refRect.h;
x2 = 2*refRect.w;
y2 = 2*refRect.h;
rect = refRect;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
_validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 0, 0, 31, 31);
x1 = 2*refRect.w;
y1 = 2*refRect.h;
x2 = -refRect.w;
y2 = -refRect.h;
rect = refRect;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
_validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 31, 31, 0, 0);
x1 = -1;
y1 = 32;
x2 = 32;
y2 = -1;
rect = refRect;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
_validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 0, 31, 31, 0);
x1 = 32;
y1 = -1;
x2 = -1;
y2 = 32;
rect = refRect;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
_validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 31, 0, 0, 31);
return TEST_COMPLETED;
}
x1
GLuint GLfloat GLfloat GLfloat x1
Definition: SDL_opengl_glext.h:8583
SDL_TRUE
Definition: SDL_stdinc.h:142
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
rect
SDL_Rect rect
Definition: testrelative.c:27
y2
GLfixed GLfixed GLfixed y2
Definition: SDL_opengl_glext.h:4583
x2
GLfixed GLfixed x2
Definition: SDL_opengl_glext.h:4583
y1
GLfixed y1
Definition: SDL_opengl_glext.h:4583
_validateIntersectRectAndLineResults
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)
Definition: testautomation_rect.c:18
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_IntersectRectAndLine
#define SDL_IntersectRectAndLine
Definition: SDL_dynapi_overrides.h:297
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testIntersectRectAndLineEmpty()

int rect_testIntersectRectAndLineEmpty | ( | void * | arg | ) |

Definition at line 242 of file testautomation_rect.c.

References _validateIntersectRectAndLineResults(), SDL_Rect::h, rect, SDL_FALSE, SDL_IntersectRectAndLine, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRect;
SDL_Rect rect;
int x1, y1, x1Ref, y1Ref;
int x2, y2, x2Ref, y2Ref;
SDL_bool intersected;
refRect.x = SDLTest_RandomIntegerInRange(1, 1024);
refRect.y = SDLTest_RandomIntegerInRange(1, 1024);
refRect.w = 0;
refRect.h = 0;
x1Ref = refRect.x;
y1Ref = refRect.y;
x2Ref = SDLTest_RandomIntegerInRange(1, 1024);
y2Ref = SDLTest_RandomIntegerInRange(1, 1024);
x1 = x1Ref;
y1 = y1Ref;
x2 = x2Ref;
y2 = y2Ref;
rect = refRect;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
_validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, x1Ref, y1Ref, x2Ref, y2Ref);
return TEST_COMPLETED;
}
x1
GLuint GLfloat GLfloat GLfloat x1
Definition: SDL_opengl_glext.h:8583
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
rect
SDL_Rect rect
Definition: testrelative.c:27
SDL_FALSE
Definition: SDL_stdinc.h:141
y2
GLfixed GLfixed GLfixed y2
Definition: SDL_opengl_glext.h:4583
x2
GLfixed GLfixed x2
Definition: SDL_opengl_glext.h:4583
y1
GLfixed y1
Definition: SDL_opengl_glext.h:4583
_validateIntersectRectAndLineResults
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)
Definition: testautomation_rect.c:18
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_IntersectRectAndLine
#define SDL_IntersectRectAndLine
Definition: SDL_dynapi_overrides.h:297
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testIntersectRectAndLineInside()

int rect_testIntersectRectAndLineInside | ( | void * | arg | ) |

Definition at line 120 of file testautomation_rect.c.

References _validateIntersectRectAndLineResults(), SDL_Rect::h, rect, SDL_IntersectRectAndLine, SDL_TRUE, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRect = { 0, 0, 32, 32 };
SDL_Rect rect;
int x1, y1;
int x2, y2;
SDL_bool intersected;
int xmin = refRect.x;
int xmax = refRect.x + refRect.w - 1;
int ymin = refRect.y;
int ymax = refRect.y + refRect.h - 1;
int x1Ref = SDLTest_RandomIntegerInRange(xmin + 1, xmax - 1);
int y1Ref = SDLTest_RandomIntegerInRange(ymin + 1, ymax - 1);
int x2Ref = SDLTest_RandomIntegerInRange(xmin + 1, xmax - 1);
int y2Ref = SDLTest_RandomIntegerInRange(ymin + 1, ymax - 1);
x1 = x1Ref;
y1 = y1Ref;
x2 = x2Ref;
y2 = y2Ref;
rect = refRect;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
_validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, x1Ref, y1Ref, x2Ref, y2Ref);
x1 = x1Ref;
y1 = y1Ref;
x2 = xmax;
y2 = ymax;
rect = refRect;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
_validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, x1Ref, y1Ref, xmax, ymax);
x1 = xmin;
y1 = ymin;
x2 = x2Ref;
y2 = y2Ref;
rect = refRect;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
_validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, xmin, ymin, x2Ref, y2Ref);
x1 = xmin;
y1 = ymin;
x2 = xmax;
y2 = ymax;
rect = refRect;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
_validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, xmin, ymin, xmax, ymax);
x1 = xmin;
y1 = ymax;
x2 = xmax;
y2 = ymin;
rect = refRect;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
_validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, xmin, ymax, xmax, ymin);
return TEST_COMPLETED;
}
x1
GLuint GLfloat GLfloat GLfloat x1
Definition: SDL_opengl_glext.h:8583
SDL_TRUE
Definition: SDL_stdinc.h:142
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
rect
SDL_Rect rect
Definition: testrelative.c:27
y2
GLfixed GLfixed GLfixed y2
Definition: SDL_opengl_glext.h:4583
x2
GLfixed GLfixed x2
Definition: SDL_opengl_glext.h:4583
y1
GLfixed y1
Definition: SDL_opengl_glext.h:4583
_validateIntersectRectAndLineResults
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)
Definition: testautomation_rect.c:18
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_IntersectRectAndLine
#define SDL_IntersectRectAndLine
Definition: SDL_dynapi_overrides.h:297
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testIntersectRectAndLineOutside()

int rect_testIntersectRectAndLineOutside | ( | void * | arg | ) |

Definition at line 187 of file testautomation_rect.c.

References _validateIntersectRectAndLineResults(), SDL_Rect::h, rect, SDL_FALSE, SDL_IntersectRectAndLine, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, and SDL_Rect::w.

{
SDL_Rect refRect = { 0, 0, 32, 32 };
SDL_Rect rect;
int x1, y1;
int x2, y2;
SDL_bool intersected;
int xLeft = -SDLTest_RandomIntegerInRange(1, refRect.w);
int xRight = refRect.w + SDLTest_RandomIntegerInRange(1, refRect.w);
int yTop = -SDLTest_RandomIntegerInRange(1, refRect.h);
int yBottom = refRect.h + SDLTest_RandomIntegerInRange(1, refRect.h);
x1 = xLeft;
y1 = 0;
x2 = xLeft;
y2 = 31;
rect = refRect;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
_validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, xLeft, 0, xLeft, 31);
x1 = xRight;
y1 = 0;
x2 = xRight;
y2 = 31;
rect = refRect;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
_validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, xRight, 0, xRight, 31);
x1 = 0;
y1 = yTop;
x2 = 31;
y2 = yTop;
rect = refRect;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
_validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, 0, yTop, 31, yTop);
x1 = 0;
y1 = yBottom;
x2 = 31;
y2 = yBottom;
rect = refRect;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
_validateIntersectRectAndLineResults(intersected, SDL_FALSE, &rect, &refRect, x1, y1, x2, y2, 0, yBottom, 31, yBottom);
return TEST_COMPLETED;
}
x1
GLuint GLfloat GLfloat GLfloat x1
Definition: SDL_opengl_glext.h:8583
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
rect
SDL_Rect rect
Definition: testrelative.c:27
SDL_FALSE
Definition: SDL_stdinc.h:141
y2
GLfixed GLfixed GLfixed y2
Definition: SDL_opengl_glext.h:4583
x2
GLfixed GLfixed x2
Definition: SDL_opengl_glext.h:4583
y1
GLfixed y1
Definition: SDL_opengl_glext.h:4583
_validateIntersectRectAndLineResults
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)
Definition: testautomation_rect.c:18
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_IntersectRectAndLine
#define SDL_IntersectRectAndLine
Definition: SDL_dynapi_overrides.h:297
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testIntersectRectAndLineParam()

int rect_testIntersectRectAndLineParam | ( | void * | arg | ) |

Definition at line 277 of file testautomation_rect.c.

References SDL_Rect::h, NULL, rect, SDL_FALSE, SDL_IntersectRectAndLine, SDL_TRUE, SDLTest_AssertCheck(), TEST_COMPLETED, and SDL_Rect::w.

{
SDL_Rect rect = { 0, 0, 32, 32 };
int x1 = rect.w / 2;
int y1 = rect.h / 2;
int x2 = x1;
int y2 = 2 * rect.h;
SDL_bool intersected;
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
SDLTest_AssertCheck(intersected == SDL_TRUE, "Check that intersection result was SDL_TRUE");
intersected = SDL_IntersectRectAndLine((SDL_Rect *)NULL, &x1, &y1, &x2, &y2);
SDLTest_AssertCheck(intersected == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL");
intersected = SDL_IntersectRectAndLine(&rect, (int *)NULL, &y1, &x2, &y2);
SDLTest_AssertCheck(intersected == SDL_FALSE, "Check that function returns SDL_FALSE when 2nd parameter is NULL");
intersected = SDL_IntersectRectAndLine(&rect, &x1, (int *)NULL, &x2, &y2);
SDLTest_AssertCheck(intersected == SDL_FALSE, "Check that function returns SDL_FALSE when 3rd parameter is NULL");
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, (int *)NULL, &y2);
SDLTest_AssertCheck(intersected == SDL_FALSE, "Check that function returns SDL_FALSE when 4th parameter is NULL");
intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, (int *)NULL);
SDLTest_AssertCheck(intersected == SDL_FALSE, "Check that function returns SDL_FALSE when 5th parameter is NULL");
intersected = SDL_IntersectRectAndLine((SDL_Rect *)NULL, (int *)NULL, (int *)NULL, (int *)NULL, (int *)NULL);
SDLTest_AssertCheck(intersected == SDL_FALSE, "Check that function returns SDL_FALSE when all parameters are NULL");
return TEST_COMPLETED;
}
x1
GLuint GLfloat GLfloat GLfloat x1
Definition: SDL_opengl_glext.h:8583
SDL_TRUE
Definition: SDL_stdinc.h:142
rect
SDL_Rect rect
Definition: testrelative.c:27
SDL_FALSE
Definition: SDL_stdinc.h:141
y2
GLfixed GLfixed GLfixed y2
Definition: SDL_opengl_glext.h:4583
x2
GLfixed GLfixed x2
Definition: SDL_opengl_glext.h:4583
y1
GLfixed y1
Definition: SDL_opengl_glext.h:4583
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
NULL
#define NULL
Definition: begin_code.h:164
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_IntersectRectAndLine
#define SDL_IntersectRectAndLine
Definition: SDL_dynapi_overrides.h:297
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testIntersectRectEmpty()

int rect_testIntersectRectEmpty | ( | void * | arg | ) |

Definition at line 609 of file testautomation_rect.c.

References _validateIntersectRectResults(), SDL_Rect::h, NULL, SDL_FALSE, SDL_IntersectRect, SDL_RectEmpty(), SDL_TRUE, SDLTest_AssertCheck(), SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRectA;
SDL_Rect refRectB;
SDL_Rect rectA;
SDL_Rect rectB;
SDL_Rect result;
SDL_bool intersection;
SDL_bool empty;
/* Rect A empty */
result.w = SDLTest_RandomIntegerInRange(1, 100);
result.h = SDLTest_RandomIntegerInRange(1, 100);
refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
refRectA.w = SDLTest_RandomIntegerInRange(1, 100);
refRectA.h = SDLTest_RandomIntegerInRange(1, 100);
refRectB = refRectA;
refRectA.w = 0;
refRectA.h = 0;
rectA = refRectA;
rectB = refRectB;
intersection = SDL_IntersectRect(&rectA, &rectB, &result);
_validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL);
empty = (SDL_bool)SDL_RectEmpty(&result);
SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE");
/* Rect B empty */
result.w = SDLTest_RandomIntegerInRange(1, 100);
result.h = SDLTest_RandomIntegerInRange(1, 100);
refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
refRectA.w = SDLTest_RandomIntegerInRange(1, 100);
refRectA.h = SDLTest_RandomIntegerInRange(1, 100);
refRectB = refRectA;
refRectB.w = 0;
refRectB.h = 0;
rectA = refRectA;
rectB = refRectB;
intersection = SDL_IntersectRect(&rectA, &rectB, &result);
_validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL);
empty = (SDL_bool)SDL_RectEmpty(&result);
SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE");
/* Rect A and B empty */
result.w = SDLTest_RandomIntegerInRange(1, 100);
result.h = SDLTest_RandomIntegerInRange(1, 100);
refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
refRectA.w = SDLTest_RandomIntegerInRange(1, 100);
refRectA.h = SDLTest_RandomIntegerInRange(1, 100);
refRectB = refRectA;
refRectA.w = 0;
refRectA.h = 0;
refRectB.w = 0;
refRectB.h = 0;
rectA = refRectA;
rectB = refRectB;
intersection = SDL_IntersectRect(&rectA, &rectB, &result);
_validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL);
empty = (SDL_bool)SDL_RectEmpty(&result);
SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE");
return TEST_COMPLETED;
}
SDL_TRUE
Definition: SDL_stdinc.h:142
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
SDL_FALSE
Definition: SDL_stdinc.h:141
SDL_IntersectRect
#define SDL_IntersectRect
Definition: SDL_dynapi_overrides.h:294
SDL_RectEmpty
SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
Returns true if the rectangle has no area.
Definition: SDL_rect.h:82
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
_validateIntersectRectResults
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)
Definition: testautomation_rect.c:331
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
NULL
#define NULL
Definition: begin_code.h:164
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testIntersectRectInside()

int rect_testIntersectRectInside | ( | void * | arg | ) |

Definition at line 417 of file testautomation_rect.c.

References _validateIntersectRectResults(), SDL_Rect::h, SDL_IntersectRect, SDL_TRUE, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRectA = { 0, 0, 32, 32 };
SDL_Rect refRectB;
SDL_Rect rectA;
SDL_Rect rectB;
SDL_Rect result;
SDL_bool intersection;
/* rectB fully contained in rectA */
refRectB.x = 0;
refRectB.y = 0;
refRectB.w = SDLTest_RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1);
refRectB.h = SDLTest_RandomIntegerInRange(refRectA.y + 1, refRectA.y + refRectA.h - 1);
rectA = refRectA;
rectB = refRectB;
intersection = SDL_IntersectRect(&rectA, &rectB, &result);
_validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &refRectB);
return TEST_COMPLETED;
}
SDL_TRUE
Definition: SDL_stdinc.h:142
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
SDL_IntersectRect
#define SDL_IntersectRect
Definition: SDL_dynapi_overrides.h:294
_validateIntersectRectResults
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)
Definition: testautomation_rect.c:331
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testIntersectRectOutside()

int rect_testIntersectRectOutside | ( | void * | arg | ) |

Definition at line 445 of file testautomation_rect.c.

References _validateIntersectRectResults(), SDL_Rect::h, NULL, SDL_FALSE, SDL_IntersectRect, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRectA = { 0, 0, 32, 32 };
SDL_Rect refRectB;
SDL_Rect rectA;
SDL_Rect rectB;
SDL_Rect result;
SDL_bool intersection;
/* rectB fully outside of rectA */
refRectB.x = refRectA.x + refRectA.w + SDLTest_RandomIntegerInRange(1, 10);
refRectB.y = refRectA.y + refRectA.h + SDLTest_RandomIntegerInRange(1, 10);
refRectB.w = refRectA.w;
refRectB.h = refRectA.h;
rectA = refRectA;
rectB = refRectB;
intersection = SDL_IntersectRect(&rectA, &rectB, &result);
_validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL);
return TEST_COMPLETED;
}
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
SDL_FALSE
Definition: SDL_stdinc.h:141
SDL_IntersectRect
#define SDL_IntersectRect
Definition: SDL_dynapi_overrides.h:294
_validateIntersectRectResults
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)
Definition: testautomation_rect.c:331
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
NULL
#define NULL
Definition: begin_code.h:164
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testIntersectRectParam()

int rect_testIntersectRectParam | ( | void * | arg | ) |

Definition at line 681 of file testautomation_rect.c.

References NULL, SDL_FALSE, SDL_IntersectRect, SDLTest_AssertCheck(), and TEST_COMPLETED.

{
SDL_Rect rectA;
SDL_Rect rectB;
SDL_Rect result;
SDL_bool intersection;
/* invalid parameter combinations */
intersection = SDL_IntersectRect((SDL_Rect *)NULL, &rectB, &result);
SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL");
intersection = SDL_IntersectRect(&rectA, (SDL_Rect *)NULL, &result);
SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 2st parameter is NULL");
intersection = SDL_IntersectRect(&rectA, &rectB, (SDL_Rect *)NULL);
SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 3st parameter is NULL");
intersection = SDL_IntersectRect((SDL_Rect *)NULL, (SDL_Rect *)NULL, &result);
SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st and 2nd parameters are NULL");
intersection = SDL_IntersectRect((SDL_Rect *)NULL, &rectB, (SDL_Rect *)NULL);
SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when 1st and 3rd parameters are NULL ");
intersection = SDL_IntersectRect((SDL_Rect *)NULL, (SDL_Rect *)NULL, (SDL_Rect *)NULL);
SDLTest_AssertCheck(intersection == SDL_FALSE, "Check that function returns SDL_FALSE when all parameters are NULL");
return TEST_COMPLETED;
}
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDL_FALSE
Definition: SDL_stdinc.h:141
SDL_IntersectRect
#define SDL_IntersectRect
Definition: SDL_dynapi_overrides.h:294
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
NULL
#define NULL
Definition: begin_code.h:164
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testIntersectRectPartial()

int rect_testIntersectRectPartial | ( | void * | arg | ) |

Definition at line 473 of file testautomation_rect.c.

References _validateIntersectRectResults(), SDL_Rect::h, SDL_IntersectRect, SDL_TRUE, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRectA = { 0, 0, 32, 32 };
SDL_Rect refRectB;
SDL_Rect rectA;
SDL_Rect rectB;
SDL_Rect result;
SDL_Rect expectedResult;
SDL_bool intersection;
/* rectB partially contained in rectA */
refRectB.x = SDLTest_RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1);
refRectB.y = SDLTest_RandomIntegerInRange(refRectA.y + 1, refRectA.y + refRectA.h - 1);
refRectB.w = refRectA.w;
refRectB.h = refRectA.h;
rectA = refRectA;
rectB = refRectB;
expectedResult.x = refRectB.x;
expectedResult.y = refRectB.y;
expectedResult.w = refRectA.w - refRectB.x;
expectedResult.h = refRectA.h - refRectB.y;
intersection = SDL_IntersectRect(&rectA, &rectB, &result);
_validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult);
/* rectB right edge */
refRectB.x = rectA.w - 1;
refRectB.y = rectA.y;
refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1);
refRectB.h = SDLTest_RandomIntegerInRange(1, refRectA.h - 1);
rectA = refRectA;
rectB = refRectB;
expectedResult.x = refRectB.x;
expectedResult.y = refRectB.y;
expectedResult.w = 1;
expectedResult.h = refRectB.h;
intersection = SDL_IntersectRect(&rectA, &rectB, &result);
_validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult);
/* rectB left edge */
refRectB.x = 1 - rectA.w;
refRectB.y = rectA.y;
refRectB.w = refRectA.w;
refRectB.h = SDLTest_RandomIntegerInRange(1, refRectA.h - 1);
rectA = refRectA;
rectB = refRectB;
expectedResult.x = 0;
expectedResult.y = refRectB.y;
expectedResult.w = 1;
expectedResult.h = refRectB.h;
intersection = SDL_IntersectRect(&rectA, &rectB, &result);
_validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult);
/* rectB bottom edge */
refRectB.x = rectA.x;
refRectB.y = rectA.h - 1;
refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1);
refRectB.h = SDLTest_RandomIntegerInRange(1, refRectA.h - 1);
rectA = refRectA;
rectB = refRectB;
expectedResult.x = refRectB.x;
expectedResult.y = refRectB.y;
expectedResult.w = refRectB.w;
expectedResult.h = 1;
intersection = SDL_IntersectRect(&rectA, &rectB, &result);
_validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult);
/* rectB top edge */
refRectB.x = rectA.x;
refRectB.y = 1 - rectA.h;
refRectB.w = SDLTest_RandomIntegerInRange(1, refRectA.w - 1);
refRectB.h = rectA.h;
rectA = refRectA;
rectB = refRectB;
expectedResult.x = refRectB.x;
expectedResult.y = 0;
expectedResult.w = refRectB.w;
expectedResult.h = 1;
intersection = SDL_IntersectRect(&rectA, &rectB, &result);
_validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult);
return TEST_COMPLETED;
}
SDL_TRUE
Definition: SDL_stdinc.h:142
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
SDL_IntersectRect
#define SDL_IntersectRect
Definition: SDL_dynapi_overrides.h:294
_validateIntersectRectResults
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)
Definition: testautomation_rect.c:331
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testIntersectRectPoint()

int rect_testIntersectRectPoint | ( | void * | arg | ) |

Definition at line 562 of file testautomation_rect.c.

References _validateIntersectRectResults(), NULL, SDL_FALSE, SDL_IntersectRect, SDL_TRUE, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRectA = { 0, 0, 1, 1 };
SDL_Rect refRectB = { 0, 0, 1, 1 };
SDL_Rect rectA;
SDL_Rect rectB;
SDL_Rect result;
SDL_bool intersection;
int offsetX, offsetY;
/* intersecting pixels */
refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
refRectB.x = refRectA.x;
refRectB.y = refRectA.y;
rectA = refRectA;
rectB = refRectB;
intersection = SDL_IntersectRect(&rectA, &rectB, &result);
_validateIntersectRectResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB, &result, &refRectA);
/* non-intersecting pixels cases */
for (offsetX = -1; offsetX <= 1; offsetX++) {
for (offsetY = -1; offsetY <= 1; offsetY++) {
if (offsetX != 0 || offsetY != 0) {
refRectA.x = SDLTest_RandomIntegerInRange(1, 100);
refRectA.y = SDLTest_RandomIntegerInRange(1, 100);
refRectB.x = refRectA.x;
refRectB.y = refRectA.y;
refRectB.x += offsetX;
refRectB.y += offsetY;
rectA = refRectA;
rectB = refRectB;
intersection = SDL_IntersectRect(&rectA, &rectB, &result);
_validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL);
}
}
}
return TEST_COMPLETED;
}
SDL_TRUE
Definition: SDL_stdinc.h:142
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
SDL_FALSE
Definition: SDL_stdinc.h:141
SDL_IntersectRect
#define SDL_IntersectRect
Definition: SDL_dynapi_overrides.h:294
_validateIntersectRectResults
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)
Definition: testautomation_rect.c:331
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
NULL
#define NULL
Definition: begin_code.h:164
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testRectEmpty()

int rect_testRectEmpty | ( | void * | arg | ) |

Definition at line 1460 of file testautomation_rect.c.

References _validateRectEmptyResults(), SDL_Rect::h, rect, SDL_FALSE, SDL_RectEmpty(), SDL_TRUE, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRect;
SDL_Rect rect;
SDL_bool expectedResult;
SDL_bool result;
int w, h;
/* Non-empty case */
refRect.x=SDLTest_RandomIntegerInRange(-1024, 1024);
refRect.y=SDLTest_RandomIntegerInRange(-1024, 1024);
refRect.w=SDLTest_RandomIntegerInRange(256, 1024);
refRect.h=SDLTest_RandomIntegerInRange(256, 1024);
expectedResult = SDL_FALSE;
rect = refRect;
result = (SDL_bool)SDL_RectEmpty((const SDL_Rect *)&rect);
_validateRectEmptyResults(result, expectedResult, &rect, &refRect);
/* Empty case */
for (w=-1; w<2; w++) {
for (h=-1; h<2; h++) {
if ((w != 1) || (h != 1)) {
refRect.x=SDLTest_RandomIntegerInRange(-1024, 1024);
refRect.y=SDLTest_RandomIntegerInRange(-1024, 1024);
refRect.w=w;
refRect.h=h;
expectedResult = SDL_TRUE;
rect = refRect;
result = (SDL_bool)SDL_RectEmpty((const SDL_Rect *)&rect);
_validateRectEmptyResults(result, expectedResult, &rect, &refRect);
}
}
}
return TEST_COMPLETED;
}
_validateRectEmptyResults
void _validateRectEmptyResults(SDL_bool empty, SDL_bool expectedEmpty, SDL_Rect *rect, SDL_Rect *refRect)
Definition: testautomation_rect.c:373
SDL_TRUE
Definition: SDL_stdinc.h:142
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
rect
SDL_Rect rect
Definition: testrelative.c:27
SDL_FALSE
Definition: SDL_stdinc.h:141
h
GLfloat GLfloat GLfloat GLfloat h
Definition: SDL_opengl_glext.h:1946
SDL_RectEmpty
SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
Returns true if the rectangle has no area.
Definition: SDL_rect.h:82
w
GLubyte GLubyte GLubyte GLubyte w
Definition: SDL_opengl_glext.h:731
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testRectEmptyParam()

int rect_testRectEmptyParam | ( | void * | arg | ) |

Definition at line 1503 of file testautomation_rect.c.

References NULL, SDL_RectEmpty(), SDL_TRUE, SDLTest_AssertCheck(), and TEST_COMPLETED.

{
SDL_bool result;
/* invalid parameter combinations */
result = (SDL_bool)SDL_RectEmpty((const SDL_Rect *)NULL);
SDLTest_AssertCheck(result == SDL_TRUE, "Check that function returns TRUE when 1st parameter is NULL");
return TEST_COMPLETED;
}
SDL_TRUE
Definition: SDL_stdinc.h:142
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDL_RectEmpty
SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
Returns true if the rectangle has no area.
Definition: SDL_rect.h:82
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
NULL
#define NULL
Definition: begin_code.h:164
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testRectEquals()

int rect_testRectEquals | ( | void * | arg | ) |

Definition at line 1520 of file testautomation_rect.c.

References _validateRectEqualsResults(), SDL_Rect::h, SDL_RectEquals(), SDL_TRUE, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRectA;
SDL_Rect refRectB;
SDL_Rect rectA;
SDL_Rect rectB;
SDL_bool expectedResult;
SDL_bool result;
/* Equals */
refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.w=SDLTest_RandomIntegerInRange(1, 1024);
refRectA.h=SDLTest_RandomIntegerInRange(1, 1024);
refRectB = refRectA;
expectedResult = SDL_TRUE;
rectA = refRectA;
rectB = refRectB;
result = (SDL_bool)SDL_RectEquals((const SDL_Rect *)&rectA, (const SDL_Rect *)&rectB);
_validateRectEqualsResults(result, expectedResult, &rectA, &rectB, &refRectA, &refRectB);
return TEST_COMPLETED;
}
SDL_TRUE
Definition: SDL_stdinc.h:142
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDL_RectEquals
SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b)
Returns true if the two rectangles are equal.
Definition: SDL_rect.h:90
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
_validateRectEqualsResults
void _validateRectEqualsResults(SDL_bool equals, SDL_bool expectedEquals, SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB)
Definition: testautomation_rect.c:391
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testRectEqualsParam()

int rect_testRectEqualsParam | ( | void * | arg | ) |

Definition at line 1550 of file testautomation_rect.c.

References SDL_Rect::h, NULL, SDL_FALSE, SDL_RectEquals(), SDLTest_AssertCheck(), SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect rectA;
SDL_Rect rectB;
SDL_bool result;
/* data setup */
rectA.x=SDLTest_RandomIntegerInRange(-1024, 1024);
rectA.y=SDLTest_RandomIntegerInRange(-1024, 1024);
rectA.w=SDLTest_RandomIntegerInRange(1, 1024);
rectA.h=SDLTest_RandomIntegerInRange(1, 1024);
rectB.x=SDLTest_RandomIntegerInRange(-1024, 1024);
rectB.y=SDLTest_RandomIntegerInRange(-1024, 1024);
rectB.w=SDLTest_RandomIntegerInRange(1, 1024);
rectB.h=SDLTest_RandomIntegerInRange(1, 1024);
/* invalid parameter combinations */
result = (SDL_bool)SDL_RectEquals((const SDL_Rect *)NULL, (const SDL_Rect *)&rectB);
SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL");
result = (SDL_bool)SDL_RectEquals((const SDL_Rect *)&rectA, (const SDL_Rect *)NULL);
SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 2nd parameter is NULL");
result = (SDL_bool)SDL_RectEquals((const SDL_Rect *)NULL, (const SDL_Rect *)NULL);
SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 1st and 2nd parameter are NULL");
return TEST_COMPLETED;
}
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDL_RectEquals
SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b)
Returns true if the two rectangles are equal.
Definition: SDL_rect.h:90
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
SDL_FALSE
Definition: SDL_stdinc.h:141
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
NULL
#define NULL
Definition: begin_code.h:164
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## rect_testUnionRectEmpty()

int rect_testUnionRectEmpty | ( | void * | arg | ) |

Definition at line 1303 of file testautomation_rect.c.

References _validateUnionRectResults(), SDL_Rect::h, SDL_UnionRect, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRectA, refRectB;
SDL_Rect rectA, rectB;
SDL_Rect expectedResult;
SDL_Rect result;
/* A empty */
refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.w=0;
refRectA.h=0;
refRectB.x=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectB.y=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectB.w=SDLTest_RandomIntegerInRange(1, 1024);
refRectB.h=SDLTest_RandomIntegerInRange(1, 1024);
expectedResult = refRectB;
rectA = refRectA;
rectB = refRectB;
SDL_UnionRect(&rectA, &rectB, &result);
_validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult);
/* B empty */
refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.w=SDLTest_RandomIntegerInRange(1, 1024);
refRectA.h=SDLTest_RandomIntegerInRange(1, 1024);
refRectB.x=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectB.y=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectB.w=0;
refRectB.h=0;
expectedResult = refRectA;
rectA = refRectA;
rectB = refRectB;
SDL_UnionRect(&rectA, &rectB, &result);
_validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult);
/* A and B empty */
refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.w=0;
refRectA.h=0;
refRectB.x=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectB.y=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectB.w=0;
refRectB.h=0;
result.x=0;
result.y=0;
result.w=0;
result.h=0;
expectedResult = result;
rectA = refRectA;
rectB = refRectB;
SDL_UnionRect(&rectA, &rectB, &result);
_validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult);
return TEST_COMPLETED;
}
SDL_UnionRect
#define SDL_UnionRect
Definition: SDL_dynapi_overrides.h:295
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64
_validateUnionRectResults
void _validateUnionRectResults(SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB, SDL_Rect *result, SDL_Rect *expectedResult)
Definition: testautomation_rect.c:350

## rect_testUnionRectInside()

int rect_testUnionRectInside | ( | void * | arg | ) |

Definition at line 1368 of file testautomation_rect.c.

References _validateUnionRectResults(), SDL_Rect::h, SDL_UnionRect, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRectA, refRectB;
SDL_Rect rectA, rectB;
SDL_Rect expectedResult;
SDL_Rect result;
int dx, dy;
/* Union 1x1 with itself */
refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.w=1;
refRectA.h=1;
expectedResult = refRectA;
rectA = refRectA;
SDL_UnionRect(&rectA, &rectA, &result);
_validateUnionRectResults(&rectA, &rectA, &refRectA, &refRectA, &result, &expectedResult);
/* Union 1x1 somewhere inside */
refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.w=SDLTest_RandomIntegerInRange(256, 1024);
refRectA.h=SDLTest_RandomIntegerInRange(256, 1024);
refRectB.x=refRectA.x + 1 + SDLTest_RandomIntegerInRange(1, refRectA.w - 2);
refRectB.y=refRectA.y + 1 + SDLTest_RandomIntegerInRange(1, refRectA.h - 2);
refRectB.w=1;
refRectB.h=1;
expectedResult = refRectA;
rectA = refRectA;
rectB = refRectB;
SDL_UnionRect(&rectA, &rectB, &result);
_validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult);
/* Union inside with edges modified */
for (dx = -1; dx < 2; dx++) {
for (dy = -1; dy < 2; dy++) {
if ((dx != 0) || (dy != 0)) {
refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.w=SDLTest_RandomIntegerInRange(256, 1024);
refRectA.h=SDLTest_RandomIntegerInRange(256, 1024);
refRectB = refRectA;
if (dx == -1) refRectB.x++;
if ((dx == 1) || (dx == -1)) refRectB.w--;
if (dy == -1) refRectB.y++;
if ((dy == 1) || (dy == -1)) refRectB.h--;
expectedResult = refRectA;
rectA = refRectA;
rectB = refRectB;
SDL_UnionRect(&rectA, &rectB, &result);
_validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult);
}
}
}
return TEST_COMPLETED;
}
SDL_UnionRect
#define SDL_UnionRect
Definition: SDL_dynapi_overrides.h:295
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64
_validateUnionRectResults
void _validateUnionRectResults(SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB, SDL_Rect *result, SDL_Rect *expectedResult)
Definition: testautomation_rect.c:350

## rect_testUnionRectOutside()

int rect_testUnionRectOutside | ( | void * | arg | ) |

Definition at line 1232 of file testautomation_rect.c.

References _validateUnionRectResults(), SDL_Rect::h, SDL_UnionRect, SDLTest_RandomIntegerInRange(), TEST_COMPLETED, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
SDL_Rect refRectA, refRectB;
SDL_Rect rectA, rectB;
SDL_Rect expectedResult;
SDL_Rect result;
int minx, maxx, miny, maxy;
int dx, dy;
/* Union 1x1 outside */
for (dx = -1; dx < 2; dx++) {
for (dy = -1; dy < 2; dy++) {
if ((dx != 0) || (dy != 0)) {
refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.w=1;
refRectA.h=1;
refRectB.x=SDLTest_RandomIntegerInRange(-1024, 1024) + dx*2048;
refRectB.y=SDLTest_RandomIntegerInRange(-1024, 1024) + dx*2048;
refRectB.w=1;
refRectB.h=1;
minx = (refRectA.x<refRectB.x) ? refRectA.x : refRectB.x;
maxx = (refRectA.x>refRectB.x) ? refRectA.x : refRectB.x;
miny = (refRectA.y<refRectB.y) ? refRectA.y : refRectB.y;
maxy = (refRectA.y>refRectB.y) ? refRectA.y : refRectB.y;
expectedResult.x = minx;
expectedResult.y = miny;
expectedResult.w = maxx - minx + 1;
expectedResult.h = maxy - miny + 1;
rectA = refRectA;
rectB = refRectB;
SDL_UnionRect(&rectA, &rectB, &result);
_validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult);
}
}
}
/* Union outside overlap */
for (dx = -1; dx < 2; dx++) {
for (dy = -1; dy < 2; dy++) {
if ((dx != 0) || (dy != 0)) {
refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024);
refRectA.w=SDLTest_RandomIntegerInRange(256, 512);
refRectA.h=SDLTest_RandomIntegerInRange(256, 512);
refRectB.x=refRectA.x + 1 + dx*2;
refRectB.y=refRectA.y + 1 + dy*2;
refRectB.w=refRectA.w - 2;
refRectB.h=refRectA.h - 2;
expectedResult = refRectA;
if (dx == -1) expectedResult.x--;
if (dy == -1) expectedResult.y--;
if ((dx == 1) || (dx == -1)) expectedResult.w++;
if ((dy == 1) || (dy == -1)) expectedResult.h++;
rectA = refRectA;
rectB = refRectB;
SDL_UnionRect(&rectA, &rectB, &result);
_validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult);
}
}
}
return TEST_COMPLETED;
}
SDL_UnionRect
#define SDL_UnionRect
Definition: SDL_dynapi_overrides.h:295
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163
SDL_Rect::x
int x
Definition: SDL_rect.h:66
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_Rect::w
int w
Definition: SDL_rect.h:67
SDL_Rect::h
int h
Definition: SDL_rect.h:67
SDL_Rect::y
int y
Definition: SDL_rect.h:66
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64
_validateUnionRectResults
void _validateUnionRectResults(SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB, SDL_Rect *result, SDL_Rect *expectedResult)
Definition: testautomation_rect.c:350

## rect_testUnionRectParam()

int rect_testUnionRectParam | ( | void * | arg | ) |

Definition at line 1432 of file testautomation_rect.c.

References NULL, SDL_UnionRect, SDLTest_AssertPass(), and TEST_COMPLETED.

{
SDL_Rect rectA, rectB;
SDL_Rect result;
/* invalid parameter combinations */
SDL_UnionRect((SDL_Rect *)NULL, &rectB, &result);
SDLTest_AssertPass("Check that function returns when 1st parameter is NULL");
SDL_UnionRect(&rectA, (SDL_Rect *)NULL, &result);
SDLTest_AssertPass("Check that function returns when 2nd parameter is NULL");
SDL_UnionRect(&rectA, &rectB, (SDL_Rect *)NULL);
SDLTest_AssertPass("Check that function returns when 3rd parameter is NULL");
SDL_UnionRect((SDL_Rect *)NULL, &rectB, (SDL_Rect *)NULL);
SDLTest_AssertPass("Check that function returns when 1st and 3rd parameter are NULL");
SDL_UnionRect(&rectA, (SDL_Rect *)NULL, (SDL_Rect *)NULL);
SDLTest_AssertPass("Check that function returns when 2nd and 3rd parameter are NULL");
SDL_UnionRect((SDL_Rect *)NULL, (SDL_Rect *)NULL, (SDL_Rect *)NULL);
SDLTest_AssertPass("Check that function returns when all parameters are NULL");
return TEST_COMPLETED;
}
SDL_UnionRect
#define SDL_UnionRect
Definition: SDL_dynapi_overrides.h:295
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDLTest_AssertPass
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.
Definition: SDL_test_assert.c:94
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
NULL
#define NULL
Definition: begin_code.h:164
SDL_Rect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64

## Variable Documentation

## rectTest1

const SDLTest_TestCaseReference rectTest1

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testIntersectRectAndLine,"rect_testIntersectRectAndLine", "Tests SDL_IntersectRectAndLine clipping cases", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47
rect_testIntersectRectAndLine
int rect_testIntersectRectAndLine(void *arg)
Definition: testautomation_rect.c:49

Definition at line 1582 of file testautomation_rect.c.

## rectTest10

const SDLTest_TestCaseReference rectTest10

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testIntersectRectEmpty, "rect_testIntersectRectEmpty", "Tests SDL_IntersectRect with empty rectangles", TEST_ENABLED }
rect_testIntersectRectEmpty
int rect_testIntersectRectEmpty(void *arg)
Definition: testautomation_rect.c:609
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1610 of file testautomation_rect.c.

## rectTest11

const SDLTest_TestCaseReference rectTest11

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testIntersectRectParam, "rect_testIntersectRectParam", "Negative tests against SDL_IntersectRect with invalid parameters", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
rect_testIntersectRectParam
int rect_testIntersectRectParam(void *arg)
Definition: testautomation_rect.c:681
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1613 of file testautomation_rect.c.

## rectTest12

const SDLTest_TestCaseReference rectTest12

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testHasIntersectionInside, "rect_testHasIntersectionInside", "Tests SDL_HasIntersection with B fully contained in A", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47
rect_testHasIntersectionInside
int rect_testHasIntersectionInside(void *arg)
Definition: testautomation_rect.c:711

Definition at line 1617 of file testautomation_rect.c.

## rectTest13

const SDLTest_TestCaseReference rectTest13

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testHasIntersectionOutside, "rect_testHasIntersectionOutside", "Tests SDL_HasIntersection with B fully outside of A", TEST_ENABLED }
rect_testHasIntersectionOutside
int rect_testHasIntersectionOutside(void *arg)
Definition: testautomation_rect.c:738
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1620 of file testautomation_rect.c.

## rectTest14

const SDLTest_TestCaseReference rectTest14

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testHasIntersectionPartial,"rect_testHasIntersectionPartial", "Tests SDL_HasIntersection with B partially intersecting A", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
rect_testHasIntersectionPartial
int rect_testHasIntersectionPartial(void *arg)
Definition: testautomation_rect.c:765
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1623 of file testautomation_rect.c.

## rectTest15

const SDLTest_TestCaseReference rectTest15

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testHasIntersectionPoint, "rect_testHasIntersectionPoint", "Tests SDL_HasIntersection with 1x1 sized rectangles", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47
rect_testHasIntersectionPoint
int rect_testHasIntersectionPoint(void *arg)
Definition: testautomation_rect.c:832

Definition at line 1626 of file testautomation_rect.c.

## rectTest16

const SDLTest_TestCaseReference rectTest16

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testHasIntersectionEmpty, "rect_testHasIntersectionEmpty", "Tests SDL_HasIntersection with empty rectangles", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
rect_testHasIntersectionEmpty
int rect_testHasIntersectionEmpty(void *arg)
Definition: testautomation_rect.c:878
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1629 of file testautomation_rect.c.

## rectTest17

const SDLTest_TestCaseReference rectTest17

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testHasIntersectionParam, "rect_testHasIntersectionParam", "Negative tests against SDL_HasIntersection with invalid parameters", TEST_ENABLED }
rect_testHasIntersectionParam
int rect_testHasIntersectionParam(void *arg)
Definition: testautomation_rect.c:936
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1632 of file testautomation_rect.c.

## rectTest18

const SDLTest_TestCaseReference rectTest18

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testEnclosePoints, "rect_testEnclosePoints", "Tests SDL_EnclosePoints without clipping", TEST_ENABLED }
rect_testEnclosePoints
int rect_testEnclosePoints(void *arg)
Definition: testautomation_rect.c:959
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1636 of file testautomation_rect.c.

## rectTest19

const SDLTest_TestCaseReference rectTest19

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testEnclosePointsWithClipping, "rect_testEnclosePointsWithClipping", "Tests SDL_EnclosePoints with clipping", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47
rect_testEnclosePointsWithClipping
int rect_testEnclosePointsWithClipping(void *arg)
Definition: testautomation_rect.c:1105

Definition at line 1639 of file testautomation_rect.c.

## rectTest2

const SDLTest_TestCaseReference rectTest2

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testIntersectRectAndLineInside, "rect_testIntersectRectAndLineInside", "Tests SDL_IntersectRectAndLine with line fully contained in rect", TEST_ENABLED }
rect_testIntersectRectAndLineInside
int rect_testIntersectRectAndLineInside(void *arg)
Definition: testautomation_rect.c:120
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1585 of file testautomation_rect.c.

## rectTest20

const SDLTest_TestCaseReference rectTest20

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testEnclosePointsRepeatedInput, "rect_testEnclosePointsRepeatedInput", "Tests SDL_EnclosePoints with repeated input", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47
rect_testEnclosePointsRepeatedInput
int rect_testEnclosePointsRepeatedInput(void *arg)
Definition: testautomation_rect.c:1029

Definition at line 1642 of file testautomation_rect.c.

## rectTest21

const SDLTest_TestCaseReference rectTest21

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testEnclosePointsParam, "rect_testEnclosePointsParam", "Negative tests against SDL_EnclosePoints with invalid parameters", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47
rect_testEnclosePointsParam
int rect_testEnclosePointsParam(void *arg)
Definition: testautomation_rect.c:1204

Definition at line 1645 of file testautomation_rect.c.

## rectTest22

const SDLTest_TestCaseReference rectTest22

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testUnionRectInside, "rect_testUnionRectInside", "Tests SDL_UnionRect where rect B is inside rect A", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
rect_testUnionRectInside
int rect_testUnionRectInside(void *arg)
Definition: testautomation_rect.c:1368
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1649 of file testautomation_rect.c.

## rectTest23

const SDLTest_TestCaseReference rectTest23

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testUnionRectOutside, "rect_testUnionRectOutside", "Tests SDL_UnionRect where rect B is outside rect A", TEST_ENABLED }
rect_testUnionRectOutside
int rect_testUnionRectOutside(void *arg)
Definition: testautomation_rect.c:1232
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1652 of file testautomation_rect.c.

## rectTest24

const SDLTest_TestCaseReference rectTest24

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testUnionRectEmpty, "rect_testUnionRectEmpty", "Tests SDL_UnionRect where rect A or rect B are empty", TEST_ENABLED }
rect_testUnionRectEmpty
int rect_testUnionRectEmpty(void *arg)
Definition: testautomation_rect.c:1303
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1655 of file testautomation_rect.c.

## rectTest25

const SDLTest_TestCaseReference rectTest25

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testUnionRectParam, "rect_testUnionRectParam", "Negative tests against SDL_UnionRect with invalid parameters", TEST_ENABLED }
rect_testUnionRectParam
int rect_testUnionRectParam(void *arg)
Definition: testautomation_rect.c:1432
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1658 of file testautomation_rect.c.

## rectTest26

const SDLTest_TestCaseReference rectTest26

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testRectEmpty, "rect_testRectEmpty", "Tests SDL_RectEmpty with various inputs", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47
rect_testRectEmpty
int rect_testRectEmpty(void *arg)
Definition: testautomation_rect.c:1460

Definition at line 1662 of file testautomation_rect.c.

## rectTest27

const SDLTest_TestCaseReference rectTest27

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testRectEmptyParam, "rect_testRectEmptyParam", "Negative tests against SDL_RectEmpty with invalid parameters", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47
rect_testRectEmptyParam
int rect_testRectEmptyParam(void *arg)
Definition: testautomation_rect.c:1503

Definition at line 1665 of file testautomation_rect.c.

## rectTest28

const SDLTest_TestCaseReference rectTest28

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testRectEquals, "rect_testRectEquals", "Tests SDL_RectEquals with various inputs", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
rect_testRectEquals
int rect_testRectEquals(void *arg)
Definition: testautomation_rect.c:1520
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1670 of file testautomation_rect.c.

## rectTest29

const SDLTest_TestCaseReference rectTest29

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testRectEqualsParam, "rect_testRectEqualsParam", "Negative tests against SDL_RectEquals with invalid parameters", TEST_ENABLED }
rect_testRectEqualsParam
int rect_testRectEqualsParam(void *arg)
Definition: testautomation_rect.c:1550
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1673 of file testautomation_rect.c.

## rectTest3

const SDLTest_TestCaseReference rectTest3

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testIntersectRectAndLineOutside, "rect_testIntersectRectAndLineOutside", "Tests SDL_IntersectRectAndLine with line fully outside of rect", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
rect_testIntersectRectAndLineOutside
int rect_testIntersectRectAndLineOutside(void *arg)
Definition: testautomation_rect.c:187
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1588 of file testautomation_rect.c.

## rectTest4

const SDLTest_TestCaseReference rectTest4

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testIntersectRectAndLineEmpty, "rect_testIntersectRectAndLineEmpty", "Tests SDL_IntersectRectAndLine with empty rectangle ", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47
rect_testIntersectRectAndLineEmpty
int rect_testIntersectRectAndLineEmpty(void *arg)
Definition: testautomation_rect.c:242

Definition at line 1591 of file testautomation_rect.c.

## rectTest5

const SDLTest_TestCaseReference rectTest5

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testIntersectRectAndLineParam, "rect_testIntersectRectAndLineParam", "Negative tests against SDL_IntersectRectAndLine with invalid parameters", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
rect_testIntersectRectAndLineParam
int rect_testIntersectRectAndLineParam(void *arg)
Definition: testautomation_rect.c:277
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1594 of file testautomation_rect.c.

## rectTest6

const SDLTest_TestCaseReference rectTest6

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testIntersectRectInside, "rect_testIntersectRectInside", "Tests SDL_IntersectRect with B fully contained in A", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
rect_testIntersectRectInside
int rect_testIntersectRectInside(void *arg)
Definition: testautomation_rect.c:417
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1598 of file testautomation_rect.c.

## rectTest7

const SDLTest_TestCaseReference rectTest7

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testIntersectRectOutside, "rect_testIntersectRectOutside", "Tests SDL_IntersectRect with B fully outside of A", TEST_ENABLED }
rect_testIntersectRectOutside
int rect_testIntersectRectOutside(void *arg)
Definition: testautomation_rect.c:445
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1601 of file testautomation_rect.c.

## rectTest8

const SDLTest_TestCaseReference rectTest8

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testIntersectRectPartial, "rect_testIntersectRectPartial", "Tests SDL_IntersectRect with B partially intersecting A", TEST_ENABLED }
rect_testIntersectRectPartial
int rect_testIntersectRectPartial(void *arg)
Definition: testautomation_rect.c:473
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47

Definition at line 1604 of file testautomation_rect.c.

## rectTest9

const SDLTest_TestCaseReference rectTest9

static

Initial value:
=
{ (SDLTest_TestCaseFp)rect_testIntersectRectPoint, "rect_testIntersectRectPoint", "Tests SDL_IntersectRect with 1x1 sized rectangles", TEST_ENABLED }
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47
rect_testIntersectRectPoint
int rect_testIntersectRectPoint(void *arg)
Definition: testautomation_rect.c:562

Definition at line 1607 of file testautomation_rect.c.

## rectTests

const SDLTest_TestCaseReference* rectTests[]

static

Initial value:
= {
&rectTest1, &rectTest2, &rectTest3, &rectTest4, &rectTest5, &rectTest6, &rectTest7, &rectTest8, &rectTest9, &rectTest10, &rectTest11, &rectTest12, &rectTest13, &rectTest14,
&rectTest15, &rectTest16, &rectTest17, &rectTest18, &rectTest19, &rectTest20, &rectTest21, &rectTest22, &rectTest23, &rectTest24, &rectTest25, &rectTest26, &rectTest27,
&rectTest28, &rectTest29, NULL
}
rectTest21
static const SDLTest_TestCaseReference rectTest21
Definition: testautomation_rect.c:1645
rectTest8
static const SDLTest_TestCaseReference rectTest8
Definition: testautomation_rect.c:1604
rectTest20
static const SDLTest_TestCaseReference rectTest20
Definition: testautomation_rect.c:1642
rectTest13
static const SDLTest_TestCaseReference rectTest13
Definition: testautomation_rect.c:1620
rectTest6
static const SDLTest_TestCaseReference rectTest6
Definition: testautomation_rect.c:1598
rectTest19
static const SDLTest_TestCaseReference rectTest19
Definition: testautomation_rect.c:1639
rectTest29
static const SDLTest_TestCaseReference rectTest29
Definition: testautomation_rect.c:1673
rectTest17
static const SDLTest_TestCaseReference rectTest17
Definition: testautomation_rect.c:1632
rectTest4
static const SDLTest_TestCaseReference rectTest4
Definition: testautomation_rect.c:1591
rectTest22
static const SDLTest_TestCaseReference rectTest22
Definition: testautomation_rect.c:1649
rectTest27
static const SDLTest_TestCaseReference rectTest27
Definition: testautomation_rect.c:1665
rectTest15
static const SDLTest_TestCaseReference rectTest15
Definition: testautomation_rect.c:1626
rectTest14
static const SDLTest_TestCaseReference rectTest14
Definition: testautomation_rect.c:1623
rectTest9
static const SDLTest_TestCaseReference rectTest9
Definition: testautomation_rect.c:1607
rectTest11
static const SDLTest_TestCaseReference rectTest11
Definition: testautomation_rect.c:1613
rectTest7
static const SDLTest_TestCaseReference rectTest7
Definition: testautomation_rect.c:1601
rectTest25
static const SDLTest_TestCaseReference rectTest25
Definition: testautomation_rect.c:1658
rectTest18
static const SDLTest_TestCaseReference rectTest18
Definition: testautomation_rect.c:1636
rectTest28
static const SDLTest_TestCaseReference rectTest28
Definition: testautomation_rect.c:1670
rectTest26
static const SDLTest_TestCaseReference rectTest26
Definition: testautomation_rect.c:1662
rectTest24
static const SDLTest_TestCaseReference rectTest24
Definition: testautomation_rect.c:1655
rectTest5
static const SDLTest_TestCaseReference rectTest5
Definition: testautomation_rect.c:1594
rectTest10
static const SDLTest_TestCaseReference rectTest10
Definition: testautomation_rect.c:1610
rectTest3
static const SDLTest_TestCaseReference rectTest3
Definition: testautomation_rect.c:1588
NULL
#define NULL
Definition: begin_code.h:164
rectTest23
static const SDLTest_TestCaseReference rectTest23
Definition: testautomation_rect.c:1652
rectTest1
static const SDLTest_TestCaseReference rectTest1
Definition: testautomation_rect.c:1582
rectTest16
static const SDLTest_TestCaseReference rectTest16
Definition: testautomation_rect.c:1629
rectTest2
static const SDLTest_TestCaseReference rectTest2
Definition: testautomation_rect.c:1585
rectTest12
static const SDLTest_TestCaseReference rectTest12
Definition: testautomation_rect.c:1617

Definition at line 1683 of file testautomation_rect.c.

## rectTestSuite

SDLTest_TestSuiteReference rectTestSuite

Initial value:
= {
"Rect",
NULL,
rectTests,
NULL
}
rectTests
static const SDLTest_TestCaseReference * rectTests[]
Definition: testautomation_rect.c:1683
NULL
#define NULL
Definition: begin_code.h:164

Definition at line 1691 of file testautomation_rect.c.