1 #include <marnav/ais/message_23.hpp>
2 #include <marnav/ais/ais.hpp>
3 #include <gtest/gtest.h>
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);
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
)
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
);