NMEA: serialization of sentences changed, gains performance by about 7 percent on...
[marnav.git] / test / nmea / Test_nmea_tds.cpp
blob7fa11a35da9d3b6618a7e5fbc653f6cf9557ef5d
1 #include <gtest/gtest.h>
2 #include <marnav/nmea/tds.hpp>
3 #include <marnav/nmea/nmea.hpp>
4 #include "type_traits_helper.hpp"
6 namespace
9 using namespace marnav;
11 class Test_nmea_tds : public ::testing::Test
15 TEST_F(Test_nmea_tds, contruction)
17 EXPECT_NO_THROW(nmea::tds tds);
20 TEST_F(Test_nmea_tds, properties)
22 nmea_sentence_traits<nmea::tds>();
25 TEST_F(Test_nmea_tds, parse)
27 auto s = nmea::make_sentence("$GPTDS,12.3,M*07");
28 ASSERT_NE(nullptr, s);
30 auto tds = nmea::sentence_cast<nmea::tds>(s);
31 ASSERT_NE(nullptr, tds);
34 TEST_F(Test_nmea_tds, parse_invalid_number_of_arguments)
36 EXPECT_ANY_THROW(
37 nmea::detail::factory::sentence_parse<nmea::tds>(nmea::talker_id::none, {1, "@"}));
38 EXPECT_ANY_THROW(
39 nmea::detail::factory::sentence_parse<nmea::tds>(nmea::talker_id::none, {3, "@"}));
42 TEST_F(Test_nmea_tds, empty_to_string)
44 nmea::tds tds;
46 EXPECT_STREQ("$GPTDS,0,M*29", nmea::to_string(tds).c_str());