]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
htp: minor UNITTESTS guarding cleanup
authorVictor Julien <victor@inliniac.net>
Tue, 21 Jul 2020 09:45:45 +0000 (11:45 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 24 Jul 2020 08:13:40 +0000 (10:13 +0200)
src/app-layer-htp.c
src/app-layer-htp.h

index 280cb72b841d0f32e78425c1c33308aa58789c1c..9d8e163d87ec315451888b65fb8957c23e689a89 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2013 Open Information Security Foundation
+/* Copyright (C) 2007-2020 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
@@ -212,6 +212,9 @@ static void *HTPStateGetTx(void *alstate, uint64_t tx_id);
 static int HTPStateGetAlstateProgress(void *tx, uint8_t direction);
 static uint64_t HTPStateGetTxCnt(void *alstate);
 static int HTPStateGetAlstateProgressCompletionStatus(uint8_t direction);
+#ifdef UNITTESTS
+static void HTPParserRegisterTests(void);
+#endif
 
 static inline uint64_t HtpGetActiveRequestTxID(HtpState *s)
 {
@@ -7386,14 +7389,12 @@ static int HTPParserTest27(void)
 
     PASS;
 }
-#endif /* UNITTESTS */
 
 /**
  *  \brief  Register the Unit tests for the HTTP protocol
  */
-void HTPParserRegisterTests(void)
+static void HTPParserRegisterTests(void)
 {
-#ifdef UNITTESTS
     UtRegisterTest("HTPParserTest01", HTPParserTest01);
     UtRegisterTest("HTPParserTest01a", HTPParserTest01a);
     UtRegisterTest("HTPParserTest01b", HTPParserTest01b);
@@ -7448,8 +7449,8 @@ void HTPParserRegisterTests(void)
 
     HTPFileParserRegisterTests();
     HTPXFFParserRegisterTests();
-#endif /* UNITTESTS */
 }
+#endif /* UNITTESTS */
 
 /**
  * @}
index 6be50fda38e745f285e684c4e982937559186c0c..72acc41d3adb7edd2474b2b46c219df2fd388ce8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2011 Open Information Security Foundation
+/* Copyright (C) 2007-2020 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
@@ -271,7 +271,6 @@ typedef struct HtpState_ {
 SC_ATOMIC_EXTERN(uint32_t, htp_config_flags);
 
 void RegisterHTPParsers(void);
-void HTPParserRegisterTests(void);
 void HTPAtExitPrintStats(void);
 void HTPFreeConfig(void);