33 #include <gtest/gtest.h> 37 TEST(BlockmemGridmap, ResetClear)
41 for (
int s = 4;
s <= 6;
s += 2)
47 for (i[0] = 0; i[0] <
s; ++i[0])
49 for (i[1] = 0; i[1] < s; ++i[1])
51 for (i[2] = 0; i[2] < s; ++i[2])
53 ASSERT_EQ(gm[i], 0.0);
59 for (i[0] = 0; i[0] < s; ++i[0])
61 for (i[1] = 0; i[1] < s; ++i[1])
63 for (i[2] = 0; i[2] < s; ++i[2])
65 ASSERT_EQ(gm[i], 3.0);
72 TEST(BlockmemGridmap, WriteRead)
81 for (i[0] = 0; i[0] < s; ++i[0])
83 for (i[1] = 0; i[1] < s; ++i[1])
85 for (i[2] = 0; i[2] < s; ++i[2])
87 gm[i] = i[2] * 100 + i[1] * 10 + i[0];
92 for (i[0] = 0; i[0] < s; ++i[0])
94 for (i[1] = 0; i[1] < s; ++i[1])
96 for (i[2] = 0; i[2] < s; ++i[2])
98 ASSERT_EQ(gm[i], i[2] * 100 + i[1] * 10 + i[0]);
104 TEST(BlockmemGridmap, OuterBoundery)
113 const int outer = 0x10;
114 for (i[0] = -outer; i[0] < s + outer; ++i[0])
116 for (i[1] = -outer; i[1] < s + outer; ++i[1])
118 for (i[2] = -outer; i[2] < s + outer; ++i[2])
120 if (i[0] >= 0 && i[1] >= 0 && i[2] >= 0 &&
121 i[0] < s && i[1] < s && i[2] < s)
136 int main(
int argc,
char** argv)
138 testing::InitGoogleTest(&argc, argv);
140 return RUN_ALL_TESTS();
void reset(const CyclicVecInt< DIM, NONCYCLIC > &size)
TEST(BlockmemGridmap, ResetClear)
bool validate(const CyclicVecInt< DIM, NONCYCLIC > &pos, const int tolerance=0) const
int main(int argc, char **argv)