3939#include "util-validate.h"
4040#include "util-unittest.h"
4141#include "util-debug.h"
42+ #include "tmqh-packetpool.h"
4243
4344#define VXLAN_HEADER_LEN sizeof(VXLANHeader)
4445
@@ -249,6 +250,7 @@ static int DecodeVXLANtest01 (void)
249250 DecodeThreadVars dtv ;
250251 memset (& tv , 0 , sizeof (ThreadVars ));
251252 memset (& dtv , 0 , sizeof (DecodeThreadVars ));
253+ PacketPoolInit (& tv );
252254
253255 DecodeVXLANConfigPorts (VXLAN_DEFAULT_PORT_S );
254256 FlowInitConfig (FLOW_QUIET );
@@ -264,6 +266,7 @@ static int DecodeVXLANtest01 (void)
264266 FlowShutdown ();
265267 PacketFree (p );
266268 PacketFreeOrRelease (tp );
269+ PacketPoolDestroy (& tv );
267270 PASS ;
268271}
269272
@@ -288,6 +291,7 @@ static int DecodeVXLANtest02 (void)
288291 DecodeThreadVars dtv ;
289292 memset (& tv , 0 , sizeof (ThreadVars ));
290293 memset (& dtv , 0 , sizeof (DecodeThreadVars ));
294+ PacketPoolInit (& tv );
291295
292296 DecodeVXLANConfigPorts ("1" );
293297 FlowInitConfig (FLOW_QUIET );
@@ -299,6 +303,7 @@ static int DecodeVXLANtest02 (void)
299303 DecodeVXLANConfigPorts (VXLAN_DEFAULT_PORT_S ); /* reset */
300304 FlowShutdown ();
301305 PacketFree (p );
306+ PacketPoolDestroy (& tv );
302307 PASS ;
303308}
304309
@@ -342,6 +347,7 @@ decoder:\n\
342347 DecodeThreadVars dtv ;
343348 memset (& tv , 0 , sizeof (ThreadVars ));
344349 memset (& dtv , 0 , sizeof (DecodeThreadVars ));
350+ PacketPoolInit (& tv );
345351
346352 DecodeVXLANConfig ();
347353 DecodeVXLANConfigPorts (VXLAN_DEFAULT_PORT_S );
@@ -360,6 +366,7 @@ decoder:\n\
360366 PacketFreeOrRelease (tp );
361367 SCConfDeInit ();
362368 SCConfRestoreContextBackup ();
369+ PacketPoolDestroy (& tv );
363370 PASS ;
364371}
365372
@@ -399,6 +406,7 @@ decoder:\n\
399406 DecodeThreadVars dtv ;
400407 memset (& tv , 0 , sizeof (ThreadVars ));
401408 memset (& dtv , 0 , sizeof (DecodeThreadVars ));
409+ PacketPoolInit (& tv );
402410
403411 DecodeVXLANConfig ();
404412 DecodeVXLANConfigPorts (VXLAN_DEFAULT_PORT_S );
@@ -417,6 +425,7 @@ decoder:\n\
417425 PacketFreeOrRelease (tp );
418426 SCConfDeInit ();
419427 SCConfRestoreContextBackup ();
428+ PacketPoolDestroy (& tv );
420429 PASS ;
421430}
422431
@@ -457,6 +466,7 @@ decoder:\n\
457466 DecodeThreadVars dtv ;
458467 memset (& tv , 0 , sizeof (ThreadVars ));
459468 memset (& dtv , 0 , sizeof (DecodeThreadVars ));
469+ PacketPoolInit (& tv );
460470
461471 DecodeVXLANConfig ();
462472 DecodeVXLANConfigPorts (VXLAN_DEFAULT_PORT_S );
@@ -471,6 +481,7 @@ decoder:\n\
471481 PacketFree (p );
472482 SCConfDeInit ();
473483 SCConfRestoreContextBackup ();
484+ PacketPoolDestroy (& tv );
474485 PASS ;
475486}
476487
@@ -511,6 +522,7 @@ decoder:\n\
511522 DecodeThreadVars dtv ;
512523 memset (& tv , 0 , sizeof (ThreadVars ));
513524 memset (& dtv , 0 , sizeof (DecodeThreadVars ));
525+ PacketPoolInit (& tv );
514526
515527 DecodeVXLANConfig ();
516528 DecodeVXLANConfigPorts (VXLAN_DEFAULT_PORT_S );
@@ -529,6 +541,7 @@ decoder:\n\
529541 PacketFreeOrRelease (tp );
530542 SCConfDeInit ();
531543 SCConfRestoreContextBackup ();
544+ PacketPoolDestroy (& tv );
532545 PASS ;
533546}
534547
@@ -551,6 +564,7 @@ static int DecodeVXLANtest07(void)
551564 DecodeThreadVars dtv ;
552565 memset (& tv , 0 , sizeof (ThreadVars ));
553566 memset (& dtv , 0 , sizeof (DecodeThreadVars ));
567+ PacketPoolInit (& tv );
554568
555569 DecodeVXLANConfigPorts (VXLAN_DEFAULT_PORT_S );
556570 FlowInitConfig (FLOW_QUIET );
@@ -565,6 +579,7 @@ static int DecodeVXLANtest07(void)
565579
566580 FlowShutdown ();
567581 PacketFree (p );
582+ PacketPoolDestroy (& tv );
568583 PASS ;
569584}
570585#endif /* UNITTESTS */
0 commit comments