diff --git a/src/runmode-unittests.c b/src/runmode-unittests.c index 69a37788b8..ffa82ef5aa 100644 --- a/src/runmode-unittests.c +++ b/src/runmode-unittests.c @@ -254,6 +254,11 @@ void RunUnittests(int list_unittests, const char *regex_arg) TagInitCtx(); + /* test and initialize the unit testing subsystem */ + if (regex_arg == NULL) { + regex_arg = ".*"; + UtRunSelftest(regex_arg); /* inits and cleans up again */ + } UtInitialize(); RegisterAllModules(); @@ -261,11 +266,6 @@ void RunUnittests(int list_unittests, const char *regex_arg) HostBitInitCtx(); StorageFinalize(); - /* test and initialize the unit testing subsystem */ - if (regex_arg == NULL){ - regex_arg = ".*"; - UtRunSelftest(regex_arg); /* inits and cleans up again */ - } AppLayerHtpEnableRequestBodyCallback(); AppLayerHtpNeedFileInspection();