34 #include <gtest/gtest.h>
45 TEST(CostmapQueue, basicQueue)
59 TEST(CostmapQueue, reverseQueue)
67 EXPECT_FLOAT_EQ(cell.
distance_, hypot(4.0 -
static_cast<double>(cell.
x_),
68 4.0 -
static_cast<double>(cell.
y_)));
74 TEST(CostmapQueue, bigTest)
91 EXPECT_EQ(count, 500 * 500);
94 TEST(CostmapQueue, linearQueue)
109 EXPECT_EQ(count, 25);
116 int xs[] = {1, 2, 2, 3};
117 int ys[] = {2, 1, 3, 2};
119 for (
int i = 0; i < N; i++)
129 for (
int i = 0; i < N; i++)
131 double dd = hypot(xs[i] -
static_cast<float>(cell.
x_), ys[i] -
static_cast<float>(cell.
y_));
132 min_d = std::min(min_d, dd);
137 EXPECT_EQ(count, 25);
140 TEST(CostmapQueue, limitedQueue)
151 EXPECT_EQ(count, 24);
161 EXPECT_EQ(count, 11);
165 TEST(CostmapQueue, changingSize)
178 unsigned int count = 0;
200 int main(
int argc,
char **argv)
202 testing::InitGoogleTest(&argc, argv);
207 return RUN_ALL_TESTS();