1 #include <gtest/gtest.h>
2 #include <marnav/nmea/xte.hpp>
3 #include <marnav/nmea/nmea.hpp>
4 #include "type_traits_helper.hpp"
9 using namespace marnav
;
11 class Test_nmea_xte
: public ::testing::Test
15 TEST_F(Test_nmea_xte
, contruction
)
17 EXPECT_NO_THROW(nmea::xte xte
);
20 TEST_F(Test_nmea_xte
, properties
)
22 nmea_sentence_traits
<nmea::xte
>();
25 TEST_F(Test_nmea_xte
, parse
)
27 auto s
= nmea::make_sentence("$GPXTE,,,,,,*5E");
28 ASSERT_NE(nullptr, s
);
30 auto xte
= nmea::sentence_cast
<nmea::xte
>(s
);
31 ASSERT_NE(nullptr, xte
);
34 TEST_F(Test_nmea_xte
, parse_invalid_number_of_arguments
)
37 nmea::detail::factory::sentence_parse
<nmea::xte
>(nmea::talker_id::none
, {4, "@"}));
39 nmea::detail::factory::sentence_parse
<nmea::xte
>(nmea::talker_id::none
, {7, "@"}));
42 TEST_F(Test_nmea_xte
, empty_to_string
)
46 EXPECT_STREQ("$GPXTE,,,,,,*5E", nmea::to_string(xte
).c_str());
49 TEST_F(Test_nmea_xte
, set_cross_track_error_magnitude
)
52 xte
.set_cross_track_error_magnitude(1.2);
54 EXPECT_STREQ("$GPXTE,,,1.2,,N,*3D", nmea::to_string(xte
).c_str());