Build: update docker build scripts
[marnav.git] / test / nmea / Test_nmea_xte.cpp
blob3ce4ae405b734a4c1b6d993bdb6160c2f6306cd8
1 #include <gtest/gtest.h>
2 #include <marnav/nmea/xte.hpp>
3 #include <marnav/nmea/nmea.hpp>
4 #include "type_traits_helper.hpp"
6 namespace
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)
36 EXPECT_ANY_THROW(
37 nmea::detail::factory::sentence_parse<nmea::xte>(nmea::talker::none, {4, "@"}));
38 EXPECT_ANY_THROW(
39 nmea::detail::factory::sentence_parse<nmea::xte>(nmea::talker::none, {7, "@"}));
42 TEST_F(Test_nmea_xte, empty_to_string)
44 nmea::xte xte;
46 EXPECT_STREQ("$GPXTE,,,,,,*5E", nmea::to_string(xte).c_str());
49 TEST_F(Test_nmea_xte, set_cross_track_error_magnitude)
51 nmea::xte xte;
52 xte.set_cross_track_error_magnitude(1.2);
54 EXPECT_STREQ("$GPXTE,,,1.2,,N,*3D", nmea::to_string(xte).c_str());