MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / rect_testHasIntersectionOutside

Function rect_testHasIntersectionOutside

deps/SDL2/test/testautomation_rect.c:738–757  ·  view source on GitHub ↗

! * \brief Tests SDL_HasIntersection() with B fully outside A * * \sa * http://wiki.libsdl.org/moin.cgi/SDL_HasIntersection */

Source from the content-addressed store, hash-verified

736 * http://wiki.libsdl.org/moin.cgi/SDL_HasIntersection
737 */
738int rect_testHasIntersectionOutside (void *arg)
739{
740 SDL_Rect refRectA = { 0, 0, 32, 32 };
741 SDL_Rect refRectB;
742 SDL_Rect rectA;
743 SDL_Rect rectB;
744 SDL_bool intersection;
745
746 /* rectB fully outside of rectA */
747 refRectB.x = refRectA.x + refRectA.w + SDLTest_RandomIntegerInRange(1, 10);
748 refRectB.y = refRectA.y + refRectA.h + SDLTest_RandomIntegerInRange(1, 10);
749 refRectB.w = refRectA.w;
750 refRectB.h = refRectA.h;
751 rectA = refRectA;
752 rectB = refRectB;
753 intersection = SDL_HasIntersection(&rectA, &rectB);
754 _validateHasIntersectionResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB);
755
756 return TEST_COMPLETED;
757}
758
759/* !
760 * \brief Tests SDL_HasIntersection() with B partially intersecting A

Callers

nothing calls this directly

Calls 3

SDL_HasIntersectionFunction · 0.85

Tested by

no test coverage detected