From: Modupe Falodun Date: Tue, 2 Nov 2021 21:18:51 +0000 (+0100) Subject: detect-rfb-secresult: convert unittest to FAIL/PASS APIs X-Git-Tag: suricata-7.0.0-beta1~1254 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6582%2Fhead;p=thirdparty%2Fsuricata.git detect-rfb-secresult: convert unittest to FAIL/PASS APIs Bug: #4055 --- diff --git a/src/detect-rfb-secresult.c b/src/detect-rfb-secresult.c index 4af974555a..f6e58ca751 100644 --- a/src/detect-rfb-secresult.c +++ b/src/detect-rfb-secresult.c @@ -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 * 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 /** * \test RfbSecresultTestParse01 is a test for a valid secresult value - * - * \retval 1 on succces - * \retval 0 on failure */ static int RfbSecresultTestParse01 (void) { - DetectRfbSecresultData *de = NULL; - de = DetectRfbSecresultParse("fail"); - if (de) { - DetectRfbSecresultFree(NULL, de); - return 1; - } + DetectRfbSecresultData *de = DetectRfbSecresultParse("fail"); - return 0; + FAIL_IF_NULL(de); + + DetectRfbSecresultFree(NULL, de); + + PASS; } /** * \test RfbSecresultTestParse02 is a test for an invalid secresult value - * - * \retval 1 on succces - * \retval 0 on failure */ static int RfbSecresultTestParse02 (void) { - DetectRfbSecresultData *de = NULL; - de = DetectRfbSecresultParse("invalidopt"); - if (de) { - DetectRfbSecresultFree(NULL, de); - return 0; - } + DetectRfbSecresultData *de = DetectRfbSecresultParse("invalidopt"); + + FAIL_IF_NOT_NULL(de); - return 1; + PASS; } /**