General: separation of marav-io as a library
[marnav.git] / test / marnav / nmea / Test_nmea_hfb.cpp
blob5b7f947c36d62e6b538497a922aad92555bff207
1 #include <marnav/nmea/hfb.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_hfb : public ::testing::Test
15 TEST_F(Test_nmea_hfb, contruction)
17 EXPECT_NO_THROW(nmea::hfb hfb);
20 TEST_F(Test_nmea_hfb, properties)
22 nmea_sentence_traits<nmea::hfb>();
25 TEST_F(Test_nmea_hfb, parse)
27 auto s = nmea::make_sentence("$GPHFB,1.0,M,2.0,M*58");
28 ASSERT_NE(nullptr, s);
30 auto hfb = nmea::sentence_cast<nmea::hfb>(s);
31 ASSERT_NE(nullptr, hfb);
34 TEST_F(Test_nmea_hfb, parse_invalid_number_of_arguments)
36 EXPECT_ANY_THROW(
37 nmea::detail::factory::sentence_parse<nmea::hfb>(nmea::talker::none, {3, "@"}));
38 EXPECT_ANY_THROW(
39 nmea::detail::factory::sentence_parse<nmea::hfb>(nmea::talker::none, {5, "@"}));
42 TEST_F(Test_nmea_hfb, empty_to_string)
44 nmea::hfb hfb;
46 EXPECT_STREQ("$GPHFB,0,M,0,M*5B", nmea::to_string(hfb).c_str());