34 #include <gtest/gtest.h> 43 EXPECT_TRUE(b.isEmpty());
46 EXPECT_EQ(5.0, b.getMinX());
47 EXPECT_EQ(5.0, b.getMinX());
48 EXPECT_EQ(5.0, b.getMaxX());
49 EXPECT_EQ(6.0, b.getMinY());
50 EXPECT_EQ(6.0, b.getMaxY());
51 EXPECT_TRUE(b.contains(5.0, 6.0));
52 EXPECT_FALSE(b.contains(5.5, 6.0));
53 EXPECT_FALSE(b.contains(5.5, 4.0));
54 EXPECT_FALSE(b.isEmpty());
57 EXPECT_EQ(5.0, b2.getMinX());
58 EXPECT_EQ(5.0, b2.getMaxX());
59 EXPECT_EQ(6.0, b2.getMinY());
60 EXPECT_EQ(6.0, b2.getMaxY());
63 EXPECT_EQ(5.0, b2.getMinX());
64 EXPECT_EQ(5.0, b2.getMaxX());
65 EXPECT_EQ(6.0, b2.getMinY());
66 EXPECT_EQ(6.0, b2.getMaxY());
67 EXPECT_FALSE(b.contains(5.0, 6.0));
68 EXPECT_FALSE(b.contains(5.5, 6.0));
69 EXPECT_TRUE(b2.contains(5.0, 6.0));
70 EXPECT_FALSE(b.contains(5.5, 6.0));
71 EXPECT_TRUE(b.isEmpty());
76 EXPECT_TRUE(b3.contains(3.0, 3.0));
77 EXPECT_FALSE(b3.contains(0.0, 3.0));
78 EXPECT_FALSE(b3.contains(5.0, 3.0));
79 EXPECT_FALSE(b3.contains(3.0, 6.0));
80 EXPECT_FALSE(b3.contains(3.0, 1.0));
120 int main(
int argc,
char **argv)
122 testing::InitGoogleTest(&argc, argv);
123 return RUN_ALL_TESTS();
bool overlaps(const GenericBounds< NumericType > &other) const
returns true if the two bounds overlap each other
GenericBounds< double > Bounds
TEST(Bounds, test_bounds_simple)
int main(int argc, char **argv)
unsigned int getHeight() const
unsigned int getWidth() const