unittests: use a global packetpool

pull/1608/head
Victor Julien 10 years ago
parent 99c0a7ad72
commit e44fd97d72

@ -1949,7 +1949,6 @@ error:
*/
void Unified2RegisterTests(void)
{
PacketPoolInit();
#ifdef UNITTESTS
UtRegisterTest("Unified2Test01 -- Ipv4 test", Unified2Test01, 1);
UtRegisterTest("Unified2Test02 -- Ipv6 test", Unified2Test02, 1);

@ -1228,10 +1228,7 @@ static int FlowMgrTest04 (void)
static int FlowMgrTest05 (void)
{
int result = 0;
extern intmax_t max_pending_packets;
max_pending_packets = 128;
PacketPoolInit();
FlowInitConfig(FLOW_QUIET);
FlowConfig backup;
memcpy(&backup, &flow_config, sizeof(FlowConfig));
@ -1269,7 +1266,6 @@ static int FlowMgrTest05 (void)
memcpy(&flow_config, &backup, sizeof(FlowConfig));
FlowShutdown();
PacketPoolDestroy();
return result;
}
#endif /* UNITTESTS */

@ -280,7 +280,13 @@ void RunUnittests(int list_unittests, char *regex_arg)
if (list_unittests) {
UtListTests(regex_arg);
} else {
/* global packet pool */
extern intmax_t max_pending_packets;
max_pending_packets = 128;
PacketPoolInit();
uint32_t failed = UtRunTests(regex_arg);
PacketPoolDestroy();
UtCleanup();
#ifdef __SC_CUDA_SUPPORT__
if (PatternMatchDefaultMatcher() == MPM_AC_CUDA)

Loading…
Cancel
Save