1 #include <marnav/nmea/tpc.hpp>
2 #include "type_traits_helper.hpp"
3 #include <marnav/nmea/nmea.hpp>
4 #include <gtest/gtest.h>
9 using namespace marnav
;
11 class Test_nmea_tpc
: public ::testing::Test
15 TEST_F(Test_nmea_tpc
, contruction
)
17 EXPECT_NO_THROW(nmea::tpc tpc
);
20 TEST_F(Test_nmea_tpc
, properties
)
22 nmea_sentence_traits
<nmea::tpc
>();
25 TEST_F(Test_nmea_tpc
, parse
)
27 auto s
= nmea::make_sentence("$GPTPC,1.0,M,2.0,M,3.0,M*33");
28 ASSERT_NE(nullptr, s
);
30 auto tpc
= nmea::sentence_cast
<nmea::tpc
>(s
);
31 ASSERT_NE(nullptr, tpc
);
34 TEST_F(Test_nmea_tpc
, parse_invalid_number_of_arguments
)
37 nmea::detail::factory::sentence_parse
<nmea::tpc
>(nmea::talker::none
, {5, "@"}));
39 nmea::detail::factory::sentence_parse
<nmea::tpc
>(nmea::talker::none
, {7, "@"}));
42 TEST_F(Test_nmea_tpc
, empty_to_string
)
46 EXPECT_STREQ("$GPTPC,0,M,0,M,0,M*2D", nmea::to_string(tpc
).c_str());