Build: update docker build scripts
[marnav.git] / test / nmea / Test_nmea_gbs.cpp
blob89e66801f39243ef51d46045ac22fb0d75f0c68b
1 #include <gtest/gtest.h>
2 #include <marnav/nmea/gbs.hpp>
3 #include <marnav/nmea/nmea.hpp>
4 #include "type_traits_helper.hpp"
6 namespace
9 using namespace marnav;
11 class Test_nmea_gbs : public ::testing::Test
15 TEST_F(Test_nmea_gbs, contruction)
17 EXPECT_NO_THROW(nmea::gbs gbs);
20 TEST_F(Test_nmea_gbs, properties)
22 nmea_sentence_traits<nmea::gbs>();
25 TEST_F(Test_nmea_gbs, parse)
27 auto s = nmea::make_sentence("$GPGBS,123456.32,1.0,2.0,3.0,034,0.1,1.2,0.6*5A");
28 ASSERT_NE(nullptr, s);
30 auto gbs = nmea::sentence_cast<nmea::gbs>(s);
31 ASSERT_NE(nullptr, gbs);
34 TEST_F(Test_nmea_gbs, parse_invalid_number_of_arguments)
36 EXPECT_ANY_THROW(
37 nmea::detail::factory::sentence_parse<nmea::gbs>(nmea::talker::none, {7, "@"}));
38 EXPECT_ANY_THROW(
39 nmea::detail::factory::sentence_parse<nmea::gbs>(nmea::talker::none, {9, "@"}));
42 TEST_F(Test_nmea_gbs, empty_to_string)
44 nmea::gbs gbs;
46 EXPECT_STREQ("$GPGBS,000000.00,0,0,0,000,0,0,0*5F", nmea::to_string(gbs).c_str());