General: separation of marav-io as a library
[marnav.git] / test / marnav / nmea / Test_nmea_zdl.cpp
blob92882a6cc572f5286b7088ac86a2e531acf02b6b
1 #include <marnav/nmea/zdl.hpp>
2 #include "type_traits_helper.hpp"
3 #include <marnav/nmea/nmea.hpp>
4 #include <gtest/gtest.h>
6 namespace
9 using namespace marnav;
11 class Test_nmea_zdl : public ::testing::Test
15 TEST_F(Test_nmea_zdl, contruction)
17 EXPECT_NO_THROW(nmea::zdl zdl);
20 TEST_F(Test_nmea_zdl, properties)
22 nmea_sentence_traits<nmea::zdl>();
25 TEST_F(Test_nmea_zdl, parse)
27 auto s = nmea::make_sentence("$GPZDL,383401,12.3,R*28");
28 ASSERT_NE(nullptr, s);
30 auto zdl = nmea::sentence_cast<nmea::zdl>(s);
31 ASSERT_NE(nullptr, zdl);
34 TEST_F(Test_nmea_zdl, parse_invalid_number_of_arguments)
36 EXPECT_ANY_THROW(
37 nmea::detail::factory::sentence_parse<nmea::zdl>(nmea::talker::none, {2, "@"}));
38 EXPECT_ANY_THROW(
39 nmea::detail::factory::sentence_parse<nmea::zdl>(nmea::talker::none, {4, "@"}));
42 TEST_F(Test_nmea_zdl, empty_to_string)
44 nmea::zdl zdl;
46 EXPECT_STREQ("$GPZDL,000000,0.0,R*15", nmea::to_string(zdl).c_str());