OpenVPN 3 Core Library
Loading...
Searching...
No Matches
test_cleanup.cpp
Go to the documentation of this file.
1
#include "
test_common.hpp
"
2
#include <iostream>
3
#include <memory>
4
5
#include <
openvpn/common/size.hpp
>
6
#include <
openvpn/common/exception.hpp
>
7
8
#include <
openvpn/common/cleanup.hpp
>
9
10
using namespace
openvpn
;
11
12
TEST
(misc, cleanup)
13
{
14
15
bool
ran_cleanup =
false
;
16
{
17
auto
c =
Cleanup
([&]()
18
{ ran_cleanup =
true
; });
19
static_assert
(std::is_nothrow_move_constructible<
decltype
(c)>::value,
20
"Cleanup should be noexcept MoveConstructible"
);
21
}
22
ASSERT_TRUE(ran_cleanup) <<
"cleanup didn't run as expected"
;
23
}
cleanup.hpp
exception.hpp
openvpn
Definition
ovpncli.cpp:97
openvpn::Cleanup
CleanupType< F > Cleanup(F method) noexcept
Definition
cleanup.hpp:43
size.hpp
TEST
TEST(misc, cleanup)
Definition
test_cleanup.cpp:12
test_common.hpp
test
unittests
test_cleanup.cpp
Generated by
1.9.8