aboutsummaryrefslogtreecommitdiff
path: root/src/test/raii_event_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/raii_event_tests.cpp')
-rw-r--r--src/test/raii_event_tests.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/test/raii_event_tests.cpp b/src/test/raii_event_tests.cpp
index 6f03ad6fed..8c2712f764 100644
--- a/src/test/raii_event_tests.cpp
+++ b/src/test/raii_event_tests.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016 The Bitcoin Core developers
+// Copyright (c) 2016-2019 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -7,11 +7,9 @@
#include <map>
#include <stdlib.h>
-#include "support/events.h"
+#include <support/events.h>
-#include "test/test_bitcoin.h"
-
-#include <vector>
+#include <test/util/setup_common.h>
#include <boost/test/unit_test.hpp>
@@ -40,19 +38,19 @@ static void tag_free(void* mem) {
BOOST_AUTO_TEST_CASE(raii_event_creation)
{
event_set_mem_functions(tag_malloc, realloc, tag_free);
-
- void* base_ptr = NULL;
+
+ void* base_ptr = nullptr;
{
auto base = obtain_event_base();
base_ptr = (void*)base.get();
BOOST_CHECK(tags[base_ptr] == 1);
}
BOOST_CHECK(tags[base_ptr] == 0);
-
- void* event_ptr = NULL;
+
+ void* event_ptr = nullptr;
{
auto base = obtain_event_base();
- auto event = obtain_event(base.get(), -1, 0, NULL, NULL);
+ auto event = obtain_event(base.get(), -1, 0, nullptr, nullptr);
base_ptr = (void*)base.get();
event_ptr = (void*)event.get();
@@ -62,19 +60,19 @@ BOOST_AUTO_TEST_CASE(raii_event_creation)
}
BOOST_CHECK(tags[base_ptr] == 0);
BOOST_CHECK(tags[event_ptr] == 0);
-
+
event_set_mem_functions(malloc, realloc, free);
}
BOOST_AUTO_TEST_CASE(raii_event_order)
{
event_set_mem_functions(tag_malloc, realloc, tag_free);
-
- void* base_ptr = NULL;
- void* event_ptr = NULL;
+
+ void* base_ptr = nullptr;
+ void* event_ptr = nullptr;
{
auto base = obtain_event_base();
- auto event = obtain_event(base.get(), -1, 0, NULL, NULL);
+ auto event = obtain_event(base.get(), -1, 0, nullptr, nullptr);
base_ptr = (void*)base.get();
event_ptr = (void*)event.get();