1 #include <marnav/ais/ais.hpp>
2 #include <gtest/gtest.h>
7 using namespace marnav
;
9 class Test_ais
: public ::testing::Test
17 static const std::vector
<entry
> ARMORING_ENTRIES
;
20 const std::vector
<Test_ais::entry
> Test_ais::ARMORING_ENTRIES
= {
87 class message_zero_bits
: public ais::message
91 : message(ais::message_id::NONE
)
95 virtual ais::raw
get_data() const override
{ return ais::raw
{}; }
98 TEST_F(Test_ais
, make_message
)
102 vector
<pair
<string
, uint32_t>> v
;
104 // v.push_back(make_pair("55P5TL01VIaAL@7WKO@mBplU@<PDhh000000001S;AJ::4A80?4i@E53", 0));
105 // v.push_back(make_pair("1@0000000000000", 2));
107 // v.push_back(make_pair("177KQJ5000G?tO`K>RA1wUbN0TKH", 0));
109 v
.push_back(make_pair("133m@ogP00PD;88MD5MTDww@2D7k", 0));
111 auto result
= ais::make_message(v
);
114 TEST_F(Test_ais
, encode_message_zero_sized_bits
)
117 EXPECT_ANY_THROW(ais::encode_message(m
));
120 TEST_F(Test_ais
, decode_armoring
)
122 for (auto const & e
: ARMORING_ENTRIES
) {
123 EXPECT_EQ(e
.value
, ais::decode_armoring(e
.c
));
127 TEST_F(Test_ais
, encode_armoring
)
129 for (auto const & e
: ARMORING_ENTRIES
) {
130 EXPECT_EQ(e
.c
, ais::encode_armoring(e
.value
));