Skip to content

Commit 091cc4b

Browse files
author
MarcoFalke
committed
Merge #16564: test: Always define the raii_event_tests test suite
9a19c9a Always define the raii_event_tests test suite (Craig Andrews) Pull request description: The test suite must always be defined (even when EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED is not defined) so that the test harness doesn't fail due to not being able to find the raii_event_tests test. This improves upon 95f97f4 actually fixing bitcoin/bitcoin#9493 ACKs for top commit: MarcoFalke: ACK 9a19c9a 🎹 Tree-SHA512: 3c42f17a9b5d56c8841f3aa9ac19da91c10aff210026266f31f7eb98a62528740d7c518c121452b68e8f801d6c80ecfb627d137ec6ed533289fa3beb08b4f176
2 parents dec067f + 9a19c9a commit 091cc4b

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/test/raii_event_tests.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
#include <event2/event.h>
66

7-
#ifdef EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
8-
// 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 available with common distros)
9-
107
#include <map>
118
#include <stdlib.h>
129

@@ -16,6 +13,10 @@
1613

1714
#include <boost/test/unit_test.hpp>
1815

16+
BOOST_FIXTURE_TEST_SUITE(raii_event_tests, BasicTestingSetup)
17+
18+
#ifdef EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
19+
1920
static std::map<void*, short> tags;
2021
static std::map<void*, uint16_t> orders;
2122
static uint16_t tagSequence = 0;
@@ -34,8 +35,6 @@ static void tag_free(void* mem) {
3435
free(mem);
3536
}
3637

37-
BOOST_FIXTURE_TEST_SUITE(raii_event_tests, BasicTestingSetup)
38-
3938
BOOST_AUTO_TEST_CASE(raii_event_creation)
4039
{
4140
event_set_mem_functions(tag_malloc, realloc, tag_free);
@@ -87,6 +86,14 @@ BOOST_AUTO_TEST_CASE(raii_event_order)
8786
event_set_mem_functions(malloc, realloc, free);
8887
}
8988

90-
BOOST_AUTO_TEST_SUITE_END()
89+
#else
90+
91+
BOOST_AUTO_TEST_CASE(raii_event_tests_SKIPPED)
92+
{
93+
// It would probably be ideal to report skipped, but boost::test doesn't seem to make that practical (at least not in versions available with common distros)
94+
BOOST_TEST_MESSAGE("Skipping raii_event_tess: libevent doesn't support event_set_mem_functions");
95+
}
9196

9297
#endif // EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
98+
99+
BOOST_AUTO_TEST_SUITE_END()

0 commit comments

Comments
 (0)