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

Function rect_testHasIntersectionInside

deps/SDL2/test/testautomation_rect.c:711–730  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

709 * http://wiki.libsdl.org/moin.cgi/SDL_HasIntersection
710 */
711int rect_testHasIntersectionInside (void *arg)
712{
713 SDL_Rect refRectA = { 0, 0, 32, 32 };
714 SDL_Rect refRectB;
715 SDL_Rect rectA;
716 SDL_Rect rectB;
717 SDL_bool intersection;
718
719 /* rectB fully contained in rectA */
720 refRectB.x = 0;
721 refRectB.y = 0;
722 refRectB.w = SDLTest_RandomIntegerInRange(refRectA.x + 1, refRectA.x + refRectA.w - 1);
723 refRectB.h = SDLTest_RandomIntegerInRange(refRectA.y + 1, refRectA.y + refRectA.h - 1);
724 rectA = refRectA;
725 rectB = refRectB;
726 intersection = SDL_HasIntersection(&rectA, &rectB);
727 _validateHasIntersectionResults(intersection, SDL_TRUE, &rectA, &rectB, &refRectA, &refRectB);
728
729 return TEST_COMPLETED;
730}
731
732/* !
733 * \brief Tests SDL_HasIntersection() with B fully outside A

Callers

nothing calls this directly

Calls 3

SDL_HasIntersectionFunction · 0.85

Tested by

no test coverage detected