JayBeams  0.1
Another project to have fun coding.
ut_udp_receiver_config.cpp
Go to the documentation of this file.
2 
3 #include <boost/test/unit_test.hpp>
4 
5 /**
6  * @test Verify that jb::itch5::udp_receiver_config works as expected.
7  */
8 BOOST_AUTO_TEST_CASE(itch5_udp_receiver_config_basic) {
9  BOOST_CHECK_NO_THROW(jb::itch5::udp_receiver_config());
10  BOOST_CHECK_NO_THROW(
11  jb::itch5::udp_receiver_config().address("127.0.0.1").validate());
12  BOOST_CHECK_NO_THROW(
13  jb::itch5::udp_receiver_config().address("::1").validate());
14 
15  BOOST_CHECK_NO_THROW(jb::itch5::udp_receiver_config()
16  .address("239.128.1.1")
17  .local_address("127.0.0.1")
18  .validate());
19  BOOST_CHECK_NO_THROW(jb::itch5::udp_receiver_config()
20  .address("ff05::")
21  .local_address("::1")
22  .validate());
23 
24  BOOST_CHECK_THROW(
26  .address("127.0.0.1")
27  .local_address("127.0.0.2")
28  .validate(),
29  jb::usage);
30  BOOST_CHECK_THROW(
32  .address("::1")
33  .local_address("127.0.0.1")
34  .validate(),
35  jb::usage);
36 }
A simple class to communicate the result of parsing the options.
Definition: usage.hpp:11
BOOST_AUTO_TEST_CASE(itch5_udp_receiver_config_basic)
A configuration object for UDP receivers.