Esempio n. 1
0
TEST(FloatBoxTest, EmptyBoxTest)
{
    FloatBox box;
    EXPECT_TRUE(box.isEmpty());
    box.expandTo(FloatPoint3D(1, 0, 0));
    EXPECT_TRUE(box.isEmpty());
    box.expandTo(FloatPoint3D(0, 1, 0));
    EXPECT_FALSE(box.isEmpty());
}
Esempio n. 2
0
TEST(FloatBoxTest, UnionTest)
{
    FloatBox box;
    EXPECT_TRUE(box.isEmpty());
    FloatBox unionedBox(3, 5, 6, 5, 3, 9);
    box.unionBounds(unionedBox);
    EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, unionedBox, box);

    box.unionBounds(FloatBox());
    EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, unionedBox, box);

    box.unionBounds(FloatBox(0, 0, 0, 1, 1, 1));
    EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, FloatBox(0, 0, 0, 8, 8, 15), box);
}