9 #include <boost/test/unit_test.hpp> 13 class mock_message_handler {
15 mock_message_handler() {
20 MOCK_METHOD0(now,
int());
26 int const&, std::uint64_t msgcnt, std::size_t msgoffset,
31 int const&, std::uint64_t msgcnt, std::size_t msgoffset,
36 int const&, std::uint64_t msgcnt, std::size_t msgoffset,
46 mock_message_handler handler;
47 using namespace ::testing;
48 EXPECT_CALL(handler, handle_unknown(Eq(42), _)).Times(1);
52 handler, 42, 2, 100, p.first, p.second);
60 mock_message_handler handler;
61 using namespace ::testing;
67 handle_message(42, _, _, An<jb::itch5::system_event_message const&>()))
71 process(handler, 42, 2, 100, p.first, p.second);
76 EXPECT_CALL(handler, handle_unknown(4242, _)).Times(1);
79 process(handler, 4242, 3, 200, p.first, p.second);
88 mock_message_handler handler;
89 using namespace ::testing;
99 handle_message(42, _, _, An<jb::itch5::system_event_message const&>()))
102 tested::process(handler, 42, 2, 100, p.first, p.second);
106 handler, handle_message(
107 43, _, _, An<jb::itch5::stock_directory_message const&>()))
110 tested::process(handler, 43, 3, 120, p.first, p.second);
115 handle_message(44, _, _, An<jb::itch5::add_order_message const&>()))
118 tested::process(handler, 44, 4, 140, p.first, p.second);
clock_type::time_point time_point
A convenience alias for clock_type::time_point.
std::pair< char const *, std::size_t > add_order()
std::pair< char const *, std::size_t > system_event()
std::pair< char const *, std::size_t > stock_directory()
Initialize GMock to work with Boost.Test.
Process a buffer with a single message: parse it and call the handler.
BOOST_AUTO_TEST_CASE(process_buffer_mlist_empty)
Verify that jb::itch5::process_buffer_mlist<> works for empty lists.
Represent a 'Stock Directory' message in the ITCH-5.0 protocol.
Represent an 'Add Order' message in the ITCH-5.0 protocol.
Represent a 'System Event Message' in the ITCH-5.0 protocol.