1 #include <gtest/gtest.h>
2 #include <marnav/nmea/sfi.hpp>
3 #include <marnav/nmea/nmea.hpp>
4 #include "type_traits_helper.hpp"
9 using namespace marnav
;
11 class Test_nmea_sfi
: public ::testing::Test
15 TEST_F(Test_nmea_sfi
, contruction
)
17 EXPECT_NO_THROW(nmea::sfi sfi
);
20 TEST_F(Test_nmea_sfi
, properties
)
22 nmea_sentence_traits
<nmea::sfi
>();
25 TEST_F(Test_nmea_sfi
, parse
)
27 auto s
= nmea::make_sentence("$GPSFI,1,1,156025,M*03");
28 ASSERT_NE(nullptr, s
);
30 auto sfi
= nmea::sentence_cast
<nmea::sfi
>(s
);
31 ASSERT_NE(nullptr, sfi
);
34 TEST_F(Test_nmea_sfi
, parse_invalid_number_of_arguments
)
37 nmea::detail::factory::sentence_parse
<nmea::sfi
>(nmea::talker::none
, {1, "@"}));
39 nmea::detail::factory::sentence_parse
<nmea::sfi
>(nmea::talker::none
, {3, "@"}));
41 nmea::detail::factory::sentence_parse
<nmea::sfi
>(nmea::talker::none
, {23, "@"}));
43 nmea::detail::factory::sentence_parse
<nmea::sfi
>(nmea::talker::none
, {24, "@"}));
46 TEST_F(Test_nmea_sfi
, empty_to_string
)
50 EXPECT_STREQ("$GPSFI,0,0*4B", nmea::to_string(sfi
).c_str());