1 #include <gtest/gtest.h> 13 TEST(MemoryBocksParser, ParseRotationAccelerationVesselFrame)
18 const std::vector<uint8_t> memory{
19 0xbf, 0xc0, 0x00, 0x00,
20 0x3f, 0xa0, 0x00, 0x00,
21 0x41, 0x48, 0xcc, 0xcd
24 auto buffer = boost::asio::buffer(memory.data(), memory.size());
28 parser.parse(buffer, binaryNav);
36 ASSERT_EQ(0, boost::asio::buffer_size(buffer));
39 TEST(MemoryBocksParser, ParseRotationAccelerationVesselFrameDeviation)
44 const std::vector<uint8_t> memory{
45 0xbf, 0xc0, 0x00, 0x00,
46 0x3f, 0xa0, 0x00, 0x00,
47 0x41, 0x48, 0xcc, 0xcd
50 auto buffer = boost::asio::buffer(memory.data(), memory.size());
54 parser.parse(buffer, binaryNav);
68 ASSERT_EQ(0, boost::asio::buffer_size(buffer));
71 TEST(MemoryBocksParser, ParseRawRotationRateVesselFrame)
76 const std::vector<uint8_t> memory{
77 0xbf, 0xc0, 0x00, 0x00,
78 0x3f, 0xa0, 0x00, 0x00,
79 0x41, 0x48, 0xcc, 0xcd
82 auto buffer = boost::asio::buffer(memory.data(), memory.size());
86 parser.parse(buffer, binaryNav);
94 ASSERT_EQ(0, boost::asio::buffer_size(buffer));
97 TEST(MemoryBocksParser, ParseVehicleAttitudeHeading)
102 const std::vector<uint8_t> memory{
103 0xbf, 0xc0, 0x00, 0x00,
104 0x3f, 0xa0, 0x00, 0x00,
105 0x41, 0x48, 0xcc, 0xcd
108 auto buffer = boost::asio::buffer(memory.data(), memory.size());
112 parser.parse(buffer, binaryNav);
120 ASSERT_EQ(0, boost::asio::buffer_size(buffer));
123 TEST(MemoryBocksParser, ParseVehicleAttitudeHeadingDeviation)
128 const std::vector<uint8_t> memory{
129 0xbf, 0xc0, 0x00, 0x00,
130 0x3f, 0xa0, 0x00, 0x00,
131 0x41, 0x48, 0xcc, 0xcd
134 auto buffer = boost::asio::buffer(memory.data(), memory.size());
138 parser.parse(buffer, binaryNav);
141 ASSERT_FLOAT_EQ(-1.5,
143 ASSERT_FLOAT_EQ(1.25,
145 ASSERT_FLOAT_EQ(12.55,
149 ASSERT_EQ(0, boost::asio::buffer_size(buffer));
152 TEST(MemoryBocksParser, ParseVehiclePosition)
157 const std::vector<uint8_t> memory{
158 0x40, 0x39, 0xae, 0x14,
159 0x7a, 0xe1, 0x47, 0xae,
160 0xc0, 0x13, 0x00, 0x00,
161 0x00, 0x00, 0x00, 0x00,
163 0x43, 0x1a, 0x35, 0xc3
166 auto buffer = boost::asio::buffer(memory.data(), memory.size());
170 parser.parse(buffer, binaryNav);
174 ASSERT_DOUBLE_EQ(-4.75, binaryNav.
vehiclePosition.get().longitude_deg);
179 ASSERT_EQ(0, boost::asio::buffer_size(buffer));
182 TEST(MemoryBocksParser, ParseVehiclePositionDeviation)
187 const std::vector<uint8_t> memory{
188 0x3f, 0xa0, 0x00, 0x00,
189 0x41, 0x48, 0xcc, 0xcd,
190 0xbf, 0xc0, 0x00, 0x00,
191 0xbb, 0xa3, 0xd7, 0x0a
194 auto buffer = boost::asio::buffer(memory.data(), memory.size());
198 parser.parse(buffer, binaryNav);
207 ASSERT_EQ(0, boost::asio::buffer_size(buffer));
210 int main(
int argc,
char** argv)
212 ::testing::InitGoogleTest(&argc, argv);
213 return RUN_ALL_TESTS();
boost::optional< RawRotationRateVesselFrame > rawRotationRateVesselFrame
TEST(MemoryBocksParser, ParseRotationAccelerationVesselFrame)
boost::optional< VehicleAttitudeHeadingDeviation > vehicleAttitudeHeadingDeviation
boost::optional< VehiclePositionDeviation > vehiclePositionDeviation
boost::optional< RotationAccelerationVesselFrameDeviation > rotationAccelerationVesselFrameDeviation
boost::optional< VehiclePosition > vehiclePosition
boost::optional< RotationAccelerationVesselFrame > rotationAccelerationVesselFrame
boost::optional< VehicleAttitudeHeading > vehicleAttitudeHeading
int main(int argc, char **argv)