From: Russ Combs (rucombs) Date: Tue, 24 Jan 2023 14:29:09 +0000 (+0000) Subject: Pull request #3738: memory: fix unit test build w/o reg test X-Git-Tag: 3.1.53.0~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5042243d1c1796b703faa8616ed9158423ad6bf4;p=thirdparty%2Fsnort3.git Pull request #3738: memory: fix unit test build w/o reg test Merge in SNORT/snort3 from ~RUCOMBS/snort3:mem_test to master Squashed commit of the following: commit 7d7cf735582105210f4d51918b0f83dfadec99cf Author: Russ Combs Date: Thu Jan 19 00:04:03 2023 -0500 memory: fix unit test build w/o reg test --- diff --git a/src/memory/memory_cap.cc b/src/memory/memory_cap.cc index d3fcf37e8..368e201e2 100644 --- a/src/memory/memory_cap.cc +++ b/src/memory/memory_cap.cc @@ -116,7 +116,9 @@ static void test_pkt_check() epoch_check(nullptr); } +#endif +#if defined(REG_TEST) || defined(UNIT_TEST) void MemoryCap::test_main_check() { assert(in_main_thread()); diff --git a/src/memory/memory_cap.h b/src/memory/memory_cap.h index bf4d6f8cb..f3775729f 100644 --- a/src/memory/memory_cap.h +++ b/src/memory/memory_cap.h @@ -76,7 +76,7 @@ public: // main thread - shutdown static void update_pegs(PegCount*); -#ifdef REG_TEST +#if defined(REG_TEST) || defined(UNIT_TEST) static void test_main_check(); #endif }; diff --git a/src/memory/test/memory_cap_test.cc b/src/memory/test/memory_cap_test.cc index 65de58f94..0daeb83af 100644 --- a/src/memory/test/memory_cap_test.cc +++ b/src/memory/test/memory_cap_test.cc @@ -61,6 +61,8 @@ unsigned get_instance_id() THREAD_LOCAL const Trace* memory_trace = nullptr; +void Periodic::register_handler(PeriodicHook, void*, uint16_t, uint32_t) { } + //-------------------------------------------------------------------------- // mocks //--------------------------------------------------------------------------