3 #include <boost/test/unit_test.hpp> 11 BOOST_CHECK_EQUAL(
true, std::is_pod<modify_long_message>::value);
14 char const buf[] = u8
"\x1B" 17 "\x05\x40\x5B\x77\x8F\x56\x1D\x0B" 19 "\xE8\xA3\x0F\x00\x00\x00\x00\x00" 23 BOOST_REQUIRE_EQUAL(
sizeof(buf) - 1,
sizeof(msg));
24 std::memcpy(&msg, buf,
sizeof(msg));
25 BOOST_CHECK_EQUAL(
int(msg.
length.value()), 27);
28 BOOST_CHECK_EQUAL(msg.
order_id.value(), 0x0B1D568F775B4005ULL);
29 BOOST_CHECK_EQUAL(msg.
quantity.value(), 75000);
30 BOOST_CHECK_EQUAL(msg.
price.value(), 1025000);
33 std::ostringstream os;
36 os.str(), std::string(
"length=27,message_type=39,time_offset=447000" 37 ",order_id=800891482924597253,quantity=75000" 38 ",price=1025000,modify_flags=3"));
46 BOOST_CHECK_EQUAL(
true, std::is_pod<modify_short_message>::value);
49 char const buf[] = u8
"\x13" 52 "\x05\x40\x5B\x77\x8F\x56\x1D\x0B" 58 BOOST_REQUIRE_EQUAL(
sizeof(buf) - 1,
sizeof(msg));
59 std::memcpy(&msg, buf,
sizeof(msg));
60 BOOST_CHECK_EQUAL(
int(msg.
length.value()), 19);
63 BOOST_CHECK_EQUAL(msg.
order_id.value(), 0x0B1D568F775B4005ULL);
64 BOOST_CHECK_EQUAL(msg.
quantity.value(), 100);
65 BOOST_CHECK_EQUAL(msg.
price.value(), 10250);
68 std::ostringstream os;
71 os.str(), std::string(
"length=19,message_type=40,time_offset=447000" 72 ",order_id=800891482924597253,quantity=100" 73 ",price=10250,modify_flags=3"));
boost::endian::little_uint32_buf_t time_offset
BOOST_AUTO_TEST_CASE(modify_message_long_basic)
boost::endian::little_uint8_buf_t modify_flags
Represent the 'Modify (short)' messages in the PITCH-2.X protocol.
boost::endian::little_uint8_buf_t length
boost::endian::little_uint8_buf_t message_type
boost::endian::little_uint64_buf_t order_id
Represent the 'Modify (long)' messages in the PITCH-2.X protocol.