]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/tests/SBufFindTest.h
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / tests / SBufFindTest.h
index bd65361258e6016dc9f2aa79d962e05d71f97f9e..2dec992b8114af477948843e32b46bded313f3f5 100644 (file)
@@ -1,12 +1,18 @@
+/*
+ * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 #ifndef SQUID_SRC_TEST_SBUFFINDTEST_H
 #define SQUID_SRC_TEST_SBUFFINDTEST_H
 
-#include "SBuf.h"
+#include "sbuf/SBuf.h"
 
-#if HAVE_STRING
-#include <string>
-#endif
 #include <set>
+#include <string>
 
 /// Generates and executes a [configurable] large number of SBuf::*find()
 /// test cases using random strings. Reports detected failures.
@@ -20,19 +26,19 @@ public:
     /* test configuration parameters; can be optionally set before run() */
     int caseLimit; ///< approximate caseCount limit
     int errorLimit; ///< errorCount limit
-    unsigned int randomSeed; ///< pseudo-random sequence choice
     /// whether to report only one failed test case per "category"
     bool hushSimilar;
     /// approximate maximum generated hay string length
-    SBuf::size_type maxHayLength; 
+    SBuf::size_type maxHayLength;
 
     /// Supported algorithms for placing needle in the hay.
     typedef enum { placeBeginning, placeMiddle, placeEnd, placeNowhere,
-        placeEof } Placement; // placeLast marker must terminate
+                   placeEof
+                 } Placement; // placeLast marker must terminate
 protected:
 
     static SBuf RandomSBuf(const int length);
-    void nextLen(int &len, const int max);
+    void nextLen(SBuf::size_type &len, const SBuf::size_type max);
     void placeNeedle(const SBuf &cleanHay);
 
     void testAllMethods();
@@ -84,3 +90,4 @@ private:
 typedef SBufFindTest::Placement Placement;
 
 #endif
+