unittests (assorted): remove PASS_IF macro

Also small documentation clean up and test adjusments where that
was needed.

affected: counters, decode-vntag, detect-mark

Related to #4795
pull/6581/head
Juliana Fajardini 3 years ago committed by Victor Julien
parent c6e97222b7
commit b3743cf5c0

@ -1,4 +1,4 @@
/* Copyright (C) 2007-2015 Open Information Security Foundation
/* Copyright (C) 2007-2021 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
@ -1406,7 +1406,6 @@ static int StatsTestCntArraySize07(void)
{
ThreadVars tv;
StatsPrivateThreadContext *pca = NULL;
int result;
memset(&tv, 0, sizeof(ThreadVars));
@ -1421,12 +1420,12 @@ static int StatsTestCntArraySize07(void)
StatsIncr(&tv, 1);
StatsIncr(&tv, 2);
result = pca->size;
FAIL_IF_NOT(pca->size == 2);
StatsReleaseCounters(tv.perf_public_ctx.head);
StatsReleasePrivateThreadContext(pca);
PASS_IF(result == 2);
PASS;
}
static int StatsTestUpdateCounter08(void)

@ -93,8 +93,6 @@ int DecodeVNTag(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t
/**
* \test DecodeVNTagTest01 test if vntag header is too small.
*
* \retval 1 on success
* \retval 0 on failure
*/
static int DecodeVNTagtest01(void)
{
@ -110,14 +108,13 @@ static int DecodeVNTagtest01(void)
FAIL_IF(TM_ECODE_OK == DecodeVNTag(&tv, &dtv, p, raw_vntag, sizeof(raw_vntag)));
PASS_IF(ENGINE_ISSET_EVENT(p, VNTAG_HEADER_TOO_SMALL));
FAIL_IF_NOT(ENGINE_ISSET_EVENT(p, VNTAG_HEADER_TOO_SMALL));
PASS;
}
/**
* \test DecodeVNTagt02 test if vntag header has unknown type.
*
* \retval 1 on success
* \retval 0 on failure
*/
static int DecodeVNTagtest02(void)
{
@ -138,14 +135,13 @@ static int DecodeVNTagtest02(void)
memset(&tv, 0, sizeof(ThreadVars));
memset(&dtv, 0, sizeof(DecodeThreadVars));
PASS_IF(TM_ECODE_OK != DecodeVNTag(&tv, &dtv, p, raw_vntag, sizeof(raw_vntag)));
FAIL_IF_NOT(TM_ECODE_OK != DecodeVNTag(&tv, &dtv, p, raw_vntag, sizeof(raw_vntag)));
PASS;
}
/**
* \test DecodeVNTagTest03 test a good vntag header.
*
* \retval 1 on success
* \retval 0 on failure
*/
static int DecodeVNTagtest03(void)
{

@ -1,4 +1,4 @@
/* Copyright (C) 2011-2020 Open Information Security Foundation
/* Copyright (C) 2011-2021 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
@ -276,10 +276,10 @@ static int MarkTestParse02 (void)
data = DetectMarkParse("4");
PASS_IF(data == NULL);
FAIL_IF_NOT_NULL(data);
DetectMarkDataFree(NULL, data);
FAIL;
PASS;
}
/**
@ -308,10 +308,10 @@ static int MarkTestParse04 (void)
data = DetectMarkParse("0x1g/0xff");
PASS_IF(data == NULL);
FAIL_IF_NOT_NULL(data);
DetectMarkDataFree(NULL, data);
FAIL;
PASS;
}
/**

Loading…
Cancel
Save