From d32aa2cdb5c013206eed0e7442f38f8381ea67a1 Mon Sep 17 00:00:00 2001 From: Russ Combs Date: Wed, 14 Sep 2016 17:27:40 -0400 Subject: [PATCH] disable cpputest leak checks with hyperscan unit tests to avoid crashes or hangs in cpputest --- src/ips_options/test/ips_regex_test.cc | 6 ++++++ src/search_engines/test/hyperscan_test.cc | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/ips_options/test/ips_regex_test.cc b/src/ips_options/test/ips_regex_test.cc index d72b848ee..0fc3256b7 100644 --- a/src/ips_options/test/ips_regex_test.cc +++ b/src/ips_options/test/ips_regex_test.cc @@ -259,6 +259,8 @@ TEST_GROUP(ips_regex_option) void setup() { + // FIXIT-L cpputest hangs or crashes in the leak detector + MemoryLeakWarningPlugin::turnOffNewDeleteOverloads(); opt = get_option(" foo "); regex_setup(snort_conf); } @@ -268,6 +270,7 @@ TEST_GROUP(ips_regex_option) api->dtor(opt); regex_cleanup(snort_conf); api->pterm(snort_conf); + MemoryLeakWarningPlugin::turnOnNewDeleteOverloads(); } }; @@ -330,6 +333,8 @@ TEST_GROUP(ips_regex_option_relative) void setup() { + // FIXIT-L cpputest hangs or crashes in the leak detector + MemoryLeakWarningPlugin::turnOffNewDeleteOverloads(); opt = get_option("\\bfoo", true); regex_setup(snort_conf); } @@ -338,6 +343,7 @@ TEST_GROUP(ips_regex_option_relative) IpsApi* api = (IpsApi*)ips_regex; api->dtor(opt); regex_cleanup(snort_conf); + MemoryLeakWarningPlugin::turnOnNewDeleteOverloads(); } }; diff --git a/src/search_engines/test/hyperscan_test.cc b/src/search_engines/test/hyperscan_test.cc index 1f14bac0d..4fc30369c 100644 --- a/src/search_engines/test/hyperscan_test.cc +++ b/src/search_engines/test/hyperscan_test.cc @@ -180,6 +180,8 @@ TEST_GROUP(mpse_hs_match) void setup() { + // FIXIT-L cpputest hangs or crashes in the leak detector + MemoryLeakWarningPlugin::turnOffNewDeleteOverloads(); CHECK(se_hyperscan); hs = mpse_api->ctor(snort_conf, nullptr, false, &s_agent); CHECK(hs); @@ -190,6 +192,7 @@ TEST_GROUP(mpse_hs_match) { mpse_api->dtor(hs); hyperscan_cleanup(snort_conf); + MemoryLeakWarningPlugin::turnOnNewDeleteOverloads(); } }; @@ -304,6 +307,8 @@ TEST_GROUP(mpse_hs_multi) void setup() { + // FIXIT-L cpputest hangs or crashes in the leak detector + MemoryLeakWarningPlugin::turnOffNewDeleteOverloads(); CHECK(se_hyperscan); hs1 = mpse_api->ctor(snort_conf, nullptr, false, &s_agent); @@ -320,6 +325,7 @@ TEST_GROUP(mpse_hs_multi) mpse_api->dtor(hs1); mpse_api->dtor(hs2); hyperscan_cleanup(snort_conf); + MemoryLeakWarningPlugin::turnOnNewDeleteOverloads(); } }; -- 2.47.3