Changeset View
Changeset View
Standalone View
Standalone View
src/test/raii_event_tests.cpp
// Copyright (c) 2016 The Bitcoin Core developers | // Copyright (c) 2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <event2/event.h> | #include <event2/event.h> | ||||
#ifdef EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED | #ifdef EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED | ||||
// It would probably be ideal to define dummy test(s) that report skipped, but | // It would probably be ideal to define dummy test(s) that report skipped, but | ||||
// boost::test doesn't seem to make that practical (at least not in versions | // boost::test doesn't seem to make that practical (at least not in versions | ||||
// available with common distros) | // available with common distros) | ||||
#include <cstdlib> | #include <support/events.h> | ||||
#include <map> | |||||
#include "support/events.h" | #include <test/test_bitcoin.h> | ||||
#include "test/test_bitcoin.h" | #include <boost/test/unit_test.hpp> | ||||
#include <cstdlib> | |||||
#include <map> | |||||
#include <vector> | #include <vector> | ||||
#include <boost/test/unit_test.hpp> | |||||
static std::map<void *, short> tags; | static std::map<void *, short> tags; | ||||
static std::map<void *, uint16_t> orders; | static std::map<void *, uint16_t> orders; | ||||
static uint16_t tagSequence = 0; | static uint16_t tagSequence = 0; | ||||
static void *tag_malloc(size_t sz) { | static void *tag_malloc(size_t sz) { | ||||
void *mem = malloc(sz); | void *mem = malloc(sz); | ||||
if (!mem) return mem; | if (!mem) return mem; | ||||
tags[mem]++; | tags[mem]++; | ||||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |