Skip to content

event_set_mem_functions is not available on all libevents #9493

@luke-jr

Description

@luke-jr

#9387 added a new test that uses libevent's event_set_mem_functions which is sometimes not included with libevent. In particular, Gentoo only enables this when libevent is installed with the "debug" option.

Currently, this causes the build to simply fail on tests:

test/raii_event_tests.cpp: In member function ‘void raii_event_tests::raii_event_creation::test_method()’:
test/raii_event_tests.cpp:39:58: error: ‘event_set_mem_functions’ was not declared in this scope
     event_set_mem_functions(tag_malloc, realloc, tag_free);
                                                          ^
test/raii_event_tests.cpp: In member function ‘void raii_event_tests::raii_event_order::test_method()’:
test/raii_event_tests.cpp:68:58: error: ‘event_set_mem_functions’ was not declared in this scope
     event_set_mem_functions(tag_malloc, realloc, tag_free);
                                                          ^
Makefile:8355: recipe for target 'test/test_test_bitcoin-raii_event_tests.o' failed

Probably we should skip this test if libevent doesn't support overriding memory functions.

(event.h defines EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED if it is available.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions