From: Eric Leblond Date: Wed, 30 Jul 2014 15:17:51 +0000 (+0200) Subject: suricata: RunUnittests now return void X-Git-Tag: suricata-2.1beta1~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fe82a83e7966e3577c7fc205340c4e6046cf476b;p=thirdparty%2Fsuricata.git suricata: RunUnittests now return void RunUnittests function is now a terminal function (calling exit before leaving). --- diff --git a/src/runmode-unittests.c b/src/runmode-unittests.c index 838924e860..ef808f24e1 100644 --- a/src/runmode-unittests.c +++ b/src/runmode-unittests.c @@ -118,7 +118,16 @@ void RegisterAllModules(); void TmqhSetup (void); -int RunUnittests(int list_unittests, char *regex_arg) +/** + * Run or list unittests + * + * \param list_unittests If set to 1, list unittests. Run them if set to 0. + * \param regex_arg A regular expression to select unittests to run + * + * This function is terminal and will call exit after being called. + */ + +void RunUnittests(int list_unittests, char *regex_arg) { #ifdef UNITTESTS /* Initializations for global vars, queues, etc (memsets, mutex init..) */ diff --git a/src/suricata.c b/src/suricata.c index 5f96ac410a..db130392b2 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -1821,13 +1821,7 @@ int StartInternalRunMode(SCInstance *suri, int argc, char **argv) RunModeListRunmodes(); return TM_ECODE_DONE; case RUNMODE_LIST_UNITTEST: - { - int ret = RunUnittests(1, suri->regex_arg); - if (ret == TM_ECODE_OK) - return TM_ECODE_DONE; - else - return ret; - } + RunUnittests(1, suri->regex_arg); #ifdef OS_WIN32 case RUNMODE_INSTALL_SERVICE: if (SCServiceInstall(argc, argv)) { @@ -2159,7 +2153,7 @@ int main(int argc, char **argv) } if (suri.run_mode == RUNMODE_UNITTEST) - return RunUnittests(0, suri.regex_arg); + RunUnittests(0, suri.regex_arg); #ifdef __SC_CUDA_SUPPORT__ /* Init the CUDA environment */