flow: fix unittests for ThreadVars requirement

pull/13183/head
Victor Julien 6 months ago committed by Victor Julien
parent c648abad0d
commit ee59d9a894

@ -658,7 +658,7 @@ static void FlowExceptionPolicyStatsIncr(
ThreadVars *tv, FlowLookupStruct *fls, enum ExceptionPolicy policy)
{
#ifdef UNITTESTS
if (tv == NULL) {
if (tv == NULL || fls->dtv == NULL) {
return;
}
#endif

@ -860,6 +860,8 @@ uint32_t UTHBuildPacketOfFlows(uint32_t start, uint32_t end, uint8_t dir)
{
FlowLookupStruct fls;
memset(&fls, 0, sizeof(fls));
ThreadVars tv;
memset(&tv, 0, sizeof(tv));
uint32_t i = start;
uint8_t payload[] = "Payload";
@ -872,7 +874,7 @@ uint32_t UTHBuildPacketOfFlows(uint32_t start, uint32_t end, uint8_t dir)
p->src.addr_data32[0] = i + 1;
p->dst.addr_data32[0] = i;
}
FlowHandlePacket(NULL, &fls, p);
FlowHandlePacket(&tv, &fls, p);
if (p->flow != NULL) {
FLOWLOCK_UNLOCK(p->flow);
}

Loading…
Cancel
Save