| 5 | using namespace Star; |
| 6 | |
| 7 | TEST(RectTest, TranslateToInclude) { |
| 8 | RectF rect; |
| 9 | rect = {0, 0, 10, 10}; |
| 10 | rect.translateToInclude(20, 20, 2, 2); |
| 11 | EXPECT_TRUE(rect.xMax() < 22.01 && rect.xMax() > 21.99); |
| 12 | EXPECT_TRUE(rect.yMax() < 22.01 && rect.yMax() > 21.99); |
| 13 | |
| 14 | rect = {0, 0, 10, 10}; |
| 15 | rect.translateToInclude(-20, -20, 2, 2); |
| 16 | EXPECT_TRUE(rect.xMin() > -22.01 && rect.xMin() < -21.99); |
| 17 | EXPECT_TRUE(rect.yMin() > -22.01 && rect.yMin() < -21.99); |
| 18 | |
| 19 | rect = {0, 0, 10, 10}; |
| 20 | rect.translateToInclude(5, 5, 3, 3); |
| 21 | EXPECT_TRUE(rect.xMin() < 0.01 && rect.xMin() > -0.01); |
| 22 | EXPECT_TRUE(rect.yMin() < 0.01 && rect.yMin() > -0.01); |
| 23 | } |
| 24 | |
| 25 | TEST(RectTest, BoxGlanceCorner) { |
| 26 | RectF rect1 = {0, 0, 10, 10}; |
nothing calls this directly
no test coverage detected