| 30 | namespace ip_network_v4_compile { |
| 31 | |
| 32 | void test() |
| 33 | { |
| 34 | using namespace boost::asio; |
| 35 | namespace ip = boost::asio::ip; |
| 36 | |
| 37 | try |
| 38 | { |
| 39 | boost::system::error_code ec; |
| 40 | |
| 41 | // network_v4 constructors. |
| 42 | |
| 43 | ip::network_v4 net1(ip::make_address_v4("192.168.1.0"), 32); |
| 44 | ip::network_v4 net2(ip::make_address_v4("192.168.1.0"), |
| 45 | ip::make_address_v4("255.255.255.0")); |
| 46 | |
| 47 | // network_v4 functions. |
| 48 | |
| 49 | ip::address_v4 addr1 = net1.address(); |
| 50 | (void)addr1; |
| 51 | |
| 52 | unsigned short prefix_len = net1.prefix_length(); |
| 53 | (void)prefix_len; |
| 54 | |
| 55 | ip::address_v4 addr2 = net1.netmask(); |
| 56 | (void)addr2; |
| 57 | |
| 58 | ip::address_v4 addr3 = net1.network(); |
| 59 | (void)addr3; |
| 60 | |
| 61 | ip::address_v4 addr4 = net1.broadcast(); |
| 62 | (void)addr4; |
| 63 | |
| 64 | ip::address_v4_range hosts = net1.hosts(); |
| 65 | (void)hosts; |
| 66 | |
| 67 | ip::network_v4 net3 = net1.canonical(); |
| 68 | (void)net3; |
| 69 | |
| 70 | bool b1 = net1.is_host(); |
| 71 | (void)b1; |
| 72 | |
| 73 | bool b2 = net1.is_subnet_of(net2); |
| 74 | (void)b2; |
| 75 | |
| 76 | std::string s1 = net1.to_string(); |
| 77 | (void)s1; |
| 78 | |
| 79 | std::string s2 = net1.to_string(ec); |
| 80 | (void)s2; |
| 81 | |
| 82 | // network_v4 comparisons. |
| 83 | |
| 84 | bool b3 = (net1 == net2); |
| 85 | (void)b3; |
| 86 | |
| 87 | bool b4 = (net1 != net2); |
| 88 | (void)b4; |
| 89 |
nothing calls this directly
no test coverage detected