diff --git a/test/src/test_vrrealrect.cpp b/test/src/test_vrrealrect.cpp index 7d3ac664..2c48bae6 100644 --- a/test/src/test_vrrealrect.cpp +++ b/test/src/test_vrrealrect.cpp @@ -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); @@ -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); +} \ No newline at end of file