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
7
9
10using namespace openvpn;
11
12TEST(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}
CleanupType< F > Cleanup(F method) noexcept
Definition cleanup.hpp:43
TEST(misc, cleanup)