Esempio n. 1
0
TEST ( engineGeometryInterval, valueCollision )
{
    Interval < int > a { 1, 0 };
    Interval < int > b { 2, 8 };
    EXPECT_TRUE ( a.collides ( 0 ) );
    EXPECT_FALSE ( a.collides ( 4 ) );
    EXPECT_TRUE ( b.collides ( 3 ) );
}
Esempio n. 2
0
TEST ( engineGeometryInterval, intervalCollision )
{
    Interval < int > a { 1, 0 };
    Interval < int > b { 2, 8 };
    Interval < int > c { -5, 15 };
    EXPECT_FALSE ( a.collides ( b ) );
    EXPECT_TRUE ( a.collides ( a ) );
    EXPECT_TRUE ( c.collides ( b ) );
    EXPECT_TRUE ( b.collides ( c ) );
}