3 #include <boost/test/unit_test.hpp> 11 BOOST_CHECK_EQUAL(
true, std::is_pod<reduce_size_long_message>::value);
14 char const buf[] = u8
"\x12" 17 "\x05\x40\x5B\x77\x8F\x56\x1D\x0B" 21 BOOST_REQUIRE_EQUAL(
sizeof(buf) - 1,
sizeof(msg));
22 std::memcpy(&msg, buf,
sizeof(msg));
23 BOOST_CHECK_EQUAL(
int(msg.
length.value()), 18);
26 BOOST_CHECK_EQUAL(msg.
order_id.value(), 0x0B1D568F775B4005ULL);
29 std::ostringstream os;
33 std::string(
"length=18,message_type=37,time_offset=447000" 34 ",order_id=800891482924597253,canceled_quantity=100"));
42 BOOST_CHECK_EQUAL(
true, std::is_pod<reduce_size_short_message>::value);
45 char const buf[] = u8
"\x10" 48 "\x05\x40\x5B\x77\x8F\x56\x1D\x0B" 52 BOOST_REQUIRE_EQUAL(
sizeof(buf) - 1,
sizeof(msg));
53 std::memcpy(&msg, buf,
sizeof(msg));
54 BOOST_CHECK_EQUAL(
int(msg.
length.value()), 16);
57 BOOST_CHECK_EQUAL(msg.
order_id.value(), 0x0B1D568F775B4005ULL);
60 std::ostringstream os;
64 std::string(
"length=16,message_type=38,time_offset=447000" 65 ",order_id=800891482924597253,canceled_quantity=100"));
boost::endian::little_uint64_buf_t order_id
quantity_type canceled_quantity
boost::endian::little_uint8_buf_t length
Represent the 'Reduce Size (long)' messages in the PITCH-2.X protocol.
Represent the 'Reduce Size (short)' messages in the PITCH-2.X protocol.
boost::endian::little_uint8_buf_t message_type
BOOST_AUTO_TEST_CASE(reduce_size_message_long_basic)
boost::endian::little_uint32_buf_t time_offset