#include <fc/scoped_exit.hpp>
#include <boost/test/included/unit_test.hpp>
Go to the source code of this file.
◆ BOOST_TEST_MODULE
◆ BOOST_AUTO_TEST_CASE() [1/4]
BOOST_AUTO_TEST_CASE |
( |
cancel | | ) |
|
Definition at line 20 of file test_scoped_exit.cpp.
20 {
21 bool result = false;
22 {
24 BOOST_TEST(result == false);
25 g1.cancel();
26 }
27 BOOST_TEST(result == false);
28}
scoped_exit< Callback > make_scoped_exit(Callback &&c)
◆ BOOST_AUTO_TEST_CASE() [2/4]
BOOST_AUTO_TEST_CASE |
( |
scoped_exit_test | | ) |
|
Definition at line 10 of file test_scoped_exit.cpp.
11{
12 bool result = false;
13 {
15 BOOST_TEST(result == false);
16 }
17 BOOST_TEST(result == true);
18}
◆ BOOST_AUTO_TEST_CASE() [3/4]
BOOST_AUTO_TEST_CASE |
( |
test_forward | | ) |
|
◆ BOOST_AUTO_TEST_CASE() [4/4]
BOOST_AUTO_TEST_CASE |
( |
test_move | | ) |
|
Definition at line 30 of file test_scoped_exit.cpp.
30 {
31 bool result = false;
32 {
34 BOOST_TEST(result == false);
35 {
36 auto g2 = std::move(g1);
37 BOOST_TEST(result == false);
38 }
39 BOOST_TEST(result == true);
40 result = false;
41 }
42 BOOST_TEST(result == false);
43}