]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Maintenance: remove some unit test headers (#1293)
authorFrancesco Chemolli <5175948+kinkie@users.noreply.github.com>
Mon, 24 Apr 2023 20:23:37 +0000 (20:23 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Mon, 24 Apr 2023 20:46:23 +0000 (20:46 +0000)
When a unit test class is not reused across translation units, merge the
class declaration with its implementation and remove the header file. In
many cases, these classes are not meant/designed to be reusable that
way, and we should not imply otherwise by publishing a header file.

Excuse src/tests/testAuth.h until we make that test work again.

72 files changed:
compat/Makefile.am
compat/testPreCompiler.cc
compat/testPreCompiler.h [deleted file]
lib/Makefile.am
lib/tests/testRFC1738.cc
lib/tests/testRFC1738.h [deleted file]
src/Makefile.am
src/tests/testACLMaxUserIP.cc
src/tests/testACLMaxUserIP.h [deleted file]
src/tests/testBoilerplate.h
src/tests/testCacheManager.cc
src/tests/testCacheManager.h [deleted file]
src/tests/testCharacterSet.cc
src/tests/testCharacterSet.h [deleted file]
src/tests/testConfigParser.cc
src/tests/testConfigParser.h [deleted file]
src/tests/testDiskIO.cc
src/tests/testDiskIO.h [deleted file]
src/tests/testEnumIterator.cc
src/tests/testEnumIterator.h [deleted file]
src/tests/testEvent.cc
src/tests/testEvent.h [deleted file]
src/tests/testEventLoop.cc
src/tests/testEventLoop.h [deleted file]
src/tests/testHttp1Parser.cc
src/tests/testHttp1Parser.h [deleted file]
src/tests/testHttpReply.cc
src/tests/testHttpReply.h [deleted file]
src/tests/testHttpRequest.cc
src/tests/testHttpRequest.h [deleted file]
src/tests/testHttpRequestMethod.cc
src/tests/testHttpRequestMethod.h [deleted file]
src/tests/testIcmp.cc
src/tests/testIcmp.h [deleted file]
src/tests/testIpAddress.cc
src/tests/testIpAddress.h [deleted file]
src/tests/testLookupTable.cc
src/tests/testLookupTable.h [deleted file]
src/tests/testMem.cc
src/tests/testMem.h [deleted file]
src/tests/testNetDb.cc
src/tests/testNetDb.h [deleted file]
src/tests/testPackableStream.cc
src/tests/testPackableStream.h [deleted file]
src/tests/testRFC1035.cc
src/tests/testRFC1035.h [deleted file]
src/tests/testRefCount.cc
src/tests/testRefCount.h [deleted file]
src/tests/testRock.cc
src/tests/testRock.h [deleted file]
src/tests/testSBuf.cc
src/tests/testSBuf.h [deleted file]
src/tests/testSBufList.cc
src/tests/testSBufList.h [deleted file]
src/tests/testStatHist.cc
src/tests/testStatHist.h [deleted file]
src/tests/testStoreController.cc
src/tests/testStoreController.h [deleted file]
src/tests/testStoreHashIndex.cc
src/tests/testStoreHashIndex.h [deleted file]
src/tests/testString.cc
src/tests/testString.h [deleted file]
src/tests/testTokenizer.cc
src/tests/testTokenizer.h [deleted file]
src/tests/testURL.cc
src/tests/testURL.h [deleted file]
src/tests/testUfs.cc
src/tests/testUfs.h [deleted file]
src/tests/testUriScheme.cc
src/tests/testUriScheme.h [deleted file]
src/tests/testYesNoNone.cc
src/tests/testYesNoNone.h [deleted file]

index 8d23b31bc41622da8dcf94464ec7eb0323d2918e..88541c502ed1ad5d2f1c54ca426eb729a13a34e3 100644 (file)
@@ -90,8 +90,7 @@ check_PROGRAMS += testPreCompiler
 TESTS += testPreCompiler
 
 testPreCompiler_SOURCES = \
-       testPreCompiler.cc \
-       testPreCompiler.h
+       testPreCompiler.cc
 testPreCompiler_LDADD= $(LIBCPPUNIT_LIBS)
 testPreCompiler_LDFLAGS=
 
index 8b6b0734750b218410a5dee9c2386386bcc87e4b..2a76fb4e83102c148a04f5b5f76ebb2415f65e39 100644 (file)
@@ -7,12 +7,29 @@
  */
 
 #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.
diff --git a/compat/testPreCompiler.h b/compat/testPreCompiler.h
deleted file mode 100644 (file)
index 7906dfb..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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 */
-
index 3d0b929c8e091a425f68ca1984b024c07ed3a46b..976cdae2ac9ba5da26698fc3d5d1a721fd63c20a 100644 (file)
@@ -74,8 +74,7 @@ TESTS += tests/testRFC1738
 check_PROGRAMS += tests/testRFC1738
 
 tests_testRFC1738_SOURCES = \
-       tests/testRFC1738.cc \
-       tests/testRFC1738.h
+       tests/testRFC1738.cc
 
 tests_testRFC1738_LDADD= \
        $(top_builddir)/lib/libmiscencoding.la \
index 5fc5d8606039a00fc95c34cff3aa3d90c01472aa..93d715783cae861ee1b9f96e399c91c487ab3838 100644 (file)
@@ -7,15 +7,35 @@
  */
 
 #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()
diff --git a/lib/tests/testRFC1738.h b/lib/tests/testRFC1738.h
deleted file mode 100644 (file)
index eedae79..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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 */
-
index 9cf56dfcba2a7fdbf1cbff128d88fd4f4c671c0b..c6b84867c989c4530d157fc91e01fa7f20d3e424 100644 (file)
@@ -785,8 +785,7 @@ tests_testRandomUuid_LDFLAGS = $(LIBADD_DL)
 
 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 = \
@@ -801,8 +800,7 @@ tests_testMem_LDFLAGS = $(LIBADD_DL)
 
 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 = \
@@ -828,8 +826,7 @@ tests_testClpMap_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 = \
@@ -840,8 +837,7 @@ tests_testEnumIterator_LDFLAGS = $(LIBADD_DL)
 
 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 \
@@ -856,8 +852,7 @@ tests_testLookupTable_LDFLAGS = $(LIBADD_DL)
 
 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 = \
@@ -868,8 +863,7 @@ tests_testRefCount_LDFLAGS = $(LIBADD_DL)
 
 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 \
@@ -886,9 +880,7 @@ tests_testYesNoNone_LDFLAGS = $(LIBADD_DL)
 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 \
@@ -919,8 +911,7 @@ tests_testURL_LDFLAGS = $(LIBADD_DL)
 
 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 \
@@ -933,8 +924,7 @@ tests_testDns_LDFLAGS = $(LIBADD_DL)
 
 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 \
@@ -954,7 +944,6 @@ tests_testTokenizer_LDFLAGS = $(LIBADD_DL)
 check_PROGRAMS += tests/testSBuf
 tests_testSBuf_SOURCES = \
        tests/testSBuf.cc \
-       tests/testSBuf.h \
        tests/SBufFindTest.cc \
        tests/SBufFindTest.h
 nodist_tests_testSBuf_SOURCES = \
@@ -971,8 +960,7 @@ tests_testSBuf_LDFLAGS = $(LIBADD_DL)
 
 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 \
@@ -987,8 +975,7 @@ tests_testSBufList_LDFLAGS = $(LIBADD_DL)
 
 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 \
@@ -1054,7 +1041,6 @@ tests_testRock_SOURCES = \
        ResolvedPeers.cc \
        ResolvedPeers.h \
        tests/testRock.cc \
-       tests/testRock.h \
        StatCounters.cc \
        StatCounters.h \
        tests/stub_StatHist.cc \
@@ -1169,7 +1155,6 @@ tests_testRock_LDFLAGS = $(AM_CPPFLAGS) $(LIBADD_DL)
 else
 EXTRA_DIST += \
         tests/testRock.cc \
-        tests/testRock.h \
         tests/testStoreSupport.cc \
         tests/testStoreSupport.h
 endif
@@ -1238,7 +1223,6 @@ tests_testUfs_SOURCES = \
        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 \
@@ -1347,8 +1331,7 @@ tests_testUfs_LDADD = \
 tests_testUfs_LDFLAGS = $(LIBADD_DL)
 else
 EXTRA_DIST += \
-       tests/testUfs.cc \
-       tests/testUfs.h
+       tests/testUfs.cc
 endif
 
 ## Tests of store/* and Store objects
@@ -1393,7 +1376,6 @@ tests_testStore_SOURCES = \
        Notes.cc \
        Notes.h \
        tests/testPackableStream.cc \
-       tests/testPackableStream.h \
        Parsing.cc \
        tests/stub_Port.cc \
        RemovalPolicy.cc \
@@ -1406,10 +1388,8 @@ tests_testStore_SOURCES = \
        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 \
@@ -1531,7 +1511,6 @@ tests_testDiskIO_SOURCES = \
        ConfigOption.cc \
        ConfigParser.cc \
        tests/testDiskIO.cc \
-       tests/testDiskIO.h \
        tests/stub_ETag.cc \
        EventLoop.cc \
        FadingCounter.cc \
@@ -1696,8 +1675,7 @@ tests_testDiskIO_LDFLAGS = $(LIBADD_DL)
 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 \
@@ -1740,8 +1718,7 @@ tests_testACLMaxUserIP_LDADD = \
 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
@@ -1984,7 +1961,6 @@ check_PROGRAMS += tests/testHttp1Parser
 tests_testHttp1Parser_SOURCES = \
        tests/stub_HelperChildConfig.cc \
        tests/testHttp1Parser.cc \
-       tests/testHttp1Parser.h \
        MemBuf.cc \
        MemBuf.h \
        tests/stub_MemObject.cc \
@@ -2055,7 +2031,6 @@ tests_testHttpReply_SOURCES = \
        HttpReply.cc \
        tests/testHttpReply.cc \
        HttpReply.h \
-       tests/testHttpReply.h \
        tests/stub_HttpRequest.cc \
        MasterXaction.cc \
        MasterXaction.h \
@@ -2180,9 +2155,7 @@ tests_testHttpRequest_SOURCES = \
        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 \
@@ -2371,8 +2344,7 @@ tests_testHttpRequest_LDFLAGS = $(LIBADD_DL)
 
 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 \
@@ -2391,8 +2363,7 @@ tests_testIpAddress_LDFLAGS = $(LIBADD_DL)
 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 \
@@ -2410,8 +2381,7 @@ tests_testIcmp_LDFLAGS = $(LIBADD_DL)
 
 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 \
@@ -2444,7 +2414,6 @@ tests_testCacheManager_SOURCES = \
        tests/stub_CacheDigest.cc \
        CacheDigest.h \
        tests/testCacheManager.cc \
-       tests/testCacheManager.h \
        CachePeer.cc \
        CachePeer.h \
        ClientInfo.h \
@@ -2675,7 +2644,6 @@ tests_testStatHist_SOURCES = \
        StatHist.cc \
        tests/testStatHist.cc \
        StatHist.h \
-       tests/testStatHist.h \
        String.cc \
        tests/stub_cache_manager.cc \
        tests/stub_cbdata.cc \
@@ -2709,8 +2677,7 @@ tests_testStatHist_LDFLAGS = $(LIBADD_DL)
 
 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 \
@@ -2732,8 +2699,7 @@ tests_testConfigParser_LDFLAGS = $(LIBADD_DL)
 
 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 \
@@ -2753,8 +2719,7 @@ tests_testEvent_LDFLAGS = $(LIBADD_DL)
 
 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 \
index 8d3b2dd98bb15abd4a168e9244c5ab3f9bd02080..e2b610968b78ac7b5f84dd05cc4a1ead6b2facda 100644 (file)
 #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 */
diff --git a/src/tests/testACLMaxUserIP.h b/src/tests/testACLMaxUserIP.h
deleted file mode 100644 (file)
index 20bf242..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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 */
-
index 56887e161077d0ef096b1c3e4cfebd5476f9bb7c..e387f37cdc88e56b30ac2ec3333570f6a3bae46e 100644 (file)
@@ -14,6 +14,9 @@
 /*
  * 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
index d8d9bfaac6bb48b13dbd89c9e211b58c8373f0dc..853bdcdb5eeeb63fec060292a6718d70767b47e4 100644 (file)
@@ -9,12 +9,32 @@
 #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 );
 
diff --git a/src/tests/testCacheManager.h b/src/tests/testCacheManager.h
deleted file mode 100644 (file)
index 08a98af..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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
-
index 61e125b700ab06f1d1fc04626b7a7ecb8b9de53e..faddaabd24db10cc308d5096875e0cfd31d3b14e 100644 (file)
@@ -8,11 +8,33 @@
 
 #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
diff --git a/src/tests/testCharacterSet.h b/src/tests/testCharacterSet.h
deleted file mode 100644 (file)
index b2286ea..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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 */
-
index f896b4324ce1df2fbc4908a9602d6a54cd995658..40804c71351833626730d33b69df9ec881e6673f 100644 (file)
@@ -7,11 +7,29 @@
  */
 
 #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;
diff --git a/src/tests/testConfigParser.h b/src/tests/testConfigParser.h
deleted file mode 100644 (file)
index f47de6a..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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
-
index b6a1279b032ecc74d1bd59121d1d381690b7e51f..b158e2cc1f358540588136113312aa3e67aa9f0b 100644 (file)
@@ -7,18 +7,35 @@
  */
 
 #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
diff --git a/src/tests/testDiskIO.h b/src/tests/testDiskIO.h
deleted file mode 100644 (file)
index 6015f05..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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
-
index 4d623ec12cc8f2b19c99fc1d4dc3469d641a80b7..a36eb827625d95e5e4daced352468a9983e2a39f 100644 (file)
@@ -7,11 +7,32 @@
  */
 
 #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 {
diff --git a/src/tests/testEnumIterator.h b/src/tests/testEnumIterator.h
deleted file mode 100644 (file)
index a3c32fe..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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_ */
-
index ae4b750198f7ed6afa249b24a40bcc2756b9249d..7bf8178ed6b544edf233ca93359eae22a291c117 100644 (file)
@@ -8,11 +8,38 @@
 
 #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 */
diff --git a/src/tests/testEvent.h b/src/tests/testEvent.h
deleted file mode 100644 (file)
index d91431c..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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
-
index 782b9612b85f94cce90da697def0045e2d217deb..91792a2c149cf8fdf4c15ed92ac27901cd5d1b2f 100644 (file)
@@ -8,13 +8,41 @@
 
 #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
diff --git a/src/tests/testEventLoop.h b/src/tests/testEventLoop.h
deleted file mode 100644 (file)
index 28e99c9..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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
-
index 7a23b396b28113860dcc0ee166cbc155c9b64617..1c7331069c5d10734f4627477b0130f0d735cfc0 100644 (file)
 #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
diff --git a/src/tests/testHttp1Parser.h b/src/tests/testHttp1Parser.h
deleted file mode 100644 (file)
index ba53e64..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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
-
index ec28c57a6738a6ed412d1a60550522123c8ae3c1..5730b68da882e6844ee2a31b42e8bf07f487c0ee 100644 (file)
@@ -9,13 +9,26 @@
 #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;
diff --git a/src/tests/testHttpReply.h b/src/tests/testHttpReply.h
deleted file mode 100644 (file)
index 152b294..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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
-
index 446993ac25406c0a8abae84bd9002267e66f29c6..c07821e18ccab78a9c351b1d244d9238e85fed09 100644 (file)
@@ -7,16 +7,32 @@
  */
 
 #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 */
diff --git a/src/tests/testHttpRequest.h b/src/tests/testHttpRequest.h
deleted file mode 100644 (file)
index 9c03e27..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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
-
index 8f781b01702afc16cdb0f30e7ac932381d0d4e66..8d36ed9862949b0f133a2492fb11fffe86ab960f 100644 (file)
@@ -7,14 +7,39 @@
  */
 
 #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 );
 
 /*
diff --git a/src/tests/testHttpRequestMethod.h b/src/tests/testHttpRequestMethod.h
deleted file mode 100644 (file)
index 7f47fb0..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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
-
index 5b93c739cc12effc58d83f4d90b94403b61fad51..d6885af74efbbb7e9119a3281b20eb166e886104 100644 (file)
@@ -9,11 +9,50 @@
 #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
diff --git a/src/tests/testIcmp.h b/src/tests/testIcmp.h
deleted file mode 100644 (file)
index 5cdda1c..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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 */
-
index bb2cef4d764ec3a3cf9ffa2c6b35cfb6d03f0086..9b5d5c970dfe48e4b8317f7295201efa2a68fe29 100644 (file)
@@ -7,9 +7,9 @@
  */
 
 #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
diff --git a/src/tests/testIpAddress.h b/src/tests/testIpAddress.h
deleted file mode 100644 (file)
index 97d1cac..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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 */
-
index 306889d247e50ecb0d180698be4baf9ae4fe39d3..337fb0d6e078dea1fe00cf2460c129a655a2f6aa 100644 (file)
@@ -8,10 +8,19 @@
 
 #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,
diff --git a/src/tests/testLookupTable.h b/src/tests/testLookupTable.h
deleted file mode 100644 (file)
index c1da774..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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_ */
-
index 9fd69ee2df9888bb6f859b2cbef7eb97c6fedb92..ba8f5dcfcafcca93ff566c9c2a8fe18fef811abd 100644 (file)
@@ -7,15 +7,28 @@
  */
 
 #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
 {
diff --git a/src/tests/testMem.h b/src/tests/testMem.h
deleted file mode 100644 (file)
index 83f1ee6..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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 */
-
index 03a9419af7382ffba5f8e556fbf3b166d0269999..26373e2efdbf3d0359bfeffeab3952fb7e71d875 100644 (file)
@@ -7,11 +7,21 @@
  */
 
 #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 );
 
diff --git a/src/tests/testNetDb.h b/src/tests/testNetDb.h
deleted file mode 100644 (file)
index ca6839c..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 */
-
index 769b76ff45353b72552074170efe01dfa6c6686d..8df7758627f7b3999cc27d7db678e7dc47ea141f 100644 (file)
@@ -9,13 +9,26 @@
 #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 */
diff --git a/src/tests/testPackableStream.h b/src/tests/testPackableStream.h
deleted file mode 100644 (file)
index 5549874..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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 */
-
index 0caefaeb0441fa2e36c775bed422f6aaebcac1e5..0a23323fcbd656b86057a732d947b61e093f5610 100644 (file)
@@ -7,11 +7,35 @@
  */
 
 #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 );
 
diff --git a/src/tests/testRFC1035.h b/src/tests/testRFC1035.h
deleted file mode 100644 (file)
index f4621bd..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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 */
-
index 08dd2b520602e281f45225a4681173699ec6fbff..f463f1aa4f5952d6d115c590eb099148000add02 100644 (file)
 
 #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
diff --git a/src/tests/testRefCount.h b/src/tests/testRefCount.h
deleted file mode 100644 (file)
index a42a185..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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
-
index 859594f3076e6f4bc054f288d36ccf7d72f95378..69c15875ce701b26034f95df127ff31a75768bcf 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include "squid.h"
+#include "compat/cppunit.h"
 #include "ConfigParser.h"
 #include "DiskIO/DiskIOModule.h"
 #include "fde.h"
@@ -22,7 +23,6 @@
 #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;
 
diff --git a/src/tests/testRock.h b/src/tests/testRock.h
deleted file mode 100644 (file)
index cf3d322..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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 */
-
index acfb9bd0807ab92c668c83de9013fd4421865395..75794ae7877a279f91dd4545e75204b78e82ee03 100644 (file)
 
 #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)
 {}
diff --git a/src/tests/testSBuf.h b/src/tests/testSBuf.h
deleted file mode 100644 (file)
index 3b66acc..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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
-
index ec05c5b970bd5d6631c2132e25c46871310de9e0..dc9f38ac687acae1ac25f9faf3ba254c49e83bc7 100644 (file)
@@ -7,11 +7,22 @@
  */
 
 #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");
diff --git a/src/tests/testSBufList.h b/src/tests/testSBufList.h
deleted file mode 100644 (file)
index a22e39e..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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
-
index 5e71c55e776ef2a7b82c9d282862ed5dc1596eba..0ba18753ff2a1b4e9931b72da341fd2186db8e39 100644 (file)
@@ -7,10 +7,26 @@
  */
 
 #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 {
diff --git a/src/tests/testStatHist.h b/src/tests/testStatHist.h
deleted file mode 100644 (file)
index c498579..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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_ */
-
index ff528f135f48d7d41a03b0190b97bfb3b980d51c..39596b948dbab0ae93765dbcb8d9f5df43cef68f 100644 (file)
@@ -7,15 +7,33 @@
  */
 
 #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)
diff --git a/src/tests/testStoreController.h b/src/tests/testStoreController.h
deleted file mode 100644 (file)
index 5a5bcde..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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
-
index 7ddf48f66767535e1f6fc924406e0402c4d2d739..2349d4c86e757ec354317dd980a2ca974d3489a0 100644 (file)
@@ -7,15 +7,33 @@
  */
 
 #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)
diff --git a/src/tests/testStoreHashIndex.h b/src/tests/testStoreHashIndex.h
deleted file mode 100644 (file)
index 0e70fc3..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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
-
index 2af7b74eda7272f39e6aeba1b44e221ec0c01be7..fad4dfff720898f8bc466f27a86f97a0bd98a288 100644 (file)
@@ -7,12 +7,35 @@
  */
 
 #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 */
 
diff --git a/src/tests/testString.h b/src/tests/testString.h
deleted file mode 100644 (file)
index 2d17627..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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
-
index dcf0709bcb11ff672f65d95f46ac49f51aa126e1..27b64591b2f0a65fa9d6778867a0851ef77f17b8 100644 (file)
@@ -8,11 +8,30 @@
 
 #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"
diff --git a/src/tests/testTokenizer.h b/src/tests/testTokenizer.h
deleted file mode 100644 (file)
index c0d519a..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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_ */
-
index c18618d8b891da80ec78386e61fa5e28923c1ac9..6b5b57f183ad25d8625767b65a6f3ffb8223e2e7 100644 (file)
@@ -8,16 +8,33 @@
 
 #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 */
 
diff --git a/src/tests/testURL.h b/src/tests/testURL.h
deleted file mode 100644 (file)
index dc097ab..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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
-
index e094aef0f0bc0b6e8c5e6fe2cb09eb2de76b470c..659d224c570e757b2d78b456d6c694bbc81294ce 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #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 */
diff --git a/src/tests/testUfs.h b/src/tests/testUfs.h
deleted file mode 100644 (file)
index 07c244f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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
-
index 960c054dc7e312a9eec6bb94a8210a3f64aa8ad1..0b2f54d8252dc49060bf63cd8a9042ece2b5af0f 100644 (file)
@@ -8,14 +8,43 @@
 
 #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
diff --git a/src/tests/testUriScheme.h b/src/tests/testUriScheme.h
deleted file mode 100644 (file)
index 0b9157c..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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
-
index 0a7233551cd62cf8055cd1a6560f8d0c2b2acaf7..1f7b05880aef7bd5e86de14a36ec63c5517db887 100644 (file)
@@ -8,12 +8,28 @@
 
 #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()
diff --git a/src/tests/testYesNoNone.h b/src/tests/testYesNoNone.h
deleted file mode 100644 (file)
index 8b79757..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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 */
-