+/*
+ * 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.
/* 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();
typedef SBufFindTest::Placement Placement;
#endif
+