mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-04 03:15:59 -04:00
Add test for Point/Rect construction and comparison from/with corresponding SDL objects
This commit is contained in:
parent
f4823de989
commit
e18f54d302
@ -163,4 +163,23 @@ BEGIN_TEST()
|
|||||||
|
|
||||||
EXPECT_TRUE(r == Rect(-9, -18, 3, 4));
|
EXPECT_TRUE(r == Rect(-9, -18, 3, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// Construction from and comparison with SDL objects
|
||||||
|
SDL_Rect sdlrect = { 1, 2, 3, 4 };
|
||||||
|
|
||||||
|
SDL_Point sdlpoint = { 6, 7 };
|
||||||
|
|
||||||
|
EXPECT_TRUE(Rect(sdlrect) == Rect(1, 2, 3, 4));
|
||||||
|
EXPECT_TRUE(Point(sdlpoint) == Point(6, 7));
|
||||||
|
|
||||||
|
EXPECT_TRUE(Rect(sdlrect) != Rect(0, 2, 3, 4));
|
||||||
|
EXPECT_TRUE(Point(sdlpoint) != Point(0, 7));
|
||||||
|
|
||||||
|
EXPECT_TRUE(Rect(1, 2, 3, 4) == sdlrect);
|
||||||
|
EXPECT_TRUE(Point(6, 7) == sdlpoint);
|
||||||
|
|
||||||
|
EXPECT_TRUE(Rect(0, 2, 3, 4) != sdlrect);
|
||||||
|
EXPECT_TRUE(Point(0, 7) != sdlpoint);
|
||||||
|
}
|
||||||
END_TEST()
|
END_TEST()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user