From: Jeff Lucovsky Date: Sat, 24 Apr 2021 19:44:17 +0000 (-0400) Subject: tests/vntag: VNTAG decoder unittests X-Git-Tag: suricata-6.0.3~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11de7663ba060e3ec04680a3d40f1406a1266cdf;p=thirdparty%2Fsuricata.git tests/vntag: VNTAG decoder unittests (cherry picked from commit 596d7608333290d22ea6cee26a79eb4f9ca8605d) --- diff --git a/src/decode-vntag.c b/src/decode-vntag.c index b5bf235d9d..b7963238bb 100644 --- a/src/decode-vntag.c +++ b/src/decode-vntag.c @@ -100,8 +100,8 @@ static int DecodeVNTagtest01(void) { uint8_t raw_vntag[] = { 0x00, 0x20, 0x08 }; Packet *p = PacketGetFromAlloc(); - if (unlikely(p == NULL)) - return 0; + FAIL_IF_NULL(p); + ThreadVars tv; DecodeThreadVars dtv; diff --git a/src/decode.h b/src/decode.h index 15196aa3ff..136fbcb81a 100644 --- a/src/decode.h +++ b/src/decode.h @@ -93,6 +93,7 @@ enum PktSrcEnum { #include "decode-raw.h" #include "decode-null.h" #include "decode-vlan.h" +#include "decode-vntag.h" #include "decode-vxlan.h" #include "decode-mpls.h" diff --git a/src/runmode-unittests.c b/src/runmode-unittests.c index 7f458808cf..f996a90b2d 100644 --- a/src/runmode-unittests.c +++ b/src/runmode-unittests.c @@ -147,6 +147,7 @@ static void RegisterUnittests(void) DecodeCHDLCRegisterTests(); DecodePPPRegisterTests(); DecodeVLANRegisterTests(); + DecodeVNTagRegisterTests(); DecodeGeneveRegisterTests(); DecodeVXLANRegisterTests(); DecodeRawRegisterTests();