detect-rfb-secresult: convert unittest to FAIL/PASS APIs

Bug: #4055
pull/6582/head
Modupe Falodun 4 years ago committed by Victor Julien
parent e9779b0fa0
commit fac33118cc

@ -1,4 +1,4 @@
/* Copyright (C) 2020 Open Information Security Foundation /* Copyright (C) 2020-2021 Open Information Security Foundation
* *
* You can copy, redistribute or modify this Program under the terms of * You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free * the GNU General Public License version 2 as published by the Free
@ -262,38 +262,28 @@ void DetectRfbSecresultFree(DetectEngineCtx *de_ctx, void *de_ptr)
#ifdef UNITTESTS #ifdef UNITTESTS
/** /**
* \test RfbSecresultTestParse01 is a test for a valid secresult value * \test RfbSecresultTestParse01 is a test for a valid secresult value
*
* \retval 1 on succces
* \retval 0 on failure
*/ */
static int RfbSecresultTestParse01 (void) static int RfbSecresultTestParse01 (void)
{ {
DetectRfbSecresultData *de = NULL; DetectRfbSecresultData *de = DetectRfbSecresultParse("fail");
de = DetectRfbSecresultParse("fail");
if (de) {
DetectRfbSecresultFree(NULL, de);
return 1;
}
return 0; FAIL_IF_NULL(de);
DetectRfbSecresultFree(NULL, de);
PASS;
} }
/** /**
* \test RfbSecresultTestParse02 is a test for an invalid secresult value * \test RfbSecresultTestParse02 is a test for an invalid secresult value
*
* \retval 1 on succces
* \retval 0 on failure
*/ */
static int RfbSecresultTestParse02 (void) static int RfbSecresultTestParse02 (void)
{ {
DetectRfbSecresultData *de = NULL; DetectRfbSecresultData *de = DetectRfbSecresultParse("invalidopt");
de = DetectRfbSecresultParse("invalidopt");
if (de) { FAIL_IF_NOT_NULL(de);
DetectRfbSecresultFree(NULL, de);
return 0;
}
return 1; PASS;
} }
/** /**

Loading…
Cancel
Save