OpenVPN 3 Core Library
Loading...
Searching...
No Matches
test_addrlist.cpp File Reference
#include "test_common.hpp"
#include "test_generators.hpp"
#include <set>
#include <vector>
#include <openvpn/addr/addrlist.hpp>
Include dependency graph for test_addrlist.cpp:

Go to the source code of this file.

Functions

address_list add (address)
 
 RC_ASSERT (address_list.exists(address))
 
list add (addr)
 
 RC_ASSERT (list.size()==1U)
 
 RC_ASSERT (list[0]==addr)
 
const std::set unique_addrs (addrs.begin(), addrs.end())
 
 for (const auto &addr :addrs)
 
 RC_ASSERT (list.exists(probe)==expected)
 

Variables

const auto address = *rc::genIPAddr()
 
const auto addr = *rc::genIPAddr()
 
openvpn::IP::AddrList list
 
const auto probe = *rc::gen::oneOf(rc::gen::elementOf(unique_addrs), rc::genIPAddr())
 
const bool expected = unique_addrs.contains(probe)
 

Function Documentation

◆ add() [1/2]

list add ( addr  )

◆ add() [2/2]

address_list add ( address  )
Here is the caller graph for this function:

◆ for()

for ( const auto &addr :addrs  )

Definition at line 43 of file test_addrlist.cpp.

◆ RC_ASSERT() [1/4]

RC_ASSERT ( address_list.  existsaddress)

◆ RC_ASSERT() [2/4]

RC_ASSERT ( list.  existsprobe = =expected)

◆ RC_ASSERT() [3/4]

RC_ASSERT ( list.  size() = =1U)

◆ RC_ASSERT() [4/4]

RC_ASSERT ( list  [0] = =addr)

◆ unique_addrs()

const std::set unique_addrs ( addrs.  begin(),
addrs.  end() 
)
Initial value:
{
const auto addrs = *rc::gen::container<std::vector<openvpn::IP::Addr>>(rc::genIPAddr())
auto genIPAddr() -> Gen< openvpn::IP::Addr >

Variable Documentation

◆ addr

const auto addr = *rc::genIPAddr()

Definition at line 31 of file test_addrlist.cpp.

◆ address

auto address = *rc::genIPAddr()

Definition at line 23 of file test_addrlist.cpp.

◆ expected

const bool expected = unique_addrs.contains(probe)

Definition at line 60 of file test_addrlist.cpp.

◆ list

Definition at line 42 of file test_addrlist.cpp.

◆ probe

const auto probe = *rc::gen::oneOf(rc::gen::elementOf(unique_addrs), rc::genIPAddr())

Definition at line 59 of file test_addrlist.cpp.