MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / TEST

Function TEST

source/test/rect_test.cpp:7–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5using namespace Star;
6
7TEST(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
25TEST(RectTest, BoxGlanceCorner) {
26 RectF rect1 = {0, 0, 10, 10};

Callers

nothing calls this directly

Calls 10

vmagFunction · 0.85
translateToIncludeMethod · 0.80
xMaxMethod · 0.80
yMaxMethod · 0.80
xMinMethod · 0.80
yMinMethod · 0.80
edgeIntersectionMethod · 0.80
intersectionMethod · 0.45
containsMethod · 0.45
setCenterMethod · 0.45

Tested by

no test coverage detected