unittests: clean up memory for hostbit tests

pull/14025/head
Victor Julien 10 months ago committed by Victor Julien
parent 43347e3d3d
commit 09289edf04

@ -458,6 +458,7 @@ void DetectHostbitFree (DetectEngineCtx *de_ctx, void *ptr)
static void HostBitsTestSetup(void)
{
StorageCleanup();
StorageInit();
HostBitInitCtx();
StorageFinalize();
@ -466,7 +467,7 @@ static void HostBitsTestSetup(void)
static void HostBitsTestShutdown(void)
{
HostCleanup();
HostShutdown();
StorageCleanup();
}
@ -591,10 +592,11 @@ static int HostBitsTestSig01(void)
SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
PacketFree(p);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
PacketFree(p);
HostBitsTestShutdown();
StatsThreadCleanup(&th_v);
PASS;
}
@ -695,11 +697,11 @@ static int HostBitsTestSig03(void)
SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
PacketFree(p);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
HostBitsTestShutdown();
SCFree(p);
StatsThreadCleanup(&th_v);
PASS;
}

@ -206,6 +206,11 @@ static int HostBitTest01 (void)
{
int ret = 0;
StorageCleanup();
StorageInit();
HostBitInitCtx();
StorageFinalize();
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
@ -219,7 +224,8 @@ static int HostBitTest01 (void)
HostFree(h);
end:
HostCleanup();
HostShutdown();
StorageCleanup();
return ret;
}
@ -227,6 +233,11 @@ static int HostBitTest02 (void)
{
int ret = 0;
StorageCleanup();
StorageInit();
HostBitInitCtx();
StorageFinalize();
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
@ -238,7 +249,8 @@ static int HostBitTest02 (void)
HostFree(h);
end:
HostCleanup();
HostShutdown();
StorageCleanup();
return ret;
}
@ -246,6 +258,11 @@ static int HostBitTest03 (void)
{
int ret = 0;
StorageCleanup();
StorageInit();
HostBitInitCtx();
StorageFinalize();
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
@ -271,7 +288,8 @@ static int HostBitTest03 (void)
HostFree(h);
end:
HostCleanup();
HostShutdown();
StorageCleanup();
return ret;
}
@ -279,6 +297,11 @@ static int HostBitTest04 (void)
{
int ret = 0;
StorageCleanup();
StorageInit();
HostBitInitCtx();
StorageFinalize();
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
@ -295,7 +318,8 @@ static int HostBitTest04 (void)
HostFree(h);
end:
HostCleanup();
HostShutdown();
StorageCleanup();
return ret;
}
@ -303,6 +327,11 @@ static int HostBitTest05 (void)
{
int ret = 0;
StorageCleanup();
StorageInit();
HostBitInitCtx();
StorageFinalize();
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
@ -319,7 +348,8 @@ static int HostBitTest05 (void)
HostFree(h);
end:
HostCleanup();
HostShutdown();
StorageCleanup();
return ret;
}
@ -327,6 +357,11 @@ static int HostBitTest06 (void)
{
int ret = 0;
StorageCleanup();
StorageInit();
HostBitInitCtx();
StorageFinalize();
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
@ -343,7 +378,8 @@ static int HostBitTest06 (void)
HostFree(h);
end:
HostCleanup();
HostShutdown();
StorageCleanup();
return ret;
}
@ -351,6 +387,11 @@ static int HostBitTest07 (void)
{
int ret = 0;
StorageCleanup();
StorageInit();
HostBitInitCtx();
StorageFinalize();
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
@ -367,7 +408,8 @@ static int HostBitTest07 (void)
HostFree(h);
end:
HostCleanup();
HostShutdown();
StorageCleanup();
return ret;
}
@ -375,6 +417,11 @@ static int HostBitTest08 (void)
{
int ret = 0;
StorageCleanup();
StorageInit();
HostBitInitCtx();
StorageFinalize();
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
@ -400,7 +447,8 @@ static int HostBitTest08 (void)
ret = 1;
HostFree(h);
end:
HostCleanup();
HostShutdown();
StorageCleanup();
return ret;
}
@ -408,6 +456,11 @@ static int HostBitTest09 (void)
{
int ret = 0;
StorageCleanup();
StorageInit();
HostBitInitCtx();
StorageFinalize();
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
@ -433,7 +486,8 @@ static int HostBitTest09 (void)
ret = 1;
HostFree(h);
end:
HostCleanup();
HostShutdown();
StorageCleanup();
return ret;
}
@ -441,6 +495,11 @@ static int HostBitTest10 (void)
{
int ret = 0;
StorageCleanup();
StorageInit();
HostBitInitCtx();
StorageFinalize();
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
@ -466,7 +525,8 @@ static int HostBitTest10 (void)
ret = 1;
HostFree(h);
end:
HostCleanup();
HostShutdown();
StorageCleanup();
return ret;
}
@ -474,6 +534,11 @@ static int HostBitTest11 (void)
{
int ret = 0;
StorageCleanup();
StorageInit();
HostBitInitCtx();
StorageFinalize();
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
@ -499,7 +564,8 @@ static int HostBitTest11 (void)
ret = 1;
HostFree(h);
end:
HostCleanup();
HostShutdown();
StorageCleanup();
return ret;
}

Loading…
Cancel
Save