mirror of
https://github.com/yawut/SDL.git
synced 2026-09-06 16:16:21 -05:00
WinRT: merged with latest, official, SDL 2.x sources
This commit is contained in:
@@ -614,8 +614,11 @@ int rect_testIntersectRectEmpty (void *arg)
|
||||
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);
|
||||
@@ -627,8 +630,12 @@ int rect_testIntersectRectEmpty (void *arg)
|
||||
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);
|
||||
@@ -640,8 +647,12 @@ int rect_testIntersectRectEmpty (void *arg)
|
||||
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);
|
||||
@@ -655,8 +666,10 @@ int rect_testIntersectRectEmpty (void *arg)
|
||||
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;
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Visual Studio 2008 doesn't have stdint.h */
|
||||
#if defined(_MSC_VER) && _MSC_VER <= 1500
|
||||
@@ -1522,7 +1523,7 @@ video_getSetWindowData(void *arg)
|
||||
returnValue = TEST_ABORTED;
|
||||
goto cleanup;
|
||||
}
|
||||
userdata = (char *)strdup(referenceUserdata);
|
||||
userdata = SDL_strdup(referenceUserdata);
|
||||
if (userdata == NULL) {
|
||||
returnValue = TEST_ABORTED;
|
||||
goto cleanup;
|
||||
|
||||
Reference in New Issue
Block a user