NMEA: make nmeatool available with/without ENABLE_IO
[marnav.git] / test / ais / Test_ais_message_23.cpp
blob0223be201d4a2151672b04d85bc108c09aa51a19
1 #include <marnav/ais/message_23.hpp>
2 #include <marnav/ais/ais.hpp>
3 #include <gtest/gtest.h>
5 namespace
7 using namespace marnav;
9 class Test_ais_message_23 : public ::testing::Test
13 TEST_F(Test_ais_message_23, parse)
15 static const std::vector<std::vector<std::pair<std::string, uint32_t>>> TESTS = {
16 {{"G00000000000000000000000000", 2}},
19 for (const auto & test : TESTS) {
20 auto result = ais::make_message(test);
21 EXPECT_TRUE(result != nullptr);
22 if (result) {
23 auto m = ais::message_cast<ais::message_23>(result);
24 EXPECT_TRUE(m != nullptr);
29 TEST_F(Test_ais_message_23, encode_default_values)
31 ais::message_23 m;
33 auto v = ais::encode_message(m);
35 ASSERT_EQ(1u, v.size());
36 EXPECT_STREQ("G000001b3Qba3D73EB000000000", v[0].first.c_str());
37 EXPECT_EQ(2u, v[0].second);