MCPcopy Create free account
hub / github.com/ElementsProject/elements / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

src/test/raii_event_tests.cpp:38–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38BOOST_AUTO_TEST_CASE(raii_event_creation)
39{
40 event_set_mem_functions(tag_malloc, realloc, tag_free);
41
42 void* base_ptr = nullptr;
43 {
44 auto base = obtain_event_base();
45 base_ptr = (void*)base.get();
46 BOOST_CHECK(tags[base_ptr] == 1);
47 }
48 BOOST_CHECK(tags[base_ptr] == 0);
49
50 void* event_ptr = nullptr;
51 {
52 auto base = obtain_event_base();
53 auto event = obtain_event(base.get(), -1, 0, nullptr, nullptr);
54
55 base_ptr = (void*)base.get();
56 event_ptr = (void*)event.get();
57
58 BOOST_CHECK(tags[base_ptr] == 1);
59 BOOST_CHECK(tags[event_ptr] == 1);
60 }
61 BOOST_CHECK(tags[base_ptr] == 0);
62 BOOST_CHECK(tags[event_ptr] == 0);
63
64 event_set_mem_functions(malloc, realloc, free);
65}
66
67BOOST_AUTO_TEST_CASE(raii_event_order)
68{

Callers

nothing calls this directly

Calls 3

obtain_event_baseFunction · 0.85
obtain_eventFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected