0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-19 19:52:15 +02:00
openvpn3/test/unittests/test_cleanup.cpp
David Sommerseth dde1574596
Reformatting source code to new coding style
This is the result after running 'clang-format -i' on all C++ files and
headers, with the defined formatting rules in .clang-format.

Only the openvpn/common/unicode-impl.hpp has been excluded, as that is
mostly a copy of an external project.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2023-01-18 19:24:15 +01:00

24 lines
569 B
C++

#include "test_common.h"
#include <iostream>
#include <memory>
#include <openvpn/common/size.hpp>
#include <openvpn/common/exception.hpp>
#include <openvpn/common/cleanup.hpp>
using namespace openvpn;
TEST(misc, cleanup)
{
bool ran_cleanup = false;
{
auto c = Cleanup([&]()
{ ran_cleanup = true; });
static_assert(std::is_nothrow_move_constructible<decltype(c)>::value,
"Cleanup should be noexcept MoveConstructible");
}
ASSERT_TRUE(ran_cleanup) << "cleanup didn't run as expected";
}