OpenVPN 3 Core Library
|
#include "test_common.hpp"
#include "test_generators.hpp"
#include <iostream>
#include <openvpn/common/file.hpp>
#include <openvpn/tun/builder/capture.hpp>
Go to the source code of this file.
Functions | |
TEST (misc, capture) | |
TEST (RemoteAddress, EmptyIsNotDefined) | |
RC_ASSERT (remote_address.defined()) | |
TEST (RemoteAddress, EmptyStringRepresentation) | |
TEST (RemoteAddress, EmptyStringRepresentationIncludesIPv6Setting) | |
RC_ASSERT_THROWS_AS (remote_address.validate(title), openvpn::IP::ip_exception) | |
remote_address | validate (title) |
from_json | from_json (address_as_json, title) |
RC_ASSERT_THROWS_AS (from_json.validate(title), openvpn::IP::ip_exception) | |
from_json | from_json (invalid_json, title) |
RC_ASSERT (from_json.ipv6==ipv6) | |
TEST (RerouteGW, EmptyStringRepresentationReturnsUnsetOptions) | |
if (flags &RedirectGatewayFlags::RG_ENABLE) ret+ | |
if (flags &RedirectGatewayFlags::RG_REROUTE_GW) ret+ | |
if (flags &RedirectGatewayFlags::RG_LOCAL) ret+ | |
if (flags &RedirectGatewayFlags::RG_AUTO_LOCAL) ret+ | |
if (flags &RedirectGatewayFlags::RG_DEF1) ret+ | |
if (flags &RedirectGatewayFlags::RG_BYPASS_DHCP) ret+ | |
if (flags &RedirectGatewayFlags::RG_BYPASS_DNS) ret+ | |
if (flags &RedirectGatewayFlags::RG_BLOCK_LOCAL) ret+ | |
if (flags &RedirectGatewayFlags::RG_IPv4) ret+ | |
if (flags &RedirectGatewayFlags::RG_IPv6) ret+ | |
RC_ASSERT (reroute_gw.to_string()==ipv4_and_ipv6_return_string+"flags="+ret) | |
from_json | from_json (reroute_gw_as_json, title) |
RC_ASSERT_THROWS_AS (from_json.from_json(invalid_json, title), json::json_parse) | |
TEST (ProxyBypass, EmptyIsNotDefined) | |
RC_ASSERT (proxy_bypass.defined()) | |
TEST (ProxyBypass, EmptyStringRepresentation) | |
from_json | from_json (proxy_bypass_as_json, title) |
TEST (ProxyAutoConfigURL, EmptyIsNotDefined) | |
RC_ASSERT (proxy_autoconfig_url.defined()) | |
TEST (ProxyAutoConfigURL, EmptyStringRepresentation) | |
from_json | from_json (proxy_autoconfig_url_as_json, title) |
TEST (ProxyHostPort, EmptyIsNotDefined) | |
RC_ASSERT (proxy_host_port.defined()) | |
TEST (ProxyHostPort, EmptyStringRepresentationReturnsDefaultPort) | |
from_json | from_json (proxy_host_port_as_json, title) |
TEST (WINSServer, EmptyStringRepresentation) | |
RC_ASSERT (wins_server.to_string()==address) | |
RC_ASSERT_THROWS_AS (wins_server.validate(title), openvpn::IP::ip_exception) | |
from_json | from_json (wins_server_as_json, title) |
from_json from_json | ( | address_as_json | , |
title | |||
) |
from_json from_json | ( | invalid_json | , |
title | |||
) |
from_json from_json | ( | proxy_autoconfig_url_as_json | , |
title | |||
) |
from_json from_json | ( | proxy_bypass_as_json | , |
title | |||
) |
from_json from_json | ( | proxy_host_port_as_json | , |
title | |||
) |
from_json from_json | ( | reroute_gw_as_json | , |
title | |||
) |
from_json from_json | ( | wins_server_as_json | , |
title | |||
) |
if | ( | flags &RedirectGatewayFlags::RG_AUTO_LOCAL | ) |
if | ( | flags &RedirectGatewayFlags::RG_BLOCK_LOCAL | ) |
if | ( | flags &RedirectGatewayFlags::RG_BYPASS_DHCP | ) |
if | ( | flags &RedirectGatewayFlags::RG_BYPASS_DNS | ) |
if | ( | flags &RedirectGatewayFlags::RG_DEF1 | ) |
if | ( | flags &RedirectGatewayFlags::RG_ENABLE | ) |
if | ( | flags &RedirectGatewayFlags::RG_IPv4 | ) |
if | ( | flags &RedirectGatewayFlags::RG_IPv6 | ) |
if | ( | flags &RedirectGatewayFlags::RG_LOCAL | ) |
if | ( | flags &RedirectGatewayFlags::RG_REROUTE_GW | ) |
RC_ASSERT | ( | from_json. | ipv6 = =ipv6 | ) |
RC_ASSERT | ( | proxy_autoconfig_url. | defined() | ) |
RC_ASSERT | ( | proxy_bypass. | defined() | ) |
RC_ASSERT | ( | proxy_host_port. | defined() | ) |
RC_ASSERT | ( | remote_address. | defined() | ) |
RC_ASSERT | ( | reroute_gw. | to_string() = =ipv4_and_ipv6_return_string+"flags="+ret | ) |
RC_ASSERT | ( | wins_server. | to_string() = =address | ) |
RC_ASSERT_THROWS_AS | ( | from_json. | from_jsoninvalid_json, title, |
json::json_parse | |||
) |
RC_ASSERT_THROWS_AS | ( | from_json. | validatetitle, |
openvpn::IP::ip_exception | |||
) |
RC_ASSERT_THROWS_AS | ( | remote_address. | validatetitle, |
openvpn::IP::ip_exception | |||
) |
RC_ASSERT_THROWS_AS | ( | wins_server. | validatetitle, |
openvpn::IP::ip_exception | |||
) |
TEST | ( | misc | , |
capture | |||
) |
write_string(fn1, j1_txt);
Definition at line 11 of file test_capture.cpp.
TEST | ( | ProxyAutoConfigURL | , |
EmptyIsNotDefined | |||
) |
Definition at line 494 of file test_capture.cpp.
TEST | ( | ProxyAutoConfigURL | , |
EmptyStringRepresentation | |||
) |
Definition at line 508 of file test_capture.cpp.
TEST | ( | ProxyBypass | , |
EmptyIsNotDefined | |||
) |
Definition at line 402 of file test_capture.cpp.
TEST | ( | ProxyBypass | , |
EmptyStringRepresentation | |||
) |
Definition at line 416 of file test_capture.cpp.
TEST | ( | ProxyHostPort | , |
EmptyIsNotDefined | |||
) |
Definition at line 588 of file test_capture.cpp.
TEST | ( | ProxyHostPort | , |
EmptyStringRepresentationReturnsDefaultPort | |||
) |
Definition at line 602 of file test_capture.cpp.
TEST | ( | RemoteAddress | , |
EmptyIsNotDefined | |||
) |
Definition at line 71 of file test_capture.cpp.
TEST | ( | RemoteAddress | , |
EmptyStringRepresentation | |||
) |
Definition at line 85 of file test_capture.cpp.
TEST | ( | RemoteAddress | , |
EmptyStringRepresentationIncludesIPv6Setting | |||
) |
Definition at line 91 of file test_capture.cpp.
TEST | ( | RerouteGW | , |
EmptyStringRepresentationReturnsUnsetOptions | |||
) |
Definition at line 254 of file test_capture.cpp.
TEST | ( | WINSServer | , |
EmptyStringRepresentation | |||
) |
Definition at line 686 of file test_capture.cpp.
from_json validate | ( | title | ) |
wins_server address = address |
Definition at line 81 of file test_capture.cpp.
const auto address_as_json = remote_address.to_json() |
Definition at line 157 of file test_capture.cpp.
proxy_bypass bypass_host = bypass_host |
Definition at line 412 of file test_capture.cpp.
from_json flags = flags |
Definition at line 265 of file test_capture.cpp.
from_json from_json |
Definition at line 158 of file test_capture.cpp.
from_json host = host |
Definition at line 598 of file test_capture.cpp.
const Json::Value invalid_json |
Definition at line 244 of file test_capture.cpp.
from_json ipv4 = ipv4 |
Definition at line 263 of file test_capture.cpp.
const std::string ipv4_and_ipv6_return_string = {"IPv4=" + std::to_string(ipv4) + " IPv6=" + std::to_string(ipv6) + " "} |
Definition at line 290 of file test_capture.cpp.
from_json ipv6 = true |
Definition at line 108 of file test_capture.cpp.
from_json port = port |
Definition at line 612 of file test_capture.cpp.
TunBuilderCapture::ProxyAutoConfigURL proxy_autoconfig_url |
Definition at line 503 of file test_capture.cpp.
const auto proxy_autoconfig_url_as_json = proxy_autoconfig_url.to_json() |
Definition at line 530 of file test_capture.cpp.
TunBuilderCapture::ProxyBypass proxy_bypass |
Definition at line 411 of file test_capture.cpp.
const auto proxy_bypass_as_json = proxy_bypass.to_json() |
Definition at line 438 of file test_capture.cpp.
TunBuilderCapture::ProxyHostPort proxy_host_port |
Definition at line 597 of file test_capture.cpp.
const auto proxy_host_port_as_json = proxy_host_port.to_json() |
Definition at line 625 of file test_capture.cpp.
TunBuilderCapture::RemoteAddress remote_address |
Definition at line 80 of file test_capture.cpp.
const auto reroute_gw_as_json = reroute_gw.to_json() |
Definition at line 297 of file test_capture.cpp.
ret = "[ " |
Definition at line 267 of file test_capture.cpp.
from_json url = url |
Definition at line 504 of file test_capture.cpp.
const auto wins_server_as_json = wins_server.to_json() |
Definition at line 722 of file test_capture.cpp.