7static void test(
const std::string &str,
8 const std::string &default_port,
10 const std::string &expected_host,
11 const std::string &expected_port,
12 const unsigned int expected_portnum,
13 const bool expected_status)
17 unsigned int port_save = 0;
23 OPENVPN_THROW_EXCEPTION(
"failed to parse " << str <<
" default_port=" << default_port <<
" allow_unix=" << allow_unix);
24 if (expected_host != host)
26 if (expected_port != port)
28 if (expected_portnum != port_save)
29 OPENVPN_THROW_EXCEPTION(
"inconsistent portnum " << str <<
" expected=" << expected_portnum <<
" actual=" << port_save);
bool split_host_port(const std::string &str, std::string &host, std::string &port, const std::string &default_port, const bool allow_unix, unsigned int *port_save=nullptr)