1 #include <gtest/gtest.h> 3 #include "../src/ros_publisher.h" 5 TEST(ROSPublisherTester, CanFillANavSatFixMsg)
23 ASSERT_NE(msg,
nullptr);
27 EXPECT_EQ(msg->position_covariance_type, sensor_msgs::NavSatFix::COVARIANCE_TYPE_DIAGONAL_KNOWN);
33 TEST(ROSPublisherTester, CannotFillANavSatFixMsgIfNoPositionInNav)
37 EXPECT_EQ(msg,
nullptr);
40 TEST(ROSPublisherTester, CanFillANavSatFixMsgButNoCovarianceIfNoPositionDeviationInNav)
51 ASSERT_NE(msg,
nullptr);
55 EXPECT_EQ(msg->position_covariance_type, sensor_msgs::NavSatFix::COVARIANCE_TYPE_UNKNOWN);
58 TEST(ROSPublisherTester, CanFillANavSatFixMsgWithWestLong)
69 ASSERT_NE(msg,
nullptr);
70 EXPECT_EQ(msg->latitude, -23.454);
71 EXPECT_DOUBLE_EQ(msg->longitude, -89.66);
73 EXPECT_EQ(msg->position_covariance_type,
74 sensor_msgs::NavSatFix::COVARIANCE_TYPE_UNKNOWN);
77 int main(
int argc,
char** argv)
79 ::testing::InitGoogleTest(&argc, argv);
80 return RUN_ALL_TESTS();
boost::optional< Position > position
static sensor_msgs::NavSatFixPtr toNavSatFixMsg(const ixblue_stdbin_decoder::Data::BinaryNav &navData)
boost::optional< PositionDeviation > positionDeviation
int main(int argc, char **argv)
TEST(ROSPublisherTester, CanFillANavSatFixMsg)