4 #include <boost/test/unit_test.hpp> 12 using namespace std::chrono;
17 auto x = decoder<true, system_event_message>::r(buf.second, buf.first, 0);
18 BOOST_CHECK_EQUAL(x.header.message_type, system_event_message::message_type);
19 BOOST_CHECK_EQUAL(x.header.stock_locate, 0);
20 BOOST_CHECK_EQUAL(x.header.tracking_number, 1);
21 BOOST_CHECK_EQUAL(x.header.timestamp.ts.count(),
expected_ts.count());
22 BOOST_CHECK_EQUAL(x.event_code, u
'O');
24 x = decoder<false, system_event_message>::r(buf.second, buf.first, 0);
25 BOOST_CHECK_EQUAL(x.header.message_type, system_event_message::message_type);
26 BOOST_CHECK_EQUAL(x.header.stock_locate, 0);
27 BOOST_CHECK_EQUAL(x.header.tracking_number, 1);
28 BOOST_CHECK_EQUAL(x.header.timestamp.ts.count(),
expected_ts.count());
29 BOOST_CHECK_EQUAL(x.event_code, u
'O');
37 using namespace std::chrono;
40 auto ts =
timestamp{duration_cast<nanoseconds>(
41 hours(11) + minutes(32) + seconds(31) + nanoseconds(123456789L))};
44 std::ostringstream os;
47 os.str(),
"message_type= ,stock_locate=0," 48 "tracking_number=1,timestamp=113231.123456789" 63 BOOST_CHECK_THROW(
event_code_t(u
'*'), std::runtime_error);
Contains classes and functions to parse NASDAQ ITCH-5.0 messages, more information about ITCH-5...
BOOST_AUTO_TEST_CASE(decode_system_event_message)
std::pair< char const *, std::size_t > system_event()
Define the interface to decode ITCH-5.0 messages and message fields.
Represent a ITCH-5.0 timestamp.
std::chrono::nanoseconds expected_ts()
Return the expected timestamp for all the test messages.
char_list_field< u 'O', u 'S', u 'Q', u 'M', u 'E', u 'C'> event_code_t
Represent the 'Event Code' field on a 'System Event Message'.
Represent a 'System Event Message' in the ITCH-5.0 protocol.