Skip to content

Commit

Permalink
Adding test for vrRealRect
Browse files Browse the repository at this point in the history
  • Loading branch information
lucsch committed Jul 7, 2024
1 parent 41b8f22 commit 5dc5db6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/src/test_vrrealrect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ TEST_F(VrRealRectTest, Intersect) {

TEST_F(VrRealRectTest, IntersectNeg) {
vrRealRect rect1(-10.0, -10.0, 10.0, 10.0);
vrRealRect rect2(-5.0, -5.0, 5.0, 5.0);
vrRealRect rect2(-5.0, -5.0, 10.0, 10.0);

vrRealRect result = rect1.Intersect(rect2);

Expand All @@ -67,3 +67,16 @@ TEST_F(VrRealRectTest, IntersectNeg) {
EXPECT_EQ(result.m_width, 5.0);
EXPECT_EQ(result.m_height, 5.0);
}

TEST_F(VrRealRectTest, IntersectNeg2) {
vrRealRect rect1(0, 0, 10.0, 10.0);
vrRealRect rect2(5, -5, 10.0, 10.0);

vrRealRect result = rect1.Intersect(rect2);

EXPECT_TRUE(result.IsOk());
EXPECT_EQ(result.GetLeft(), 5.0);
EXPECT_EQ(result.GetTop(), 0.0);
EXPECT_EQ(result.m_width, 5.0);
EXPECT_EQ(result.m_height, 5.0);
}

0 comments on commit 5dc5db6

Please sign in to comment.