Skip to content

Commit 0004068

Browse files
committed
Missing tests
1 parent 683126c commit 0004068

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/yup_graphics/yup_Rectangle.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,13 @@ TEST (RectangleTests, Contains)
497497
// Test contains with point
498498
EXPECT_TRUE (r.contains (Point<float> (2.0f, 3.0f)));
499499
EXPECT_FALSE (r.contains (Point<float> (0.0f, 0.0f)));
500+
501+
// Test contains with rect
502+
EXPECT_TRUE (r.contains (r));
503+
EXPECT_TRUE (r.contains (r.reduced (0.5f)));
504+
EXPECT_FALSE (r.contains (Rectangle<float> (2.0f, 2.0f, 3.0f, 4.0f)));
505+
EXPECT_FALSE (r.contains (r.enlarged (0.5f)));
506+
EXPECT_FALSE (r.contains (Rectangle<float> (10.0f, 20.0f, 30.0f, 40.0f)));
500507
}
501508

502509
TEST (RectangleTests, Area)

0 commit comments

Comments
 (0)