4 #include <boost/test/unit_test.hpp> 12 using namespace std::chrono;
21 BOOST_CHECK_EQUAL(x.header.stock_locate, 0);
22 BOOST_CHECK_EQUAL(x.header.tracking_number, 1);
23 BOOST_CHECK_EQUAL(x.header.timestamp.ts.count(),
expected_ts.count());
24 BOOST_CHECK_EQUAL(x.stock,
"HSART");
25 BOOST_CHECK_EQUAL(x.trading_state, u
'T');
26 BOOST_CHECK_EQUAL(x.reason, u8
"MWC1");
31 BOOST_CHECK_EQUAL(x.header.stock_locate, 0);
32 BOOST_CHECK_EQUAL(x.header.tracking_number, 1);
33 BOOST_CHECK_EQUAL(x.header.timestamp.ts.count(),
expected_ts.count());
34 BOOST_CHECK_EQUAL(x.stock,
"HSART");
35 BOOST_CHECK_EQUAL(x.trading_state, u
'T');
36 BOOST_CHECK_EQUAL(x.reason, u8
"MWC1");
44 using namespace std::chrono;
50 std::ostringstream os;
53 os.str(),
"message_type=H,stock_locate=0" 54 ",tracking_number=1,timestamp=113231.123456789" static T r(std::size_t size, void const *msg, std::size_t offset)
Read a single message or field.
Contains classes and functions to parse NASDAQ ITCH-5.0 messages, more information about ITCH-5...
char_list_field< u 'H', u 'P', u 'Q', u 'T'> trading_state_t
Represent the 'Trading State' field on a 'Stock Trading Action' message.
static constexpr int message_type
std::chrono::nanoseconds expected_ts()
Return the expected timestamp for all the test messages.
BOOST_AUTO_TEST_CASE(decode_stock_trading_action_message)
std::pair< char const *, std::size_t > stock_trading_action()