3 #include <boost/test/unit_test.hpp> 11 BOOST_CHECK_EQUAL(
true, std::is_pod<short_add_order_message>::value);
14 char const buf[] = u8
"\x1A" 17 "\x05\x40\x5B\x77\x8F\x56\x1D\x0B" 20 "\x5A\x56\x5A\x5A\x54\x20" 25 BOOST_REQUIRE_EQUAL(
sizeof(buf) - 1,
sizeof(msg));
26 std::memcpy(&msg, buf,
sizeof(msg));
27 BOOST_CHECK_EQUAL(
int(msg.
length.value()), 26);
30 BOOST_CHECK_EQUAL(msg.
order_id.value(), 0x0B1D568F775B4005ULL);
32 BOOST_CHECK_EQUAL(msg.
quantity.value(), 20000);
34 BOOST_CHECK_EQUAL(msg.
price.value(), 10250);
35 BOOST_CHECK_EQUAL(msg.
add_flags.value(), 0x01);
37 std::ostringstream os;
41 std::string(
"length=26,message_type=34,time_offset=447000," 42 "order_id=800891482924597253,side_indicator=B," 43 "quantity=20000,symbol=ZVZZT ,price=10250,add_flags=1"));
boost::endian::little_uint8_buf_t side_indicator
boost::endian::little_uint32_buf_t time_offset
BOOST_AUTO_TEST_CASE(short_add_order_message_basic)
Represent the short version of 'Add Order' message in the PITCH-2.X protocol.
boost::endian::little_uint8_buf_t message_type
boost::endian::little_uint8_buf_t length
boost::endian::little_uint64_buf_t order_id
boost::endian::little_uint8_buf_t add_flags