34 #include <gtest/gtest.h> 39 TEST(KernelFunction, cardinal_addition)
41 EXPECT_EQ(CardinalDirection::NORTHWEST, CardinalDirection::NORTH + CardinalDirection::WEST);
42 EXPECT_EQ(CardinalDirection::SOUTHWEST, CardinalDirection::SOUTH + CardinalDirection::WEST);
43 EXPECT_EQ(CardinalDirection::NORTHEAST, CardinalDirection::NORTH + CardinalDirection::EAST);
44 EXPECT_EQ(CardinalDirection::SOUTHEAST, CardinalDirection::SOUTH + CardinalDirection::EAST);
47 TEST(KernelFunction, cardinal_and)
49 EXPECT_TRUE(CardinalDirection::NORTHWEST & CardinalDirection::NORTH);
50 EXPECT_TRUE(CardinalDirection::NORTHWEST & CardinalDirection::NORTHWEST);
51 EXPECT_TRUE(CardinalDirection::NORTHWEST & CardinalDirection::WEST);
52 EXPECT_FALSE(CardinalDirection::NORTHWEST & CardinalDirection::SOUTH);
53 EXPECT_FALSE(CardinalDirection::NORTHWEST & CardinalDirection::SOUTHEAST);
54 EXPECT_FALSE(CardinalDirection::NORTHWEST & CardinalDirection::EAST);
57 TEST(KernelFunction, some_kernel_values)
69 EXPECT_EQ(CardinalDirection::NORTH, upstream);
72 EXPECT_EQ(CardinalDirection::EAST, upstream);
77 EXPECT_EQ(CardinalDirection::EAST, upstream);
82 EXPECT_EQ(CardinalDirection::NORTHEAST, upstream);
85 int main(
int argc,
char **argv)
87 testing::InitGoogleTest(&argc, argv);
88 return RUN_ALL_TESTS();
int main(int argc, char **argv)
TEST(KernelFunction, cardinal_addition)
const float HIGH_POTENTIAL
void setInfo(const NavGridInfo &new_info) override
void setValue(const unsigned int x, const unsigned int y, const T &value) override
static float calculateKernel(const PotentialGrid &potential_grid, unsigned char cost, unsigned int x, unsigned int y, CardinalDirection *upstream=nullptr)
potential calculation that uses multiple values of the neighboring cells