TESTS += testPreCompiler
testPreCompiler_SOURCES = \
- testPreCompiler.cc \
- testPreCompiler.h
+ testPreCompiler.cc
testPreCompiler_LDADD= $(LIBCPPUNIT_LIBS)
testPreCompiler_LDFLAGS=
*/
#include "squid.h"
-#include "testPreCompiler.h"
#include "unitTestMain.h"
#include <cassert>
+#include <cppunit/extensions/HelperMacros.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestPreCompiler );
+/*
+ * Test the pre-compiler directives used within Squid code actually work.
+ */
+
+class TestPreCompiler : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestPreCompiler);
+ CPPUNIT_TEST(testIfDef);
+ CPPUNIT_TEST(testIfDefAnd);
+ CPPUNIT_TEST(testIfDefOr);
+ CPPUNIT_TEST_SUITE_END();
+
+protected:
+ void testIfDef();
+ void testIfDefAnd();
+ void testIfDefOr();
+};
+CPPUNIT_TEST_SUITE_REGISTRATION(TestPreCompiler);
/**
* Test several ways of defining pre-compiler directives.
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_COMPAT_TESTS_TESTPRECOMPILER_H
-#define SQUID_COMPAT_TESTS_TESTPRECOMPILER_H
-
-#include <cppunit/extensions/HelperMacros.h>
-
-/*
- * Test the pre-compiler directives used within Squid code actually work.
- */
-
-class TestPreCompiler: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestPreCompiler );
- CPPUNIT_TEST( testIfDef );
- CPPUNIT_TEST( testIfDefAnd );
- CPPUNIT_TEST( testIfDefOr );
- CPPUNIT_TEST_SUITE_END();
-
-protected:
- void testIfDef();
- void testIfDefAnd();
- void testIfDefOr();
-};
-
-#endif /* SQUID_COMPAT_TESTS_TESTPRECOMPILER_H */
-
check_PROGRAMS += tests/testRFC1738
tests_testRFC1738_SOURCES = \
- tests/testRFC1738.cc \
- tests/testRFC1738.h
+ tests/testRFC1738.cc
tests_testRFC1738_LDADD= \
$(top_builddir)/lib/libmiscencoding.la \
*/
#include "squid.h"
-#include "testRFC1738.h"
#include "unitTestMain.h"
#include <cassert>
+#include <cppunit/extensions/HelperMacros.h>
/* Being a C library code it is best bodily included and tested with C++ type-safe techniques. */
#include "lib/rfc1738.c"
-CPPUNIT_TEST_SUITE_REGISTRATION( TestRfc1738 );
+/**
+ * Test the URL coder RFC 1738 Engine
+ */
+class TestRfc1738 : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestRfc1738);
+ CPPUNIT_TEST(testUrlDecode);
+ CPPUNIT_TEST(testUrlEncode);
+
+ CPPUNIT_TEST(PercentZeroNullDecoding);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+protected:
+ void testUrlDecode();
+ void testUrlEncode();
+
+ // bugs.
+ void PercentZeroNullDecoding();
+};
+CPPUNIT_TEST_SUITE_REGISTRATION(TestRfc1738);
/* Regular Format de-coding tests */
void TestRfc1738::testUrlDecode()
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_LIB_TEST_RFC1738_H
-#define SQUID_LIB_TEST_RFC1738_H
-
-#include <cppunit/extensions/HelperMacros.h>
-
-/**
- * Test the URL coder RFC 1738 Engine
- */
-class TestRfc1738: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestRfc1738 );
- CPPUNIT_TEST( testUrlDecode );
- CPPUNIT_TEST( testUrlEncode );
-
- CPPUNIT_TEST( PercentZeroNullDecoding );
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
-protected:
- void testUrlDecode();
- void testUrlEncode();
-
- // bugs.
- void PercentZeroNullDecoding();
-};
-
-#endif /* SQUID_LIB_TEST_RFC1738_H */
-
check_PROGRAMS += tests/testMem
tests_testMem_SOURCES = \
- tests/testMem.cc \
- tests/testMem.h
+ tests/testMem.cc
nodist_tests_testMem_SOURCES = \
tests/stub_libtime.cc
tests_testMem_LDADD = \
check_PROGRAMS += tests/testCharacterSet
tests_testCharacterSet_SOURCES = \
- tests/testCharacterSet.cc \
- tests/testCharacterSet.h
+ tests/testCharacterSet.cc
nodist_tests_testCharacterSet_SOURCES = \
base/CharacterSet.h
tests_testCharacterSet_LDADD = \
check_PROGRAMS += tests/testEnumIterator
tests_testEnumIterator_SOURCES = \
- tests/testEnumIterator.cc \
- tests/testEnumIterator.h
+ tests/testEnumIterator.cc
nodist_tests_testEnumIterator_SOURCES = \
base/EnumIterator.h
tests_testEnumIterator_LDADD = \
check_PROGRAMS += tests/testLookupTable
tests_testLookupTable_SOURCES = \
- tests/testLookupTable.cc \
- tests/testLookupTable.h
+ tests/testLookupTable.cc
nodist_tests_testLookupTable_SOURCES = \
base/LookupTable.h \
tests/stub_debug.cc \
check_PROGRAMS += tests/testRefCount
tests_testRefCount_SOURCES = \
- tests/testRefCount.cc \
- tests/testRefCount.h
+ tests/testRefCount.cc
nodist_tests_testRefCount_SOURCES = \
base/RefCount.h
tests_testRefCount_LDADD = \
check_PROGRAMS += tests/testYesNoNone
tests_testYesNoNone_SOURCES = \
- tests/testYesNoNone.cc \
- tests/testYesNoNone.h
+ tests/testYesNoNone.cc
nodist_tests_testYesNoNone_SOURCES = \
tests/stub_SBuf.cc \
base/YesNoNone.h \
check_PROGRAMS += tests/testURL
tests_testURL_SOURCES = \
tests/testURL.cc \
- tests/testURL.h \
- tests/testUriScheme.cc \
- tests/testUriScheme.h
+ tests/testUriScheme.cc
nodist_tests_testURL_SOURCES = \
tests/stub_HelperChildConfig.cc \
tests/stub_HttpHeader.cc \
check_PROGRAMS += tests/testDns
tests_testDns_SOURCES = \
- tests/testRFC1035.cc \
- tests/testRFC1035.h
+ tests/testRFC1035.cc
nodist_tests_testDns_SOURCES=
tests_testDns_LDADD = \
dns/libdns.la \
check_PROGRAMS += tests/testTokenizer
tests_testTokenizer_SOURCES = \
- tests/testTokenizer.cc \
- tests/testTokenizer.h
+ tests/testTokenizer.cc
nodist_tests_testTokenizer_SOURCES = \
tests/stub_StatHist.cc \
tests/stub_debug.cc \
check_PROGRAMS += tests/testSBuf
tests_testSBuf_SOURCES = \
tests/testSBuf.cc \
- tests/testSBuf.h \
tests/SBufFindTest.cc \
tests/SBufFindTest.h
nodist_tests_testSBuf_SOURCES = \
check_PROGRAMS += tests/testSBufList
tests_testSBufList_SOURCES = \
- tests/testSBufList.cc \
- tests/testSBufList.h
+ tests/testSBufList.cc
nodist_tests_testSBufList_SOURCES = \
tests/stub_StatHist.cc \
tests/stub_debug.cc \
check_PROGRAMS += tests/testString
tests_testString_SOURCES = \
- tests/testString.cc \
- tests/testString.h
+ tests/testString.cc
nodist_tests_testString_SOURCES = \
tests/stub_SBuf.cc \
String.cc \
ResolvedPeers.cc \
ResolvedPeers.h \
tests/testRock.cc \
- tests/testRock.h \
StatCounters.cc \
StatCounters.h \
tests/stub_StatHist.cc \
else
EXTRA_DIST += \
tests/testRock.cc \
- tests/testRock.h \
tests/testStoreSupport.cc \
tests/testStoreSupport.h
endif
Transients.cc \
tests/stub_UdsOp.cc \
tests/testUfs.cc \
- tests/testUfs.h \
tests/stub_access_log.cc \
tests/stub_cache_cf.cc \
cache_cf.h \
tests_testUfs_LDFLAGS = $(LIBADD_DL)
else
EXTRA_DIST += \
- tests/testUfs.cc \
- tests/testUfs.h
+ tests/testUfs.cc
endif
## Tests of store/* and Store objects
Notes.cc \
Notes.h \
tests/testPackableStream.cc \
- tests/testPackableStream.h \
Parsing.cc \
tests/stub_Port.cc \
RemovalPolicy.cc \
tests/testStore.cc \
tests/testStore.h \
tests/testStoreController.cc \
- tests/testStoreController.h \
StoreFileSystem.cc \
tests/testStoreHashIndex.cc \
- tests/testStoreHashIndex.h \
StoreIOState.cc \
tests/testStoreSupport.cc \
tests/testStoreSupport.h \
ConfigOption.cc \
ConfigParser.cc \
tests/testDiskIO.cc \
- tests/testDiskIO.h \
tests/stub_ETag.cc \
EventLoop.cc \
FadingCounter.cc \
if ENABLE_AUTH
check_PROGRAMS += tests/testACLMaxUserIP
tests_testACLMaxUserIP_SOURCES = \
- tests/testACLMaxUserIP.cc \
- tests/testACLMaxUserIP.h
+ tests/testACLMaxUserIP.cc
nodist_tests_testACLMaxUserIP_SOURCES = \
tests/stub_CachePeer.cc \
ConfigParser.cc \
tests_testACLMaxUserIP_LDFLAGS = $(LIBADD_DL)
else
EXTRA_DIST += \
- tests/testACLMaxUserIP.cc \
- tests/testACLMaxUserIP.h
+ tests/testACLMaxUserIP.cc
endif
## Tests of http/* and HTTP Protocol objects
tests_testHttp1Parser_SOURCES = \
tests/stub_HelperChildConfig.cc \
tests/testHttp1Parser.cc \
- tests/testHttp1Parser.h \
MemBuf.cc \
MemBuf.h \
tests/stub_MemObject.cc \
HttpReply.cc \
tests/testHttpReply.cc \
HttpReply.h \
- tests/testHttpReply.h \
tests/stub_HttpRequest.cc \
MasterXaction.cc \
MasterXaction.h \
HttpReply.cc \
HttpRequest.cc \
tests/testHttpRequest.cc \
- tests/testHttpRequest.h \
tests/testHttpRequestMethod.cc \
- tests/testHttpRequestMethod.h \
tests/stub_HttpUpgradeProtocolAccess.cc \
IoStats.h \
tests/stub_IpcIoFile.cc \
check_PROGRAMS += tests/testIpAddress
tests_testIpAddress_SOURCES = \
- tests/testIpAddress.cc \
- tests/testIpAddress.h
+ tests/testIpAddress.cc
nodist_tests_testIpAddress_SOURCES = \
tests/stub_SBuf.cc \
tests/stub_debug.cc \
check_PROGRAMS += tests/testIcmp
# icmp/libicmpcore.la is used by pinger so SHOULD NOT require more dependancies! :-(
tests_testIcmp_SOURCES = \
- tests/testIcmp.cc \
- tests/testIcmp.h
+ tests/testIcmp.cc
nodist_tests_testIcmp_SOURCES = \
tests/stub_SBuf.cc \
tests/stub_debug.cc \
check_PROGRAMS += tests/testNetDb
tests_testNetDb_SOURCES = \
- tests/testNetDb.cc \
- tests/testNetDb.h
+ tests/testNetDb.cc
nodist_tests_testNetDb_SOURCES = \
tests/stub_SBuf.cc \
tests/stub_debug.cc \
tests/stub_CacheDigest.cc \
CacheDigest.h \
tests/testCacheManager.cc \
- tests/testCacheManager.h \
CachePeer.cc \
CachePeer.h \
ClientInfo.h \
StatHist.cc \
tests/testStatHist.cc \
StatHist.h \
- tests/testStatHist.h \
String.cc \
tests/stub_cache_manager.cc \
tests/stub_cbdata.cc \
check_PROGRAMS += tests/testConfigParser
tests_testConfigParser_SOURCES = \
- tests/testConfigParser.cc \
- tests/testConfigParser.h
+ tests/testConfigParser.cc
nodist_tests_testConfigParser_SOURCES = \
ConfigParser.cc \
tests/stub_SBuf.cc \
check_PROGRAMS += tests/testEvent
tests_testEvent_SOURCES = \
- tests/testEvent.cc \
- tests/testEvent.h
+ tests/testEvent.cc
nodist_tests_testEvent_SOURCES = \
MemBuf.cc \
tests/stub_SBuf.cc \
check_PROGRAMS += tests/testEventLoop
tests_testEventLoop_SOURCES = \
- tests/testEventLoop.cc \
- tests/testEventLoop.h
+ tests/testEventLoop.cc
nodist_tests_testEventLoop_SOURCES = \
EventLoop.cc \
tests/stub_SBuf.cc \
#include "acl/Acl.h"
#include "auth/AclMaxUserIp.h"
#include "auth/UserRequest.h"
+#include "compat/cppunit.h"
#include "ConfigParser.h"
-#include "tests/testACLMaxUserIP.h"
#include "unitTestMain.h"
#include <stdexcept>
+/*
+ * demonstration test file, as new idioms are made they will
+ * be shown in the TestBoilerplate source.
+ */
+
+class TestACLMaxUserIP : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestACLMaxUserIP);
+ /* note the statement here and then the actual prototype below */
+ CPPUNIT_TEST(testDefaults);
+ CPPUNIT_TEST(testParseLine);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp() override;
+
+protected:
+ void testDefaults();
+ void testParseLine();
+};
CPPUNIT_TEST_SUITE_REGISTRATION( TestACLMaxUserIP );
/* globals required to resolve link issues */
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_ACLMAXUSERIP_H
-#define SQUID_SRC_TEST_ACLMAXUSERIP_H
-
-#if USE_AUTH
-
-#include "compat/cppunit.h"
-
-/*
- * demonstration test file, as new idioms are made they will
- * be shown in the TestBoilerplate source.
- */
-
-class TestACLMaxUserIP: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestACLMaxUserIP );
- /* note the statement here and then the actual prototype below */
- CPPUNIT_TEST( testDefaults );
- CPPUNIT_TEST( testParseLine );
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void setUp() override;
-
-protected:
- void testDefaults();
- void testParseLine();
-};
-
-#endif /* USE_AUTH */
-#endif /* SQUID_SRC_TEST_ACLMAXUSERIP_H */
-
/*
* demonstration test file, as new idioms are made they will
* be shown in the TestBoilerplate source.
+ *
+ * If a class declaration is only used in one source file, then declare
+ * that class where it is used instead of adding a dedicated header file.
*/
class TestBoilerplate: public CPPUNIT_NS::TestFixture
#include "squid.h"
#include "anyp/Uri.h"
#include "CacheManager.h"
+#include "compat/cppunit.h"
#include "mgr/Action.h"
#include "Store.h"
-#include "testCacheManager.h"
#include "unitTestMain.h"
#include <cppunit/TestAssert.h>
+/*
+ * test the CacheManager implementation
+ */
+
+class TestCacheManager : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestCacheManager);
+ CPPUNIT_TEST(testCreate);
+ CPPUNIT_TEST(testRegister);
+ CPPUNIT_TEST(testParseUrl);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp() override;
+
+protected:
+ void testCreate();
+ void testRegister();
+ void testParseUrl();
+};
CPPUNIT_TEST_SUITE_REGISTRATION( TestCacheManager );
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_CACHEMANAGER_H
-#define SQUID_SRC_TEST_CACHEMANAGER_H
-
-#include "compat/cppunit.h"
-
-/*
- * test the CacheManager implementation
- */
-
-class TestCacheManager: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCacheManager );
- CPPUNIT_TEST( testCreate );
- CPPUNIT_TEST( testRegister );
- CPPUNIT_TEST( testParseUrl );
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void setUp() override;
-
-protected:
- void testCreate();
- void testRegister();
- void testParseUrl();
-};
-
-#endif
-
#include "squid.h"
#include "base/CharacterSet.h"
-#include "testCharacterSet.h"
+#include "compat/cppunit.h"
#include "unitTestMain.h"
#include <string>
+class TestCharacterSet : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestCharacterSet);
+ CPPUNIT_TEST(CharacterSetConstruction);
+ CPPUNIT_TEST(CharacterSetAdd);
+ CPPUNIT_TEST(CharacterSetAddRange);
+ CPPUNIT_TEST(CharacterSetEqualityOp);
+ CPPUNIT_TEST(CharacterSetConstants);
+ CPPUNIT_TEST(CharacterSetUnion);
+ CPPUNIT_TEST(CharacterSetSubtract);
+ CPPUNIT_TEST_SUITE_END();
+
+protected:
+ void CharacterSetConstruction();
+ void CharacterSetAdd();
+ void CharacterSetAddRange();
+ void CharacterSetConstants();
+ void CharacterSetUnion();
+ void CharacterSetEqualityOp();
+ void CharacterSetSubtract();
+};
+
CPPUNIT_TEST_SUITE_REGISTRATION( TestCharacterSet );
void
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_BASE_TESTCHARACTERSET_H
-#define SQUID_BASE_TESTCHARACTERSET_H
-
-#include "compat/cppunit.h"
-
-class TestCharacterSet: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestCharacterSet );
- CPPUNIT_TEST( CharacterSetConstruction );
- CPPUNIT_TEST( CharacterSetAdd );
- CPPUNIT_TEST( CharacterSetAddRange );
- CPPUNIT_TEST( CharacterSetEqualityOp );
- CPPUNIT_TEST( CharacterSetConstants );
- CPPUNIT_TEST( CharacterSetUnion );
- CPPUNIT_TEST( CharacterSetSubtract );
- CPPUNIT_TEST_SUITE_END();
-
-protected:
- void CharacterSetConstruction();
- void CharacterSetAdd();
- void CharacterSetAddRange();
- void CharacterSetConstants();
- void CharacterSetUnion();
- void CharacterSetEqualityOp();
- void CharacterSetSubtract();
-};
-
-#endif /* SQUID_BASE_TESTCHARACTERSET_H */
-
*/
#include "squid.h"
+#include "compat/cppunit.h"
#include "ConfigParser.h"
#include "SquidString.h"
-#include "tests/testConfigParser.h"
#include "unitTestMain.h"
+/*
+ * test the ConfigParser framework
+ */
+
+class TestConfigParser : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestConfigParser);
+ CPPUNIT_TEST(testParseQuoted);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp() override;
+
+protected:
+ bool doParseQuotedTest(const char *, const char *);
+ void testParseQuoted();
+};
+
CPPUNIT_TEST_SUITE_REGISTRATION( TestConfigParser );
int shutting_down = 0;
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_CONFIG_PARSER_H
-#define SQUID_SRC_TEST_CONFIG_PARSER_H
-
-#include "compat/cppunit.h"
-
-/*
- * test the ConfigParser framework
- */
-
-class TestConfigParser: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestConfigParser );
- CPPUNIT_TEST( testParseQuoted );
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void setUp() override;
-
-protected:
- bool doParseQuotedTest(const char *, const char *);
- void testParseQuoted();
-};
-
-#endif
-
*/
#include "squid.h"
+#include "compat/cppunit.h"
#include "DiskIO/DiskIOModule.h"
#include "HttpHeader.h"
#include "HttpReply.h"
#include "MemObject.h"
#include "Store.h"
#include "StoreFileSystem.h"
-#include "testDiskIO.h"
#include "testStoreSupport.h"
#include "unitTestMain.h"
#include <stdexcept>
+/*
+ * test the DiskIO framework
+ */
+
+class TestDiskIO : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestDiskIO);
+ CPPUNIT_TEST(testFindDefault);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp() override;
+
+protected:
+ void testFindDefault();
+};
+
CPPUNIT_TEST_SUITE_REGISTRATION( TestDiskIO );
void
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_DISKIO_H
-#define SQUID_SRC_TEST_DISKIO_H
-
-#include "compat/cppunit.h"
-
-/*
- * test the DiskIO framework
- */
-
-class TestDiskIO: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestDiskIO );
- CPPUNIT_TEST( testFindDefault );
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void setUp() override;
-
-protected:
- void testFindDefault();
-};
-
-#endif
-
*/
#include "squid.h"
-#include "tests/testEnumIterator.h"
+#include "base/EnumIterator.h"
+#include "compat/cppunit.h"
#include "unitTestMain.h"
#include <cppunit/TestAssert.h>
+class TestEnumIterator : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestEnumIterator);
+ CPPUNIT_TEST(testForwardIter);
+ CPPUNIT_TEST(testReverseIter);
+ CPPUNIT_TEST(testBidirectionalIter);
+ CPPUNIT_TEST(testRangeFor);
+ CPPUNIT_TEST(testRangeForRange);
+ CPPUNIT_TEST(testUnsignedEnum);
+ CPPUNIT_TEST_SUITE_END();
+
+protected:
+ void testForwardIter();
+ void testReverseIter();
+ void testBidirectionalIter();
+ void testRangeFor();
+ void testRangeForRange();
+ void testUnsignedEnum();
+};
+
CPPUNIT_TEST_SUITE_REGISTRATION( TestEnumIterator );
enum class TestEnum {
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_TESTENUMITERATOR_H_
-#define SQUID_TESTENUMITERATOR_H_
-
-#include "base/EnumIterator.h"
-
-#include "compat/cppunit.h"
-
-class TestEnumIterator: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestEnumIterator );
- CPPUNIT_TEST( testForwardIter );
- CPPUNIT_TEST( testReverseIter );
- CPPUNIT_TEST( testBidirectionalIter );
- CPPUNIT_TEST( testRangeFor );
- CPPUNIT_TEST( testRangeForRange );
- CPPUNIT_TEST( testUnsignedEnum );
- CPPUNIT_TEST_SUITE_END();
-
-protected:
- void testForwardIter();
- void testReverseIter();
- void testBidirectionalIter();
- void testRangeFor();
- void testRangeForRange();
- void testUnsignedEnum();
-};
-
-#endif /* SQUID_TESTENUMITERATOR_H_ */
-
#include "squid.h"
#include "base/AsyncCallQueue.h"
+#include "compat/cppunit.h"
#include "event.h"
#include "MemBuf.h"
-#include "tests/testEvent.h"
#include "unitTestMain.h"
+/*
+ * test the event module.
+ */
+
+class TestEvent : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestEvent);
+ CPPUNIT_TEST(testCreate);
+ CPPUNIT_TEST(testDump);
+ CPPUNIT_TEST(testFind);
+ CPPUNIT_TEST(testCheckEvents);
+ CPPUNIT_TEST(testSingleton);
+ CPPUNIT_TEST(testCancel);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp() override;
+
+protected:
+ void testCreate();
+ void testDump();
+ void testFind();
+ void testCheckEvents();
+ void testSingleton();
+ void testCancel();
+};
+
CPPUNIT_TEST_SUITE_REGISTRATION( TestEvent );
/* init legacy static-initialized modules */
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_EVENT_H
-#define SQUID_SRC_TEST_EVENT_H
-
-#include "compat/cppunit.h"
-
-/*
- * test the event module.
- */
-
-class TestEvent: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestEvent );
- CPPUNIT_TEST( testCreate );
- CPPUNIT_TEST( testDump );
- CPPUNIT_TEST( testFind );
- CPPUNIT_TEST( testCheckEvents );
- CPPUNIT_TEST( testSingleton );
- CPPUNIT_TEST( testCancel );
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void setUp() override;
-
-protected:
- void testCreate();
- void testDump();
- void testFind();
- void testCheckEvents();
- void testSingleton();
- void testCancel();
-};
-
-#endif
-
#include "squid.h"
#include "AsyncEngine.h"
+#include "compat/cppunit.h"
#include "EventLoop.h"
-#include "tests/testEventLoop.h"
#include "time/Engine.h"
#include "unitTestMain.h"
#include <cppunit/TestAssert.h>
+/*
+ * test the EventLoop implementation
+ */
+
+class TestEventLoop : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestEventLoop);
+ CPPUNIT_TEST(testCreate);
+ CPPUNIT_TEST(testRunOnce);
+ CPPUNIT_TEST(testEngineTimeout);
+ CPPUNIT_TEST(testEngineErrors);
+ CPPUNIT_TEST(testSetTimeService);
+ CPPUNIT_TEST(testSetPrimaryEngine);
+ CPPUNIT_TEST_SUITE_END();
+
+protected:
+ void testCreate();
+ void testRunOnce();
+ void testEngineTimeout();
+ void testEngineErrors();
+ void testSetTimeService();
+ void testSetPrimaryEngine();
+ /* TODO:
+ * test that engine which errors a couple of times, then returns 0, then
+ * errors 10 times in a row triggers a fail on the 10th time around
+ */
+};
+
CPPUNIT_TEST_SUITE_REGISTRATION( TestEventLoop );
void
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_EVENTLOOP_H
-#define SQUID_SRC_TEST_EVENTLOOP_H
-
-#include "compat/cppunit.h"
-
-/*
- * test the EventLoop implementation
- */
-
-class TestEventLoop: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestEventLoop );
- CPPUNIT_TEST( testCreate );
- CPPUNIT_TEST( testRunOnce );
- CPPUNIT_TEST( testEngineTimeout );
- CPPUNIT_TEST( testEngineErrors );
- CPPUNIT_TEST( testSetTimeService );
- CPPUNIT_TEST( testSetPrimaryEngine );
- CPPUNIT_TEST_SUITE_END();
-
-protected:
- void testCreate();
- void testRunOnce();
- void testEngineTimeout();
- void testEngineErrors();
- void testSetTimeService();
- void testSetPrimaryEngine();
- /* TODO:
- * test that engine which errors a couple of times, then returns 0, then
- * errors 10 times in a row triggers a fail on the 10th time around
- */
-};
-
-#endif
-
#define private public
#define protected public
+#include "compat/cppunit.h"
#include "debug/Stream.h"
#include "http/one/RequestParser.h"
#include "http/RequestMethod.h"
#include "MemBuf.h"
#include "SquidConfig.h"
-#include "testHttp1Parser.h"
#include "unitTestMain.h"
+class TestHttp1Parser : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestHttp1Parser);
+ // object basics are working, just in case.
+ CPPUNIT_TEST(testParserConstruct);
+ CPPUNIT_TEST(testDripFeed);
+ CPPUNIT_TEST(testParseRequestLineMethods);
+ CPPUNIT_TEST(testParseRequestLineProtocols);
+ CPPUNIT_TEST(testParseRequestLineTerminators);
+ CPPUNIT_TEST(testParseRequestLineStrange);
+ CPPUNIT_TEST(testParseRequestLineInvalid);
+ CPPUNIT_TEST_SUITE_END();
+
+protected:
+ void globalSetup(); // MemPools init etc.
+
+ void testParserConstruct(); // whether the constructor works
+
+ // request-line unit tests
+ void testParseRequestLineTerminators(); // terminator detection correct
+ void testParseRequestLineMethods(); // methoid detection correct
+ void testParseRequestLineProtocols(); // protocol tokens handled correctly
+ void testParseRequestLineStrange(); // strange but valid lines accepted
+ void testParseRequestLineInvalid(); // rejection of invalid lines happens
+
+ void testDripFeed(); // test incremental parse works
+};
+
CPPUNIT_TEST_SUITE_REGISTRATION( TestHttp1Parser );
void
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_TESTS_TESTHTTP1PARSER_H
-#define SQUID_SRC_TESTS_TESTHTTP1PARSER_H
-
-#include "compat/cppunit.h"
-
-class TestHttp1Parser: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestHttp1Parser );
- // object basics are working, just in case.
- CPPUNIT_TEST( testParserConstruct );
- CPPUNIT_TEST( testDripFeed );
- CPPUNIT_TEST( testParseRequestLineMethods );
- CPPUNIT_TEST( testParseRequestLineProtocols );
- CPPUNIT_TEST( testParseRequestLineTerminators );
- CPPUNIT_TEST( testParseRequestLineStrange );
- CPPUNIT_TEST( testParseRequestLineInvalid );
- CPPUNIT_TEST_SUITE_END();
-
-protected:
- void globalSetup(); // MemPools init etc.
-
- void testParserConstruct(); // whether the constructor works
-
- // request-line unit tests
- void testParseRequestLineTerminators(); // terminator detection correct
- void testParseRequestLineMethods(); // methoid detection correct
- void testParseRequestLineProtocols(); // protocol tokens handled correctly
- void testParseRequestLineStrange(); // strange but valid lines accepted
- void testParseRequestLineInvalid(); // rejection of invalid lines happens
-
- void testDripFeed(); // test incremental parse works
-};
-
-#endif
-
#include "squid.h"
#include <cppunit/TestAssert.h>
+#include "compat/cppunit.h"
#include "HttpHeader.h"
#include "HttpReply.h"
#include "mime_header.h"
#include "SquidConfig.h"
-#include "testHttpReply.h"
#include "unitTestMain.h"
+class TestHttpReply : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestHttpReply);
+ CPPUNIT_TEST(testSanityCheckFirstLine);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp() override;
+
+protected:
+ void testSanityCheckFirstLine();
+};
+
CPPUNIT_TEST_SUITE_REGISTRATION( TestHttpReply );
class SquidConfig Config;
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_HTTP_REPLY_H
-#define SQUID_SRC_TEST_HTTP_REPLY_H
-
-#include "compat/cppunit.h"
-
-/*
- * test HttpReply
- */
-
-class TestHttpReply: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestHttpReply );
- CPPUNIT_TEST( testSanityCheckFirstLine );
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void setUp() override;
-
-protected:
- void testSanityCheckFirstLine();
-};
-
-#endif
-
*/
#include "squid.h"
-
-#include <cppunit/TestAssert.h>
-
+#include "compat/cppunit.h"
#include "HttpHeader.h"
#include "HttpRequest.h"
#include "MasterXaction.h"
#include "mime_header.h"
-#include "testHttpRequest.h"
#include "unitTestMain.h"
+#include <cppunit/TestAssert.h>
+
+class TestHttpRequest : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestHttpRequest);
+ CPPUNIT_TEST(testCreateFromUrl);
+ CPPUNIT_TEST(testIPv6HostColonBug);
+ CPPUNIT_TEST(testSanityCheckStartLine);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp() override;
+
+protected:
+ void testCreateFromUrl();
+ void testIPv6HostColonBug();
+ void testSanityCheckStartLine();
+};
+
CPPUNIT_TEST_SUITE_REGISTRATION( TestHttpRequest );
/** wrapper for testing HttpRequest object private and protected functions */
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_HTTP_REQUEST_H
-#define SQUID_SRC_TEST_HTTP_REQUEST_H
-
-#include "compat/cppunit.h"
-
-/*
- * test HttpRequest
- */
-
-class TestHttpRequest: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestHttpRequest );
- CPPUNIT_TEST( testCreateFromUrl );
- CPPUNIT_TEST( testIPv6HostColonBug );
- CPPUNIT_TEST( testSanityCheckStartLine );
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void setUp() override;
-
-protected:
- void testCreateFromUrl();
- void testIPv6HostColonBug();
- void testSanityCheckStartLine();
-};
-
-#endif
-
*/
#include "squid.h"
-#include <cppunit/TestAssert.h>
-
+#include "compat/cppunit.h"
#include "http/RequestMethod.h"
#include "SquidConfig.h"
-#include "testHttpRequestMethod.h"
#include <sstream>
+class TestHttpRequestMethod : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestHttpRequestMethod);
+ CPPUNIT_TEST(testAssignFrommethod_t);
+ CPPUNIT_TEST(testConstructmethod_t);
+ CPPUNIT_TEST(testConstructCharStart);
+ CPPUNIT_TEST(testConstructCharStartEnd);
+ CPPUNIT_TEST(testDefaultConstructor);
+ CPPUNIT_TEST(testEqualmethod_t);
+ CPPUNIT_TEST(testNotEqualmethod_t);
+ CPPUNIT_TEST(testImage);
+ CPPUNIT_TEST(testStream);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+protected:
+ void testAssignFrommethod_t();
+ void testConstructmethod_t();
+ void testConstructCharStart();
+ void testConstructCharStartEnd();
+ void testImage();
+ void testDefaultConstructor();
+ void testEqualmethod_t();
+ void testNotEqualmethod_t();
+ void testStream();
+};
+
CPPUNIT_TEST_SUITE_REGISTRATION( TestHttpRequestMethod );
/*
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_HTTP_REQUEST_METHOD_H
-#define SQUID_SRC_TEST_HTTP_REQUEST_METHOD_H
-
-#include "compat/cppunit.h"
-
-/*
- * test HttpRequestMethod
- */
-
-class TestHttpRequestMethod: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestHttpRequestMethod );
- CPPUNIT_TEST( testAssignFrommethod_t );
- CPPUNIT_TEST( testConstructmethod_t );
- CPPUNIT_TEST( testConstructCharStart );
- CPPUNIT_TEST( testConstructCharStartEnd );
- CPPUNIT_TEST( testDefaultConstructor );
- CPPUNIT_TEST( testEqualmethod_t );
- CPPUNIT_TEST( testNotEqualmethod_t );
- CPPUNIT_TEST( testImage );
- CPPUNIT_TEST( testStream );
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
-protected:
- void testAssignFrommethod_t();
- void testConstructmethod_t();
- void testConstructCharStart();
- void testConstructCharStartEnd();
- void testImage();
- void testDefaultConstructor();
- void testEqualmethod_t();
- void testNotEqualmethod_t();
- void testStream();
-};
-
-#endif
-
#define SQUID_HELPER 1
#include "squid.h"
-#include "tests/testIcmp.h"
+#include "compat/cppunit.h"
#include "unitTestMain.h"
#include <cppunit/TestAssert.h>
+#if USE_ICMP
+
+#include "icmp/Icmp.h"
+
+class IcmpStub : public Icmp
+{
+public:
+ IcmpStub() {};
+ ~IcmpStub() override {};
+ int Open() override { return 0; };
+ void Close() override {};
+
+ /// Construct ECHO request
+ void SendEcho(Ip::Address &, int, const char *, int) override {}
+
+ /// Handle ICMP responses.
+ void Recv(void) override {};
+
+ /* methods to relay test data from tester to private methods being tested */
+ int testChecksum(unsigned short *ptr, int size) { return CheckSum(ptr, size); };
+ int testHops(int ttl) { return ipHops(ttl); };
+};
+#endif
+
+/**
+ * test the ICMP base class.
+ */
+class TestIcmp : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestIcmp);
+ CPPUNIT_TEST(testChecksum);
+ CPPUNIT_TEST(testHops);
+ CPPUNIT_TEST_SUITE_END();
+
+protected:
+ void testChecksum();
+ void testHops();
+};
+
CPPUNIT_TEST_SUITE_REGISTRATION( TestIcmp );
void
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_TESTS_TESTICMP_H
-#define SQUID_SRC_TESTS_TESTICMP_H
-
-#include "compat/cppunit.h"
-
-#if USE_ICMP
-
-#include "icmp/Icmp.h"
-
-class IcmpStub: public Icmp
-{
-public:
- IcmpStub() {};
- ~IcmpStub() override {};
- int Open() override { return 0; };
- void Close() override {};
-
- /// Construct ECHO request
- void SendEcho(Ip::Address &, int, const char *, int) override {}
-
- /// Handle ICMP responses.
- void Recv(void) override {};
-
- /* methods to relay test data from tester to private methods being tested */
- int testChecksum(unsigned short *ptr, int size) { return CheckSum(ptr,size); };
- int testHops(int ttl) { return ipHops(ttl); };
-};
-#endif
-
-/**
- * test the ICMP base class.
- */
-class TestIcmp: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestIcmp );
- CPPUNIT_TEST( testChecksum );
- CPPUNIT_TEST( testHops );
- CPPUNIT_TEST_SUITE_END();
-
-protected:
- void testChecksum();
- void testHops();
-};
-
-#endif /* SQUID_SRC_TESTS_TESTICMP_H */
-
*/
#include "squid.h"
+#include "compat/cppunit.h"
#include "ip/Address.h"
#include "ip/tools.h"
-#include "tests/testIpAddress.h"
#include "unitTestMain.h"
#include <cstring>
#include <netdb.h>
#endif
+/*
+ * test the IP storage type
+ */
+
+class TestIpAddress : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestIpAddress);
+ CPPUNIT_TEST(testDefaults);
+ CPPUNIT_TEST(testInAddrConstructor);
+ CPPUNIT_TEST(testInAddr6Constructor);
+ CPPUNIT_TEST(testSockAddrConstructor);
+ CPPUNIT_TEST(testSockAddr6Constructor);
+ CPPUNIT_TEST(testHostentConstructor);
+ CPPUNIT_TEST(testStringConstructor);
+ CPPUNIT_TEST(testCopyConstructor);
+ CPPUNIT_TEST(testsetEmpty);
+ CPPUNIT_TEST(testBooleans);
+ CPPUNIT_TEST(testAddrInfo);
+ CPPUNIT_TEST(testtoStr);
+ CPPUNIT_TEST(testtoUrl_fromInAddr);
+ CPPUNIT_TEST(testtoUrl_fromSockAddr);
+ CPPUNIT_TEST(testgetReverseString);
+ CPPUNIT_TEST(testMasking);
+
+ CPPUNIT_TEST(testBugNullingDisplay);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+protected:
+ void testDefaults();
+
+ void testInAddrConstructor();
+ void testInAddr6Constructor();
+ void testSockAddrConstructor();
+ void testSockAddr6Constructor();
+ void testHostentConstructor();
+ void testStringConstructor();
+ void testCopyConstructor();
+
+ void testsetEmpty();
+ void testBooleans();
+
+ void testAddrInfo();
+
+ void testtoStr();
+ void testtoUrl_fromInAddr();
+ void testtoUrl_fromSockAddr();
+ void testgetReverseString();
+ void testMasking();
+
+ // bugs.
+ void testBugNullingDisplay();
+};
+
CPPUNIT_TEST_SUITE_REGISTRATION( TestIpAddress );
void
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_IPADDRESS_H
-#define SQUID_SRC_TEST_IPADDRESS_H
-
-#include "compat/cppunit.h"
-
-/*
- * test the IP storage type
- */
-
-class TestIpAddress: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestIpAddress );
- CPPUNIT_TEST( testDefaults );
- CPPUNIT_TEST( testInAddrConstructor );
- CPPUNIT_TEST( testInAddr6Constructor );
- CPPUNIT_TEST( testSockAddrConstructor );
- CPPUNIT_TEST( testSockAddr6Constructor );
- CPPUNIT_TEST( testHostentConstructor );
- CPPUNIT_TEST( testStringConstructor );
- CPPUNIT_TEST( testCopyConstructor );
- CPPUNIT_TEST( testsetEmpty );
- CPPUNIT_TEST( testBooleans );
- CPPUNIT_TEST( testAddrInfo );
- CPPUNIT_TEST( testtoStr );
- CPPUNIT_TEST( testtoUrl_fromInAddr );
- CPPUNIT_TEST( testtoUrl_fromSockAddr );
- CPPUNIT_TEST( testgetReverseString );
- CPPUNIT_TEST( testMasking );
-
- CPPUNIT_TEST( testBugNullingDisplay );
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
-protected:
- void testDefaults();
-
- void testInAddrConstructor();
- void testInAddr6Constructor();
- void testSockAddrConstructor();
- void testSockAddr6Constructor();
- void testHostentConstructor();
- void testStringConstructor();
- void testCopyConstructor();
-
- void testsetEmpty();
- void testBooleans();
-
- void testAddrInfo();
-
- void testtoStr();
- void testtoUrl_fromInAddr();
- void testtoUrl_fromSockAddr();
- void testgetReverseString();
- void testMasking();
-
- // bugs.
- void testBugNullingDisplay();
-
-};
-
-#endif /* SQUID_SRC_TEST_IPADDRESS_H */
-
#include "squid.h"
#include "base/LookupTable.h"
-#include "testLookupTable.h"
+#include "compat/cppunit.h"
#include "unitTestMain.h"
-CPPUNIT_TEST_SUITE_REGISTRATION( TestLookupTable );
+class TestLookupTable : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestLookupTable);
+ CPPUNIT_TEST(testLookupTableLookup);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void testLookupTableLookup();
+};
+CPPUNIT_TEST_SUITE_REGISTRATION(TestLookupTable);
enum EnumData {
ENUM_1,
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_TESTLOOKUPTABLE_H_
-#define SQUID_TESTLOOKUPTABLE_H_
-
-#include "compat/cppunit.h"
-
-class TestLookupTable: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestLookupTable );
- CPPUNIT_TEST( testLookupTableLookup );
- CPPUNIT_TEST_SUITE_END();
-public:
- void testLookupTableLookup();
-};
-
-#endif /* SQUID_TESTLOOKUPTABLE_H_ */
-
*/
#include "squid.h"
+#include "compat/cppunit.h"
#include "mem/Allocator.h"
#include "mem/Pool.h"
-#include "tests/testMem.h"
#include "unitTestMain.h"
#include <iostream>
#include <stdexcept>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestMem );
+class TestMem : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestMem);
+ /* note the statement here and then the actual prototype below */
+ CPPUNIT_TEST(testMemPool);
+ CPPUNIT_TEST(testMemProxy);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+protected:
+ void testMemPool();
+ void testMemProxy();
+};
+CPPUNIT_TEST_SUITE_REGISTRATION(TestMem);
class SomethingToAlloc
{
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_TESTS_TESTMEM_H
-#define SQUID_SRC_TESTS_TESTMEM_H
-
-#include "compat/cppunit.h"
-
-class TestMem: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestMem );
- /* note the statement here and then the actual prototype below */
- CPPUNIT_TEST( testMemPool );
- CPPUNIT_TEST( testMemProxy );
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
-protected:
- void testMemPool();
- void testMemProxy();
-};
-
-#endif /* SQUID_SRC_TESTS_TESTMEM_H */
-
*/
#include "squid.h"
+#include "compat/cppunit.h"
#include "icmp/net_db.h"
-#include "tests/testNetDb.h"
#include "unitTestMain.h"
-#include <stdexcept>
+class TestNetDb : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestNetDb);
+ /* note the statement here and then the actual prototype below */
+ CPPUNIT_TEST(testConstruct);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+protected:
+ void testConstruct();
+};
CPPUNIT_TEST_SUITE_REGISTRATION( TestNetDb );
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_TESTS_TESTNETDB_H
-#define SQUID_SRC_TESTS_TESTNETDB_H
-
-#include "compat/cppunit.h"
-
-class TestNetDb: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestNetDb );
- /* note the statement here and then the actual prototype below */
- CPPUNIT_TEST( testConstruct );
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
-protected:
- void testConstruct();
-};
-
-#endif /* SQUID_SRC_TESTS_TESTNETDB_H */
-
#include "squid.h"
#include "base/PackableStream.h"
#include "CapturingStoreEntry.h"
+#include "compat/cppunit.h"
#include "Store.h"
-#include "testPackableStream.h"
#include "testStore.h"
#include <iomanip>
#include <cppunit/TestAssert.h>
+class TestPackableStream : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestPackableStream);
+ CPPUNIT_TEST(testGetStream);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp() override;
+
+protected:
+ void testGetStream();
+};
+
CPPUNIT_TEST_SUITE_REGISTRATION( TestPackableStream );
/* init memory pools */
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_TESTS_TESTPACKABLESTREAM_H
-#define SQUID_SRC_TESTS_TESTPACKABLESTREAM_H
-
-#include "compat/cppunit.h"
-
-/*
- * test PackableStream
- */
-
-class TestPackableStream: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestPackableStream );
- CPPUNIT_TEST( testGetStream );
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void setUp() override;
-
-protected:
- void testGetStream();
-};
-
-#endif /* SQUID_SRC_TESTS_TESTPACKABLESTREAM_H */
-
*/
#include "squid.h"
+#include "compat/cppunit.h"
#include "dns/rfc1035.h"
-#include "testRFC1035.h"
#include "unitTestMain.h"
-#include <cassert>
+// #include <cassert>
+
+/*
+ * test the DNS resolver RFC 1035 Engine
+ */
+
+class TestRfc1035 : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestRfc1035);
+ CPPUNIT_TEST(testHeaderUnpack);
+ CPPUNIT_TEST(testParseAPacket);
+
+ CPPUNIT_TEST(testBugPacketHeadersOnly);
+ CPPUNIT_TEST(testBugPacketEndingOnCompressionPtr);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+protected:
+ void testHeaderUnpack();
+ void testParseAPacket();
+
+ // bugs.
+ void testBugPacketEndingOnCompressionPtr();
+ void testBugPacketHeadersOnly();
+};
CPPUNIT_TEST_SUITE_REGISTRATION( TestRfc1035 );
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_RFC1035_H
-#define SQUID_SRC_TEST_RFC1035_H
-
-#include "compat/cppunit.h"
-
-/*
- * test the DNS resolver RFC 1035 Engine
- */
-
-class TestRfc1035: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestRfc1035 );
- CPPUNIT_TEST( testHeaderUnpack );
- CPPUNIT_TEST( testParseAPacket );
-
- CPPUNIT_TEST( testBugPacketHeadersOnly );
- CPPUNIT_TEST( testBugPacketEndingOnCompressionPtr );
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
-protected:
- void testHeaderUnpack();
- void testParseAPacket();
-
- // bugs.
- void testBugPacketEndingOnCompressionPtr();
- void testBugPacketHeadersOnly();
-};
-
-#endif /* SQUID_SRC_TEST_IPADDRESS_H */
-
#include "squid.h"
#include "base/RefCount.h"
-#include "testRefCount.h"
+#include "compat/cppunit.h"
#include "unitTestMain.h"
+class TestRefCount : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestRefCount);
+ CPPUNIT_TEST(testCountability);
+ CPPUNIT_TEST(testObjectToRefCounted);
+ CPPUNIT_TEST(testStandalonePointer);
+ CPPUNIT_TEST(testCheckPointers);
+ CPPUNIT_TEST(testPointerConst);
+ CPPUNIT_TEST(testRefCountFromConst);
+ CPPUNIT_TEST(testPointerFromRefCounter);
+ CPPUNIT_TEST(testDoubleInheritToSingleInherit);
+ CPPUNIT_TEST_SUITE_END();
+
+protected:
+ void testCountability();
+ void testObjectToRefCounted();
+ void testStandalonePointer();
+ void testCheckPointers();
+ void testPointerConst();
+ void testRefCountFromConst();
+ void testPointerFromRefCounter();
+ void testDoubleInheritToSingleInherit();
+};
+
CPPUNIT_TEST_SUITE_REGISTRATION( TestRefCount );
class _ToRefCount : public RefCountable
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_REFCOUNT_H
-#define SQUID_SRC_TEST_REFCOUNT_H
-
-#include "compat/cppunit.h"
-
-class TestRefCount: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestRefCount );
- CPPUNIT_TEST( testCountability );
- CPPUNIT_TEST( testObjectToRefCounted );
- CPPUNIT_TEST( testStandalonePointer );
- CPPUNIT_TEST( testCheckPointers );
- CPPUNIT_TEST( testPointerConst );
- CPPUNIT_TEST( testRefCountFromConst );
- CPPUNIT_TEST( testPointerFromRefCounter );
- CPPUNIT_TEST( testDoubleInheritToSingleInherit );
- CPPUNIT_TEST_SUITE_END();
-
-protected:
- void testCountability();
- void testObjectToRefCounted();
- void testStandalonePointer();
- void testCheckPointers();
- void testPointerConst();
- void testRefCountFromConst();
- void testPointerFromRefCounter();
- void testDoubleInheritToSingleInherit();
-};
-
-#endif
-
*/
#include "squid.h"
+#include "compat/cppunit.h"
#include "ConfigParser.h"
#include "DiskIO/DiskIOModule.h"
#include "fde.h"
#include "store/Disks.h"
#include "StoreFileSystem.h"
#include "StoreSearch.h"
-#include "testRock.h"
#include "testStoreSupport.h"
#include "unitTestMain.h"
#define TESTDIR "tr"
-CPPUNIT_TEST_SUITE_REGISTRATION( TestRock );
+/*
+ * test the store framework
+ */
+
+class TestRock : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestRock);
+ CPPUNIT_TEST(testRockCreate);
+ CPPUNIT_TEST(testRockSwapOut);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ TestRock() : rr(nullptr) {}
+ void setUp() override;
+ void tearDown() override;
+
+ typedef RefCount<Rock::SwapDir> SwapDirPointer;
+
+protected:
+ void commonInit();
+ void storeInit();
+ StoreEntry *createEntry(const int i);
+ StoreEntry *addEntry(const int i);
+ StoreEntry *getEntry(const int i);
+ void testRockCreate();
+ void testRockSwapOut();
+
+private:
+ SwapDirPointer store;
+ Rock::SwapDirRr *rr;
+};
+CPPUNIT_TEST_SUITE_REGISTRATION(TestRock);
extern REMOVALPOLICYCREATE createRemovalPolicy_lru;
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_TESTROCK_H
-#define SQUID_SRC_TEST_TESTROCK_H
-
-#include "compat/cppunit.h"
-
-/*
- * test the store framework
- */
-
-class TestRock: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestRock );
- CPPUNIT_TEST( testRockCreate );
- CPPUNIT_TEST( testRockSwapOut );
- CPPUNIT_TEST_SUITE_END();
-
-public:
- TestRock() : rr(nullptr) {}
- void setUp() override;
- void tearDown() override;
-
- typedef RefCount<Rock::SwapDir> SwapDirPointer;
-
-protected:
- void commonInit();
- void storeInit();
- StoreEntry *createEntry(const int i);
- StoreEntry *addEntry(const int i);
- StoreEntry *getEntry(const int i);
- void testRockCreate();
- void testRockSwapOut();
-
-private:
- SwapDirPointer store;
- Rock::SwapDirRr *rr;
-};
-
-#endif /* SQUID_SRC_TEST_TESTROCK_H */
-
#include "squid.h"
#include "base/CharacterSet.h"
+#include "base/TextException.h"
+#include "compat/cppunit.h"
+#include "event.h"
#include "HttpReply.h"
+#include "MemObject.h"
#include "sbuf/Algorithms.h"
#include "sbuf/SBuf.h"
#include "sbuf/Stream.h"
#include "tests/SBufFindTest.h"
-#include "tests/testSBuf.h"
#include "unitTestMain.h"
#include <iostream>
#include <stdexcept>
#include <unordered_map>
+/*
+ * test the SBuf functionalities
+ */
+
+class TestSBuf : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestSBuf);
+ CPPUNIT_TEST(testSBufConstructDestruct);
+ CPPUNIT_TEST(testSBufConstructDestructAfterMemInit);
+ CPPUNIT_TEST(testSBufLength);
+ CPPUNIT_TEST(testEqualityTest);
+ CPPUNIT_TEST(testStartsWith);
+ CPPUNIT_TEST(testAppendSBuf);
+ CPPUNIT_TEST(testAppendCString);
+ CPPUNIT_TEST(testAppendStdString);
+ CPPUNIT_TEST(testAppendf);
+ CPPUNIT_TEST(testSubscriptOp);
+ CPPUNIT_TEST_EXCEPTION(testSubscriptOpFail, TextException);
+ CPPUNIT_TEST(testComparisons);
+ CPPUNIT_TEST(testConsume);
+ CPPUNIT_TEST(testRawContent);
+ CPPUNIT_TEST(testRawSpace);
+ CPPUNIT_TEST(testChop);
+ CPPUNIT_TEST(testChomp);
+ CPPUNIT_TEST(testSubstr);
+ CPPUNIT_TEST(testFindChar);
+ CPPUNIT_TEST(testFindSBuf);
+ CPPUNIT_TEST(testRFindChar);
+ CPPUNIT_TEST(testRFindSBuf);
+ CPPUNIT_TEST(testFindFirstOf);
+ CPPUNIT_TEST(testFindFirstNotOf);
+ CPPUNIT_TEST(testPrintf);
+ CPPUNIT_TEST(testCopy);
+ CPPUNIT_TEST(testStringOps);
+ CPPUNIT_TEST(testGrow);
+ CPPUNIT_TEST(testReserve);
+ CPPUNIT_TEST(testSBufStream);
+ CPPUNIT_TEST(testAutoFind);
+ CPPUNIT_TEST(testStdStringOps);
+ CPPUNIT_TEST(testIterators);
+ CPPUNIT_TEST(testSBufHash);
+ // CPPUNIT_TEST( testDumpStats ); //fake test, to print alloc stats
+ CPPUNIT_TEST_SUITE_END();
+
+protected:
+ void commonInit();
+ void testSBufConstructDestruct();
+ void testSBufConstructDestructAfterMemInit();
+ void testEqualityTest();
+ void testAppendSBuf();
+ void testAppendCString();
+ void testAppendStdString();
+ void testAppendf();
+ void testPrintf();
+ void testSubscriptOp();
+ void testSubscriptOpFail();
+ void testDumpStats();
+ void testComparisons();
+ void testConsume();
+ void testRawContent();
+ void testRawSpace();
+ void testChop();
+ void testChomp();
+ void testSubstr();
+ void testTailCopy();
+ void testSBufLength();
+ void testFindChar();
+ void testFindSBuf();
+ void testRFindChar();
+ void testRFindSBuf();
+ void testSearchFail();
+ void testCopy();
+ void testStringOps();
+ void testGrow();
+ void testReserve();
+ void testStartsWith();
+ void testSBufStream();
+ void testFindFirstOf();
+ void testFindFirstNotOf();
+ void testAutoFind();
+ void testStdStringOps();
+ void testIterators();
+ void testSBufHash();
+};
CPPUNIT_TEST_SUITE_REGISTRATION( TestSBuf );
/* let this test link sanely */
-#include "event.h"
-#include "MemObject.h"
void
eventAdd(const char *, EVH *, void *, double, int, bool)
{}
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_TESTSBUF_H
-#define SQUID_SRC_TEST_TESTSBUF_H
-
-#include "compat/cppunit.h"
-
-#include "base/TextException.h"
-
-/*
- * test the SBuf functionalities
- */
-
-class TestSBuf: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestSBuf );
- CPPUNIT_TEST( testSBufConstructDestruct );
- CPPUNIT_TEST( testSBufConstructDestructAfterMemInit );
- CPPUNIT_TEST( testSBufLength );
- CPPUNIT_TEST( testEqualityTest );
- CPPUNIT_TEST( testStartsWith );
- CPPUNIT_TEST( testAppendSBuf );
- CPPUNIT_TEST( testAppendCString );
- CPPUNIT_TEST( testAppendStdString );
- CPPUNIT_TEST( testAppendf );
- CPPUNIT_TEST( testSubscriptOp );
- CPPUNIT_TEST_EXCEPTION( testSubscriptOpFail, TextException );
- CPPUNIT_TEST( testComparisons );
- CPPUNIT_TEST( testConsume );
- CPPUNIT_TEST( testRawContent );
- CPPUNIT_TEST( testRawSpace );
- CPPUNIT_TEST( testChop );
- CPPUNIT_TEST( testChomp );
- CPPUNIT_TEST( testSubstr );
- CPPUNIT_TEST( testFindChar );
- CPPUNIT_TEST( testFindSBuf );
- CPPUNIT_TEST( testRFindChar );
- CPPUNIT_TEST( testRFindSBuf );
- CPPUNIT_TEST( testFindFirstOf );
- CPPUNIT_TEST( testFindFirstNotOf );
- CPPUNIT_TEST( testPrintf );
- CPPUNIT_TEST( testCopy );
- CPPUNIT_TEST( testStringOps );
- CPPUNIT_TEST( testGrow );
- CPPUNIT_TEST( testReserve );
- CPPUNIT_TEST( testSBufStream );
- CPPUNIT_TEST( testAutoFind );
- CPPUNIT_TEST( testStdStringOps );
- CPPUNIT_TEST( testIterators );
- CPPUNIT_TEST( testSBufHash );
-// CPPUNIT_TEST( testDumpStats ); //fake test, to print alloc stats
- CPPUNIT_TEST_SUITE_END();
-protected:
- void commonInit();
- void testSBufConstructDestruct();
- void testSBufConstructDestructAfterMemInit();
- void testEqualityTest();
- void testAppendSBuf();
- void testAppendCString();
- void testAppendStdString();
- void testAppendf();
- void testPrintf();
- void testSubscriptOp();
- void testSubscriptOpFail();
- void testDumpStats();
- void testComparisons();
- void testConsume();
- void testRawContent();
- void testRawSpace();
- void testChop();
- void testChomp();
- void testSubstr();
- void testTailCopy();
- void testSBufLength();
- void testFindChar();
- void testFindSBuf();
- void testRFindChar();
- void testRFindSBuf();
- void testSearchFail();
- void testCopy();
- void testStringOps();
- void testGrow();
- void testReserve();
- void testStartsWith();
- void testSBufStream();
- void testFindFirstOf();
- void testFindFirstNotOf();
- void testAutoFind();
- void testStdStringOps();
- void testIterators();
- void testSBufHash();
-};
-
-#endif
-
*/
#include "squid.h"
+#include "compat/cppunit.h"
#include "sbuf/Algorithms.h"
#include "sbuf/List.h"
-#include "tests/testSBufList.h"
#include "unitTestMain.h"
+class TestSBufList : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestSBufList);
+ CPPUNIT_TEST(testSBufListMembership);
+ CPPUNIT_TEST(testSBufListJoin);
+ CPPUNIT_TEST_SUITE_END();
+
+protected:
+ void testSBufListMembership();
+ void testSBufListJoin();
+};
CPPUNIT_TEST_SUITE_REGISTRATION( TestSBufList );
SBuf literal("The quick brown fox jumped over the lazy dog");
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_TESTSBUF_H
-#define SQUID_SRC_TEST_TESTSBUF_H
-
-#include "compat/cppunit.h"
-
-class TestSBufList: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestSBufList );
- CPPUNIT_TEST( testSBufListMembership );
- CPPUNIT_TEST( testSBufListJoin );
- CPPUNIT_TEST_SUITE_END();
-protected:
- void testSBufListMembership();
- void testSBufListJoin();
-};
-
-#endif
-
*/
#include "squid.h"
+#include "compat/cppunit.h"
#include "StatHist.h"
-#include "testStatHist.h"
#include "unitTestMain.h"
+class TestStatHist : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestStatHist);
+ CPPUNIT_TEST(testStatHistBaseEquality);
+ CPPUNIT_TEST(testStatHistBaseAssignment);
+ CPPUNIT_TEST(testStatHistLog);
+ CPPUNIT_TEST(testStatHistSum);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+protected:
+ void testStatHistBaseEquality();
+ void testStatHistBaseAssignment();
+ void testStatHistLog();
+ void testStatHistSum();
+};
CPPUNIT_TEST_SUITE_REGISTRATION( TestStatHist );
typedef enum {
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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.
- */
-
-/*
- * StatHist unit test
- */
-
-#ifndef TESTSTATHIST_H_
-#define TESTSTATHIST_H_
-
-#include "compat/cppunit.h"
-
-class TestStatHist: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestStatHist );
- CPPUNIT_TEST( testStatHistBaseEquality );
- CPPUNIT_TEST( testStatHistBaseAssignment );
- CPPUNIT_TEST( testStatHistLog );
- CPPUNIT_TEST( testStatHistSum );
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
-protected:
- void testStatHistBaseEquality();
- void testStatHistBaseAssignment();
- void testStatHistLog();
- void testStatHistSum();
-};
-
-#endif /* TESTSTATHIST_H_ */
-
*/
#include "squid.h"
+#include "compat/cppunit.h"
#include "MemObject.h"
#include "SquidConfig.h"
#include "Store.h"
#include "store/Disks.h"
#include "StoreSearch.h"
-#include "testStoreController.h"
#include "TestSwapDir.h"
-CPPUNIT_TEST_SUITE_REGISTRATION( TestStoreController );
+/*
+ * test the store framework
+ */
+
+class TestStoreController : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestStoreController);
+ CPPUNIT_TEST(testStats);
+ CPPUNIT_TEST(testMaxSize);
+ CPPUNIT_TEST(testSearch);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+protected:
+ void testStats();
+ void testMaxSize();
+ void testSearch();
+};
+CPPUNIT_TEST_SUITE_REGISTRATION(TestStoreController);
static void
addSwapDir(TestSwapDirPointer aStore)
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_STORECONTROLLER_H
-#define SQUID_SRC_TEST_STORECONTROLLER_H
-
-#include "compat/cppunit.h"
-
-/*
- * test the store framework
- */
-
-class TestStoreController: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestStoreController );
- CPPUNIT_TEST( testStats );
- CPPUNIT_TEST( testMaxSize );
- CPPUNIT_TEST( testSearch );
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
-protected:
- void testStats();
- void testMaxSize();
- void testSearch();
-};
-
-#endif
-
*/
#include "squid.h"
+#include "compat/cppunit.h"
#include "MemObject.h"
#include "SquidConfig.h"
#include "Store.h"
#include "store/Disks.h"
#include "StoreSearch.h"
-#include "testStoreHashIndex.h"
#include "TestSwapDir.h"
-CPPUNIT_TEST_SUITE_REGISTRATION( TestStoreHashIndex );
+/*
+ * test the store framework
+ */
+
+class TestStoreHashIndex : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestStoreHashIndex);
+ CPPUNIT_TEST(testStats);
+ CPPUNIT_TEST(testMaxSize);
+ CPPUNIT_TEST(testSearch);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+protected:
+ void testStats();
+ void testMaxSize();
+ void testSearch();
+};
+CPPUNIT_TEST_SUITE_REGISTRATION(TestStoreHashIndex);
static void
addSwapDir(TestSwapDirPointer aStore)
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_STOREHASHINDEX_H
-#define SQUID_SRC_TEST_STOREHASHINDEX_H
-
-#include "compat/cppunit.h"
-
-/*
- * test the store framework
- */
-
-class TestStoreHashIndex: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestStoreHashIndex );
- CPPUNIT_TEST( testStats );
- CPPUNIT_TEST( testMaxSize );
- CPPUNIT_TEST( testSearch );
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
-protected:
- void testStats();
- void testMaxSize();
- void testSearch();
-};
-
-#endif
-
*/
#include "squid.h"
+#include "compat/cppunit.h"
#include "mem/forward.h"
#include "SquidString.h"
-#include "testString.h"
#include "unitTestMain.h"
-CPPUNIT_TEST_SUITE_REGISTRATION( TestString );
+/*
+ * test the store framework
+ */
+
+class TestString : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestString);
+ CPPUNIT_TEST(testCmpDefault);
+ CPPUNIT_TEST(testCmpEmptyString);
+ CPPUNIT_TEST(testCmpNotEmptyDefault);
+ CPPUNIT_TEST(testSubstr);
+
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp() override;
+
+protected:
+ void testCmpDefault();
+ void testCmpEmptyString();
+ void testCmpNotEmptyDefault();
+ void testSubstr();
+};
+CPPUNIT_TEST_SUITE_REGISTRATION(TestString);
/* init memory pools */
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_STRING_H
-#define SQUID_SRC_TEST_STRING_H
-
-#include "compat/cppunit.h"
-
-/*
- * test the store framework
- */
-
-class TestString: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestString );
- CPPUNIT_TEST( testCmpDefault );
- CPPUNIT_TEST( testCmpEmptyString );
- CPPUNIT_TEST( testCmpNotEmptyDefault );
- CPPUNIT_TEST( testSubstr );
-
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void setUp() override;
-
-protected:
- void testCmpDefault();
- void testCmpEmptyString();
- void testCmpNotEmptyDefault();
- void testSubstr();
-};
-
-#endif
-
#include "squid.h"
#include "base/CharacterSet.h"
+#include "compat/cppunit.h"
#include "parser/Tokenizer.h"
-#include "tests/testTokenizer.h"
#include "unitTestMain.h"
-CPPUNIT_TEST_SUITE_REGISTRATION( TestTokenizer );
+class TestTokenizer : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestTokenizer);
+ CPPUNIT_TEST(testCharacterSet);
+ CPPUNIT_TEST(testTokenizerPrefix);
+ CPPUNIT_TEST(testTokenizerSuffix);
+ CPPUNIT_TEST(testTokenizerSkip);
+ CPPUNIT_TEST(testTokenizerToken);
+ CPPUNIT_TEST(testTokenizerInt64);
+ CPPUNIT_TEST_SUITE_END();
+
+protected:
+ void testTokenizerPrefix();
+ void testTokenizerSuffix();
+ void testTokenizerSkip();
+ void testTokenizerToken();
+ void testCharacterSet();
+ void testTokenizerInt64();
+};
+CPPUNIT_TEST_SUITE_REGISTRATION(TestTokenizer);
SBuf text("GET http://resource.com/path HTTP/1.1\r\n"
"Host: resource.com\r\n"
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_TESTTOKENIZER_H_
-#define SQUID_TESTTOKENIZER_H_
-
-#include "compat/cppunit.h"
-
-class TestTokenizer: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestTokenizer );
- CPPUNIT_TEST ( testCharacterSet );
- CPPUNIT_TEST ( testTokenizerPrefix );
- CPPUNIT_TEST ( testTokenizerSuffix );
- CPPUNIT_TEST ( testTokenizerSkip );
- CPPUNIT_TEST ( testTokenizerToken );
- CPPUNIT_TEST ( testTokenizerInt64 );
- CPPUNIT_TEST_SUITE_END();
-
-protected:
- void testTokenizerPrefix();
- void testTokenizerSuffix();
- void testTokenizerSkip();
- void testTokenizerToken();
- void testCharacterSet();
- void testTokenizerInt64();
-};
-
-#endif /* SQUID_TESTTOKENIZER_H_ */
-
#include "squid.h"
-#include <cppunit/TestAssert.h>
-
#include "anyp/Uri.h"
+#include "compat/cppunit.h"
#include "debug/Stream.h"
-#include "tests/testURL.h"
#include "unitTestMain.h"
+#include <cppunit/TestAssert.h>
#include <sstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestUri );
+/*
+ * test the Anyp::Uri-related classes
+ */
+
+class TestUri : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestUri);
+ CPPUNIT_TEST(testConstructScheme);
+ CPPUNIT_TEST(testDefaultConstructor);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp() override;
+
+protected:
+ void testConstructScheme();
+ void testDefaultConstructor();
+};
+CPPUNIT_TEST_SUITE_REGISTRATION(TestUri);
/* init memory pools */
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_URL_H
-#define SQUID_SRC_TEST_URL_H
-
-#include "compat/cppunit.h"
-
-/*
- * test the Anyp::Uri-related classes
- */
-
-class TestUri: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestUri );
- CPPUNIT_TEST( testConstructScheme );
- CPPUNIT_TEST( testDefaultConstructor );
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void setUp() override;
-
-protected:
-
- void testConstructScheme();
- void testDefaultConstructor();
-};
-
-#endif
-
*/
#include "squid.h"
+#include "compat/cppunit.h"
#include "DiskIO/DiskIOModule.h"
#include "fde.h"
#include "fs/ufs/UFSSwapDir.h"
#include "Store.h"
#include "store/Disks.h"
#include "testStoreSupport.h"
-#include "testUfs.h"
#include "unitTestMain.h"
#include <stdexcept>
#define TESTDIR "TestUfs_Store"
-CPPUNIT_TEST_SUITE_REGISTRATION( TestUfs );
+/*
+ * test the store framework
+ */
+
+class TestUfs : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestUfs);
+ CPPUNIT_TEST(testUfsSearch);
+ CPPUNIT_TEST(testUfsDefaultEngine);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+protected:
+ void commonInit();
+ void testUfsSearch();
+ void testUfsDefaultEngine();
+};
+CPPUNIT_TEST_SUITE_REGISTRATION(TestUfs);
typedef RefCount<Fs::Ufs::UFSSwapDir> MySwapDirPointer;
extern REMOVALPOLICYCREATE createRemovalPolicy_lru; /* XXX fails with --enable-removal-policies=heap */
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_STORECONTROLLER_H
-#define SQUID_SRC_TEST_STORECONTROLLER_H
-
-#include "compat/cppunit.h"
-
-/*
- * test the store framework
- */
-
-class TestUfs: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestUfs );
- CPPUNIT_TEST( testUfsSearch );
- CPPUNIT_TEST( testUfsDefaultEngine );
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
-protected:
- void commonInit();
- void testUfsSearch();
- void testUfsDefaultEngine();
-};
-
-#endif
-
#include "squid.h"
-#include <cppunit/TestAssert.h>
-
#include "anyp/UriScheme.h"
-#include "tests/testUriScheme.h"
+#include "compat/cppunit.h"
+#include <cppunit/TestAssert.h>
#include <sstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestUriScheme );
+/*
+ * test UriScheme
+ */
+
+class TestUriScheme : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestUriScheme);
+ CPPUNIT_TEST(testAssignFromprotocol_t);
+ CPPUNIT_TEST(testCastToprotocol_t);
+ CPPUNIT_TEST(testConstructprotocol_t);
+ CPPUNIT_TEST(testDefaultConstructor);
+ CPPUNIT_TEST(testEqualprotocol_t);
+ CPPUNIT_TEST(testNotEqualprotocol_t);
+ CPPUNIT_TEST(testC_str);
+ CPPUNIT_TEST(testStream);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp() override;
+
+protected:
+ void testAssignFromprotocol_t();
+ void testCastToprotocol_t();
+ void testConstructprotocol_t();
+ void testC_str();
+ void testDefaultConstructor();
+ void testEqualprotocol_t();
+ void testNotEqualprotocol_t();
+ void testStream();
+};
+CPPUNIT_TEST_SUITE_REGISTRATION(TestUriScheme);
/*
* we should be able to assign a protocol_t to a AnyP::UriScheme for ease
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_TESTS_TESTURISCHEME_H
-#define SQUID_SRC_TESTS_TESTURISCHEME_H
-
-#include "compat/cppunit.h"
-
-/*
- * test UriScheme
- */
-
-class TestUriScheme: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestUriScheme );
- CPPUNIT_TEST( testAssignFromprotocol_t );
- CPPUNIT_TEST( testCastToprotocol_t );
- CPPUNIT_TEST( testConstructprotocol_t );
- CPPUNIT_TEST( testDefaultConstructor );
- CPPUNIT_TEST( testEqualprotocol_t );
- CPPUNIT_TEST( testNotEqualprotocol_t );
- CPPUNIT_TEST( testC_str );
- CPPUNIT_TEST( testStream );
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void setUp() override;
-
-protected:
- void testAssignFromprotocol_t();
- void testCastToprotocol_t();
- void testConstructprotocol_t();
- void testC_str();
- void testDefaultConstructor();
- void testEqualprotocol_t();
- void testNotEqualprotocol_t();
- void testStream();
-};
-
-#endif
-
#include "squid.h"
#include "base/YesNoNone.h"
-#include "tests/testYesNoNone.h"
+#include "compat/cppunit.h"
#include "unitTestMain.h"
#include <stdexcept>
-CPPUNIT_TEST_SUITE_REGISTRATION( TestYesNoNone );
+/*
+ * demonstration test file, as new idioms are made they will
+ * be shown in the TestYesNoNone source.
+ */
+
+class TestYesNoNone : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestYesNoNone);
+ /* note the statement here and then the actual prototype below */
+ CPPUNIT_TEST(testBasics);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+protected:
+ void testBasics();
+};
+CPPUNIT_TEST_SUITE_REGISTRATION(TestYesNoNone);
void
TestYesNoNone::testBasics()
+++ /dev/null
-/*
- * Copyright (C) 1996-2023 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_TESTS_TESTYESNONONE_H
-#define SQUID_SRC_TESTS_TESTYESNONONE_H
-
-#include "compat/cppunit.h"
-
-/*
- * demonstration test file, as new idioms are made they will
- * be shown in the TestYesNoNone source.
- */
-
-class TestYesNoNone: public CPPUNIT_NS::TestFixture
-{
- CPPUNIT_TEST_SUITE( TestYesNoNone );
- /* note the statement here and then the actual prototype below */
- CPPUNIT_TEST( testBasics );
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
-protected:
- void testBasics();
-};
-
-#endif /* SQUID_SRC_TESTS_TESTYESNONONE_H */
-