From: gkinkie@gmail.com Date: Sat, 25 Feb 2023 11:53:17 +0000 (+0000) Subject: Maintenance: Change unit test class names to CamelCase (#1288) X-Git-Tag: SQUID_7_0_1~478 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41e9c9f078b45aac6ad49fa93020a862bc278b9b;p=thirdparty%2Fsquid.git Maintenance: Change unit test class names to CamelCase (#1288) Besides applying Project CamelCase class naming rules to all CppUnit test class names, these script-driven changes also adjust affected class name-dependent code, improve consistency across unit test declarations a little, and rename a few test classes (e.g. testURL is not TestUri). The corresponding source code filenames are left unchanged (for now). --- diff --git a/compat/testPreCompiler.cc b/compat/testPreCompiler.cc index a5b807bd50..8b6b073475 100644 --- a/compat/testPreCompiler.cc +++ b/compat/testPreCompiler.cc @@ -12,7 +12,7 @@ #include -CPPUNIT_TEST_SUITE_REGISTRATION( testPreCompiler ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestPreCompiler ); /** * Test several ways of defining pre-compiler directives. @@ -20,7 +20,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION( testPreCompiler ); * These tests ensure that the inputs will work as expected. */ void -testPreCompiler::testIfDef() +TestPreCompiler::testIfDef() { /* Defined to explicit value 1 should be true */ #define ONE_FOO 1 @@ -77,7 +77,7 @@ testPreCompiler::testIfDef() * when undefined macros are used in && conditions */ void -testPreCompiler::testIfDefAnd() +TestPreCompiler::testIfDefAnd() { /* Not Defined to exist at all == false - when used in a compound if */ #undef UNDEFINED_FOO @@ -130,7 +130,7 @@ testPreCompiler::testIfDefAnd() * when undefined macros are used in || conditions */ void -testPreCompiler::testIfDefOr() +TestPreCompiler::testIfDefOr() { /* Not Defined to exist at all == false - when used in a compound if */ #undef UNDEFINED_FOO diff --git a/compat/testPreCompiler.h b/compat/testPreCompiler.h index 400808cc48..7906dfb478 100644 --- a/compat/testPreCompiler.h +++ b/compat/testPreCompiler.h @@ -15,9 +15,9 @@ * Test the pre-compiler directives used within Squid code actually work. */ -class testPreCompiler : public CPPUNIT_NS::TestFixture +class TestPreCompiler: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testPreCompiler ); + CPPUNIT_TEST_SUITE( TestPreCompiler ); CPPUNIT_TEST( testIfDef ); CPPUNIT_TEST( testIfDefAnd ); CPPUNIT_TEST( testIfDefOr ); diff --git a/lib/tests/testRFC1738.cc b/lib/tests/testRFC1738.cc index 3bf16c0b19..5fc5d86060 100644 --- a/lib/tests/testRFC1738.cc +++ b/lib/tests/testRFC1738.cc @@ -15,10 +15,10 @@ /* 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 ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestRfc1738 ); /* Regular Format de-coding tests */ -void testRFC1738::testUrlDecode() +void TestRfc1738::testUrlDecode() { char *unescaped_str; @@ -87,7 +87,7 @@ void testRFC1738::testUrlDecode() * rfc1738_escape_unescaped == -1 * rfc1738_escape_part == 1 */ -void testRFC1738::testUrlEncode() +void TestRfc1738::testUrlEncode() { char *result; @@ -124,7 +124,7 @@ void testRFC1738::testUrlEncode() } /** SECURITY BUG TESTS: avoid null truncation attacks by skipping %00 bytes */ -void testRFC1738::PercentZeroNullDecoding() +void TestRfc1738::PercentZeroNullDecoding() { char *unescaped_str; diff --git a/lib/tests/testRFC1738.h b/lib/tests/testRFC1738.h index b0ed74851c..eedae79593 100644 --- a/lib/tests/testRFC1738.h +++ b/lib/tests/testRFC1738.h @@ -14,9 +14,9 @@ /** * Test the URL coder RFC 1738 Engine */ -class testRFC1738 : public CPPUNIT_NS::TestFixture +class TestRfc1738: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testRFC1738 ); + CPPUNIT_TEST_SUITE( TestRfc1738 ); CPPUNIT_TEST( testUrlDecode ); CPPUNIT_TEST( testUrlEncode ); diff --git a/src/tests/SBufFindTest.cc b/src/tests/SBufFindTest.cc index f26efa587b..cefc3b7e1d 100644 --- a/src/tests/SBufFindTest.cc +++ b/src/tests/SBufFindTest.cc @@ -62,7 +62,7 @@ SBufFindTest::run() // the special npos value is not tested as the behavior is // different from std::string (where the behavior is undefined) - // It is ad-hoc tested in testSBuf instead + // It is ad-hoc tested in TestSBuf instead //thePos = SBuf::npos; //testAllMethods(); } diff --git a/src/tests/stub_MemObject.cc b/src/tests/stub_MemObject.cc index 60430a92d8..2be51b6ee5 100644 --- a/src/tests/stub_MemObject.cc +++ b/src/tests/stub_MemObject.cc @@ -22,7 +22,7 @@ RemovalPolicy * mem_policy = nullptr; int64_t MemObject::endOffset() const { - // XXX: required by testStore + // XXX: required by TestStore return data_hdr.endOffset(); } diff --git a/src/tests/stub_tools.cc b/src/tests/stub_tools.cc index b273d62e12..338de5053c 100644 --- a/src/tests/stub_tools.cc +++ b/src/tests/stub_tools.cc @@ -7,7 +7,7 @@ */ #include "squid.h" -// XXX: need src/ to avoid clashes with ip/tools.h in testIpAddress +// XXX: need src/ to avoid clashes with ip/tools.h in TestIpAddress #include "src/tools.h" #define STUB_API "tools.cc" diff --git a/src/tests/testACLMaxUserIP.cc b/src/tests/testACLMaxUserIP.cc index 4164c02ffc..8d3b2dd98b 100644 --- a/src/tests/testACLMaxUserIP.cc +++ b/src/tests/testACLMaxUserIP.cc @@ -19,13 +19,13 @@ #include -CPPUNIT_TEST_SUITE_REGISTRATION( testACLMaxUserIP ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestACLMaxUserIP ); /* globals required to resolve link issues */ AnyP::PortCfgPointer HttpPortList; void -testACLMaxUserIP::testDefaults() +TestACLMaxUserIP::testDefaults() { ACLMaxUserIP anACL("max_user_ip"); /* 0 is not a valid maximum, so we start at 0 */ @@ -37,14 +37,14 @@ testACLMaxUserIP::testDefaults() } void -testACLMaxUserIP::setUp() +TestACLMaxUserIP::setUp() { CPPUNIT_NS::TestFixture::setUp(); Acl::RegisterMaker("max_user_ip", [](Acl::TypeName name)->ACL* { return new ACLMaxUserIP(name); }); } void -testACLMaxUserIP::testParseLine() +TestACLMaxUserIP::testParseLine() { /* a config line to pass with a lead-in token to seed the parser. */ char * line = xstrdup("test max_user_ip -s 1"); diff --git a/src/tests/testACLMaxUserIP.h b/src/tests/testACLMaxUserIP.h index 103abe7ea1..20bf242c02 100644 --- a/src/tests/testACLMaxUserIP.h +++ b/src/tests/testACLMaxUserIP.h @@ -15,12 +15,12 @@ /* * demonstration test file, as new idioms are made they will - * be shown in the testBoilerplate source. + * be shown in the TestBoilerplate source. */ -class testACLMaxUserIP : public CPPUNIT_NS::TestFixture +class TestACLMaxUserIP: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testACLMaxUserIP ); + CPPUNIT_TEST_SUITE( TestACLMaxUserIP ); /* note the statement here and then the actual prototype below */ CPPUNIT_TEST( testDefaults ); CPPUNIT_TEST( testParseLine ); diff --git a/src/tests/testAuth.cc b/src/tests/testAuth.cc index b0e4e74012..e9da1ded83 100644 --- a/src/tests/testAuth.cc +++ b/src/tests/testAuth.cc @@ -17,25 +17,25 @@ #include "testAuth.h" #include "unitTestMain.h" -CPPUNIT_TEST_SUITE_REGISTRATION( testAuth ); -CPPUNIT_TEST_SUITE_REGISTRATION( testAuthConfig ); -CPPUNIT_TEST_SUITE_REGISTRATION( testAuthUserRequest ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestAuth ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestAuthConfig ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestAuthUserRequest ); #if HAVE_AUTH_MODULE_BASIC -CPPUNIT_TEST_SUITE_REGISTRATION( testAuthBasicUserRequest ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestAuthBasicUserRequest ); #endif #if HAVE_AUTH_MODULE_DIGEST -CPPUNIT_TEST_SUITE_REGISTRATION( testAuthDigestUserRequest ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestAuthDigestUserRequest ); #endif #if HAVE_AUTH_MODULE_NTLM -CPPUNIT_TEST_SUITE_REGISTRATION( testAuthNTLMUserRequest ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestAuthNtlmUserRequest ); #endif #if HAVE_AUTH_MODULE_NEGOTIATE -CPPUNIT_TEST_SUITE_REGISTRATION( testAuthNegotiateUserRequest ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestAuthNegotiateUserRequest ); #endif /* Instantiate all auth framework types */ void -testAuth::instantiate() +TestAuth::instantiate() {} char const * stub_config="auth_param digest program /home/robertc/install/squid/libexec/digest_pw_auth /home/robertc/install/squid/etc/digest.pwd\n" @@ -160,7 +160,7 @@ fake_auth_setup() * authentication types */ void -testAuthConfig::create() +TestAuthConfig::create() { Debug::Levels[29]=9; fake_auth_setup(); @@ -177,7 +177,7 @@ testAuthConfig::create() * authentication types */ void -testAuthUserRequest::scheme() +TestAuthUserRequest::scheme() { Debug::Levels[29]=9; fake_auth_setup(); @@ -196,7 +196,7 @@ testAuthUserRequest::scheme() /* AuthBasicUserRequest::AuthBasicUserRequest works */ void -testAuthBasicUserRequest::construction() +TestAuthBasicUserRequest::construction() { AuthBasicUserRequest(); AuthBasicUserRequest *temp=new AuthBasicUserRequest(); @@ -204,7 +204,7 @@ testAuthBasicUserRequest::construction() } void -testAuthBasicUserRequest::username() +TestAuthBasicUserRequest::username() { AuthUserRequest::Pointer temp = new AuthBasicUserRequest(); Auth::Basic::User *basic_auth=new Auth::Basic::User(Auth::Config::Find("basic")); @@ -220,7 +220,7 @@ testAuthBasicUserRequest::username() /* AuthDigestUserRequest::AuthDigestUserRequest works */ void -testAuthDigestUserRequest::construction() +TestAuthDigestUserRequest::construction() { AuthDigestUserRequest(); AuthDigestUserRequest *temp=new AuthDigestUserRequest(); @@ -228,7 +228,7 @@ testAuthDigestUserRequest::construction() } void -testAuthDigestUserRequest::username() +TestAuthDigestUserRequest::username() { AuthUserRequest::Pointer temp = new AuthDigestUserRequest(); Auth::Digest::User *duser=new Auth::Digest::User(Auth::Config::Find("digest")); @@ -244,7 +244,7 @@ testAuthDigestUserRequest::username() /* AuthNTLMUserRequest::AuthNTLMUserRequest works */ void -testAuthNTLMUserRequest::construction() +TestAuthNtlmUserRequest::construction() { AuthNTLMUserRequest(); AuthNTLMUserRequest *temp=new AuthNTLMUserRequest(); @@ -252,7 +252,7 @@ testAuthNTLMUserRequest::construction() } void -testAuthNTLMUserRequest::username() +TestAuthNtlmUserRequest::username() { AuthUserRequest::Pointer temp = new AuthNTLMUserRequest(); Auth::Ntlm::User *nuser=new Auth::Ntlm::User(Auth::Config::Find("ntlm")); @@ -268,7 +268,7 @@ testAuthNTLMUserRequest::username() /* AuthNegotiateUserRequest::AuthNegotiateUserRequest works */ void -testAuthNegotiateUserRequest::construction() +TestAuthNegotiateUserRequest::construction() { AuthNegotiateUserRequest(); AuthNegotiateUserRequest *temp=new AuthNegotiateUserRequest(); @@ -276,7 +276,7 @@ testAuthNegotiateUserRequest::construction() } void -testAuthNegotiateUserRequest::username() +TestAuthNegotiateUserRequest::username() { AuthUserRequest::Pointer temp = new AuthNegotiateUserRequest(); Auth::Negotiate::User *nuser=new Auth::Negotiate::User(Auth::Config::Find("negotiate")); diff --git a/src/tests/testAuth.h b/src/tests/testAuth.h index cab3ba889f..cfa14f2d4c 100644 --- a/src/tests/testAuth.h +++ b/src/tests/testAuth.h @@ -17,9 +17,9 @@ * test the auth Config framework */ -class testAuth : public CPPUNIT_NS::TestFixture +class TestAuth: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testAuth ); + CPPUNIT_TEST_SUITE( TestAuth ); CPPUNIT_TEST( instantiate ); CPPUNIT_TEST_SUITE_END(); @@ -29,9 +29,9 @@ protected: void instantiate(); }; -class testAuthConfig : public CPPUNIT_NS::TestFixture +class TestAuthConfig: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testAuthConfig ); + CPPUNIT_TEST_SUITE( TestAuthConfig ); CPPUNIT_TEST( create ); CPPUNIT_TEST_SUITE_END(); @@ -41,9 +41,9 @@ protected: void create(); }; -class testAuthUserRequest : public CPPUNIT_NS::TestFixture +class TestAuthUserRequest: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testAuthUserRequest ); + CPPUNIT_TEST_SUITE( TestAuthUserRequest ); CPPUNIT_TEST( scheme ); CPPUNIT_TEST_SUITE_END(); @@ -56,9 +56,9 @@ protected: #if HAVE_AUTH_MODULE_BASIC #include "auth/basic/UserRequest.h" -class testAuthBasicUserRequest : public CPPUNIT_NS::TestFixture +class TestAuthBasicUserRequest: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testAuthBasicUserRequest ); + CPPUNIT_TEST_SUITE( TestAuthBasicUserRequest ); CPPUNIT_TEST( construction ); CPPUNIT_TEST( username ); CPPUNIT_TEST_SUITE_END(); @@ -73,9 +73,9 @@ protected: #if HAVE_AUTH_MODULE_DIGEST #include "auth/digest/UserRequest.h" -class testAuthDigestUserRequest : public CPPUNIT_NS::TestFixture +class TestAuthDigestUserRequest: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testAuthDigestUserRequest ); + CPPUNIT_TEST_SUITE( TestAuthDigestUserRequest ); CPPUNIT_TEST( construction ); CPPUNIT_TEST( username ); CPPUNIT_TEST_SUITE_END(); @@ -90,9 +90,9 @@ protected: #if HAVE_AUTH_MODULE_NTLM #include "auth/ntlm/UserRequest.h" -class testAuthNTLMUserRequest : public CPPUNIT_NS::TestFixture +class TestAuthNtlmUserRequest: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testAuthNTLMUserRequest ); + CPPUNIT_TEST_SUITE( TestAuthNtlmUserRequest ); CPPUNIT_TEST( construction ); CPPUNIT_TEST( username ); CPPUNIT_TEST_SUITE_END(); @@ -107,9 +107,9 @@ protected: #if HAVE_AUTH_MODULE_NEGOTIATE #include "auth/negotiate/UserRequest.h" -class testAuthNegotiateUserRequest : public CPPUNIT_NS::TestFixture +class TestAuthNegotiateUserRequest: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testAuthNegotiateUserRequest ); + CPPUNIT_TEST_SUITE( TestAuthNegotiateUserRequest ); CPPUNIT_TEST( construction ); CPPUNIT_TEST( username ); CPPUNIT_TEST_SUITE_END(); diff --git a/src/tests/testBoilerplate.cc b/src/tests/testBoilerplate.cc index cf4ed87c45..07e23f798f 100644 --- a/src/tests/testBoilerplate.cc +++ b/src/tests/testBoilerplate.cc @@ -12,10 +12,10 @@ #include -CPPUNIT_TEST_SUITE_REGISTRATION( testBoilerplate ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestBoilerplate ); void -testBoilerplate::testDemonstration() +TestBoilerplate::testDemonstration() { CPPUNIT_ASSERT_EQUAL(0, 0); } diff --git a/src/tests/testBoilerplate.h b/src/tests/testBoilerplate.h index a7aa8d52f1..56887e1610 100644 --- a/src/tests/testBoilerplate.h +++ b/src/tests/testBoilerplate.h @@ -13,12 +13,12 @@ /* * demonstration test file, as new idioms are made they will - * be shown in the testBoilerplate source. + * be shown in the TestBoilerplate source. */ -class testBoilerplate : public CPPUNIT_NS::TestFixture +class TestBoilerplate: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testBoilerplate ); + CPPUNIT_TEST_SUITE( TestBoilerplate ); /* note the statement here and then the actual prototype below */ CPPUNIT_TEST( testDemonstration ); CPPUNIT_TEST_SUITE_END(); diff --git a/src/tests/testCacheManager.cc b/src/tests/testCacheManager.cc index 6503f4aff9..d8d9bfaac6 100644 --- a/src/tests/testCacheManager.cc +++ b/src/tests/testCacheManager.cc @@ -16,7 +16,7 @@ #include -CPPUNIT_TEST_SUITE_REGISTRATION( testCacheManager ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestCacheManager ); /// Provides test code access to CacheManager internal symbols class CacheManagerInternals : public CacheManager @@ -27,7 +27,7 @@ public: /* init memory pools */ -void testCacheManager::setUp() +void TestCacheManager::setUp() { Mem::Init(); AnyP::UriScheme::Init(); @@ -37,7 +37,7 @@ void testCacheManager::setUp() * Test creating a CacheManager */ void -testCacheManager::testCreate() +TestCacheManager::testCreate() { CacheManager::GetInstance(); //it's a singleton.. } @@ -53,7 +53,7 @@ dummy_action(StoreEntry * sentry) * registering an action makes it findable. */ void -testCacheManager::testRegister() +TestCacheManager::testRegister() { CacheManager *manager=CacheManager::GetInstance(); CPPUNIT_ASSERT(manager != nullptr); @@ -76,7 +76,7 @@ testCacheManager::testRegister() } void -testCacheManager::testParseUrl() +TestCacheManager::testParseUrl() { auto *mgr = static_cast(CacheManager::GetInstance()); CPPUNIT_ASSERT(mgr != nullptr); diff --git a/src/tests/testCacheManager.h b/src/tests/testCacheManager.h index 490f46ed05..08a98aff78 100644 --- a/src/tests/testCacheManager.h +++ b/src/tests/testCacheManager.h @@ -15,9 +15,9 @@ * test the CacheManager implementation */ -class testCacheManager : public CPPUNIT_NS::TestFixture +class TestCacheManager: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testCacheManager ); + CPPUNIT_TEST_SUITE( TestCacheManager ); CPPUNIT_TEST( testCreate ); CPPUNIT_TEST( testRegister ); CPPUNIT_TEST( testParseUrl ); diff --git a/src/tests/testCharacterSet.cc b/src/tests/testCharacterSet.cc index b82b1d4fee..61e125b700 100644 --- a/src/tests/testCharacterSet.cc +++ b/src/tests/testCharacterSet.cc @@ -13,10 +13,10 @@ #include -CPPUNIT_TEST_SUITE_REGISTRATION( testCharacterSet ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestCharacterSet ); void -testCharacterSet::CharacterSetConstruction() +TestCharacterSet::CharacterSetConstruction() { { CharacterSet t(nullptr,""); @@ -45,7 +45,7 @@ testCharacterSet::CharacterSetConstruction() } void -testCharacterSet::CharacterSetAdd() +TestCharacterSet::CharacterSetAdd() { CharacterSet t("test","0"); t.add(0); @@ -54,7 +54,7 @@ testCharacterSet::CharacterSetAdd() } void -testCharacterSet::CharacterSetAddRange() +TestCharacterSet::CharacterSetAddRange() { CharacterSet t("test",""); t.addRange('0','9'); @@ -65,7 +65,7 @@ testCharacterSet::CharacterSetAddRange() } void -testCharacterSet::CharacterSetConstants() +TestCharacterSet::CharacterSetConstants() { CPPUNIT_ASSERT_EQUAL(true,CharacterSet::ALPHA['a']); CPPUNIT_ASSERT_EQUAL(true,CharacterSet::ALPHA['z']); @@ -75,7 +75,7 @@ testCharacterSet::CharacterSetConstants() } void -testCharacterSet::CharacterSetUnion() +TestCharacterSet::CharacterSetUnion() { { CharacterSet hex("hex",""); @@ -94,7 +94,7 @@ testCharacterSet::CharacterSetUnion() } void -testCharacterSet::CharacterSetEqualityOp() +TestCharacterSet::CharacterSetEqualityOp() { CPPUNIT_ASSERT_EQUAL(CharacterSet::ALPHA, CharacterSet::ALPHA); CPPUNIT_ASSERT_EQUAL(CharacterSet::BIT, CharacterSet(nullptr,"01")); @@ -106,7 +106,7 @@ testCharacterSet::CharacterSetEqualityOp() } void -testCharacterSet::CharacterSetSubtract() +TestCharacterSet::CharacterSetSubtract() { CharacterSet sample(nullptr, "0123456789aAbBcCdDeEfFz"); diff --git a/src/tests/testCharacterSet.h b/src/tests/testCharacterSet.h index 4033e43544..b2286ead5e 100644 --- a/src/tests/testCharacterSet.h +++ b/src/tests/testCharacterSet.h @@ -11,9 +11,9 @@ #include "compat/cppunit.h" -class testCharacterSet : public CPPUNIT_NS::TestFixture +class TestCharacterSet: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testCharacterSet ); + CPPUNIT_TEST_SUITE( TestCharacterSet ); CPPUNIT_TEST( CharacterSetConstruction ); CPPUNIT_TEST( CharacterSetAdd ); CPPUNIT_TEST( CharacterSetAddRange ); diff --git a/src/tests/testConfigParser.cc b/src/tests/testConfigParser.cc index 60953a632c..f896b4324c 100644 --- a/src/tests/testConfigParser.cc +++ b/src/tests/testConfigParser.cc @@ -12,15 +12,15 @@ #include "tests/testConfigParser.h" #include "unitTestMain.h" -CPPUNIT_TEST_SUITE_REGISTRATION( testConfigParser); +CPPUNIT_TEST_SUITE_REGISTRATION( TestConfigParser ); int shutting_down = 0; -void testConfigParser::setUp() +void TestConfigParser::setUp() { } -bool testConfigParser::doParseQuotedTest(const char *s, const char *expectInterp) +bool TestConfigParser::doParseQuotedTest(const char *s, const char *expectInterp) { char cfgline[2048]; char cfgparam[2048]; @@ -54,7 +54,7 @@ bool testConfigParser::doParseQuotedTest(const char *s, const char *expectInterp return quotedOk && interpOk ; } -void testConfigParser::testParseQuoted() +void TestConfigParser::testParseQuoted() { // SingleToken CPPUNIT_ASSERT_EQUAL(true, doParseQuotedTest("SingleToken", "SingleToken")); diff --git a/src/tests/testConfigParser.h b/src/tests/testConfigParser.h index c3a18a4c79..f47de6ab15 100644 --- a/src/tests/testConfigParser.h +++ b/src/tests/testConfigParser.h @@ -15,9 +15,9 @@ * test the ConfigParser framework */ -class testConfigParser : public CPPUNIT_NS::TestFixture +class TestConfigParser: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testConfigParser ); + CPPUNIT_TEST_SUITE( TestConfigParser ); CPPUNIT_TEST( testParseQuoted ); CPPUNIT_TEST_SUITE_END(); diff --git a/src/tests/testDiskIO.cc b/src/tests/testDiskIO.cc index be8b75c285..b6a1279b03 100644 --- a/src/tests/testDiskIO.cc +++ b/src/tests/testDiskIO.cc @@ -19,17 +19,17 @@ #include -CPPUNIT_TEST_SUITE_REGISTRATION( testDiskIO ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestDiskIO ); void -testDiskIO::setUp() +TestDiskIO::setUp() { Mem::Init(); DiskIOModule::SetupAllModules(); } void -testDiskIO::testFindDefault() +TestDiskIO::testFindDefault() { DiskIOModule * module = DiskIOModule::FindDefault(); #if USE_DISKIO diff --git a/src/tests/testDiskIO.h b/src/tests/testDiskIO.h index 34cd6b545b..6015f05bdc 100644 --- a/src/tests/testDiskIO.h +++ b/src/tests/testDiskIO.h @@ -15,9 +15,9 @@ * test the DiskIO framework */ -class testDiskIO : public CPPUNIT_NS::TestFixture +class TestDiskIO: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testDiskIO ); + CPPUNIT_TEST_SUITE( TestDiskIO ); CPPUNIT_TEST( testFindDefault ); CPPUNIT_TEST_SUITE_END(); diff --git a/src/tests/testEnumIterator.cc b/src/tests/testEnumIterator.cc index 229c6ee2c4..4d623ec12c 100644 --- a/src/tests/testEnumIterator.cc +++ b/src/tests/testEnumIterator.cc @@ -12,7 +12,7 @@ #include -CPPUNIT_TEST_SUITE_REGISTRATION( testEnumIterator ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestEnumIterator ); enum class TestEnum { enumBegin_ = 0, @@ -35,7 +35,7 @@ enum class UnsignedTestEnum : unsigned char { }; void -testEnumIterator::testForwardIter() +TestEnumIterator::testForwardIter() { WholeEnum::iterator i = WholeEnum().begin(); CPPUNIT_ASSERT(*i == TestEnum::zero); @@ -52,7 +52,7 @@ testEnumIterator::testForwardIter() } void -testEnumIterator::testReverseIter() +TestEnumIterator::testReverseIter() { WholeEnum::reverse_iterator i = WholeEnum().rbegin(); CPPUNIT_ASSERT(*i == TestEnum::four); @@ -69,7 +69,7 @@ testEnumIterator::testReverseIter() } void -testEnumIterator::testBidirectionalIter() +TestEnumIterator::testBidirectionalIter() { WholeEnum::iterator i = WholeEnum().begin(); CPPUNIT_ASSERT(*i == TestEnum::zero); @@ -102,7 +102,7 @@ testEnumIterator::testBidirectionalIter() } void -testEnumIterator::testRangeFor() +TestEnumIterator::testRangeFor() { int j = 0; for (auto e : WholeEnum()) { @@ -115,7 +115,7 @@ testEnumIterator::testRangeFor() } void -testEnumIterator::testRangeForRange() +TestEnumIterator::testRangeForRange() { int j = 0; // free function-based range @@ -129,7 +129,7 @@ testEnumIterator::testRangeForRange() } void -testEnumIterator::testUnsignedEnum() +TestEnumIterator::testUnsignedEnum() { int j = 0; for (auto e = WholeEnum().rbegin(); e != WholeEnum().rend(); ++e ) { diff --git a/src/tests/testEnumIterator.h b/src/tests/testEnumIterator.h index e77d5190a7..a3c32fe8c4 100644 --- a/src/tests/testEnumIterator.h +++ b/src/tests/testEnumIterator.h @@ -13,9 +13,9 @@ #include "compat/cppunit.h" -class testEnumIterator : public CPPUNIT_NS::TestFixture +class TestEnumIterator: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testEnumIterator ); + CPPUNIT_TEST_SUITE( TestEnumIterator ); CPPUNIT_TEST( testForwardIter ); CPPUNIT_TEST( testReverseIter ); CPPUNIT_TEST( testBidirectionalIter ); diff --git a/src/tests/testEvent.cc b/src/tests/testEvent.cc index 35e0f96063..ae4b750198 100644 --- a/src/tests/testEvent.cc +++ b/src/tests/testEvent.cc @@ -13,12 +13,12 @@ #include "tests/testEvent.h" #include "unitTestMain.h" -CPPUNIT_TEST_SUITE_REGISTRATION( testEvent ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestEvent ); /* init legacy static-initialized modules */ void -testEvent::setUp() +TestEvent::setUp() { Mem::Init(); } @@ -27,7 +27,7 @@ testEvent::setUp() * Test creating a Scheduler */ void -testEvent::testCreate() +TestEvent::testCreate() { EventScheduler scheduler = EventScheduler(); } @@ -46,7 +46,7 @@ public: /* submit two callbacks, and cancel one, then dispatch and only the other should run. */ void -testEvent::testCancel() +TestEvent::testCancel() { EventScheduler scheduler; CalledEvent event; @@ -62,7 +62,7 @@ testEvent::testCancel() // submit two callbacks, and then dump the queue. void -testEvent::testDump() +TestEvent::testDump() { EventScheduler scheduler; CalledEvent event; @@ -114,7 +114,7 @@ testEvent::testDump() /* submit two callbacks, and find the right one. */ void -testEvent::testFind() +TestEvent::testFind() { EventScheduler scheduler; CalledEvent event; @@ -126,7 +126,7 @@ testEvent::testFind() /* do a trivial test of invoking callbacks */ void -testEvent::testCheckEvents() +TestEvent::testCheckEvents() { EventScheduler scheduler; CalledEvent event; @@ -147,7 +147,7 @@ testEvent::testCheckEvents() /* for convenience we have a singleton scheduler */ void -testEvent::testSingleton() +TestEvent::testSingleton() { EventScheduler *scheduler = dynamic_cast(EventScheduler::GetInstance()); CPPUNIT_ASSERT(nullptr != scheduler); diff --git a/src/tests/testEvent.h b/src/tests/testEvent.h index c3147238cc..d91431cb4c 100644 --- a/src/tests/testEvent.h +++ b/src/tests/testEvent.h @@ -15,9 +15,9 @@ * test the event module. */ -class testEvent : public CPPUNIT_NS::TestFixture +class TestEvent: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testEvent ); + CPPUNIT_TEST_SUITE( TestEvent ); CPPUNIT_TEST( testCreate ); CPPUNIT_TEST( testDump ); CPPUNIT_TEST( testFind ); diff --git a/src/tests/testEventLoop.cc b/src/tests/testEventLoop.cc index 03da6f37f8..782b9612b8 100644 --- a/src/tests/testEventLoop.cc +++ b/src/tests/testEventLoop.cc @@ -15,10 +15,10 @@ #include -CPPUNIT_TEST_SUITE_REGISTRATION( testEventLoop ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestEventLoop ); void -testEventLoop::testCreate() +TestEventLoop::testCreate() { EventLoop(); } @@ -43,7 +43,7 @@ public: * we do this with an instrumented async engine. */ void -testEventLoop::testRunOnce() +TestEventLoop::testRunOnce() { { /* trivial case - no engine, should quit immediately */ @@ -89,7 +89,7 @@ testEventLoop::testRunOnce() * tracked, and the lowest non-negative value given to the last engine. */ void -testEventLoop::testEngineTimeout() +TestEventLoop::testEngineTimeout() { EventLoop theLoop; RecordingEngine engineOne(5); @@ -108,7 +108,7 @@ testEventLoop::testEngineTimeout() * hard-coded into EventLoop::runOnce() */ void -testEventLoop::testEngineErrors() +TestEventLoop::testEngineErrors() { EventLoop theLoop; RecordingEngine failing_engine(AsyncEngine::EVENT_ERROR); @@ -137,7 +137,7 @@ public: }; void -testEventLoop::testSetTimeService() +TestEventLoop::testSetTimeService() { EventLoop theLoop; StubTime myTime; @@ -157,7 +157,7 @@ testEventLoop::testSetTimeService() * this defaults to the last added one, but can be explicitly nominated */ void -testEventLoop::testSetPrimaryEngine() +TestEventLoop::testSetPrimaryEngine() { EventLoop theLoop; RecordingEngine first_engine(10); diff --git a/src/tests/testEventLoop.h b/src/tests/testEventLoop.h index 939a7b9d6c..28e99c9a41 100644 --- a/src/tests/testEventLoop.h +++ b/src/tests/testEventLoop.h @@ -15,9 +15,9 @@ * test the EventLoop implementation */ -class testEventLoop : public CPPUNIT_NS::TestFixture +class TestEventLoop: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testEventLoop ); + CPPUNIT_TEST_SUITE( TestEventLoop ); CPPUNIT_TEST( testCreate ); CPPUNIT_TEST( testRunOnce ); CPPUNIT_TEST( testEngineTimeout ); diff --git a/src/tests/testHttp1Parser.cc b/src/tests/testHttp1Parser.cc index 087d394767..7a23b396b2 100644 --- a/src/tests/testHttp1Parser.cc +++ b/src/tests/testHttp1Parser.cc @@ -21,10 +21,10 @@ #include "testHttp1Parser.h" #include "unitTestMain.h" -CPPUNIT_TEST_SUITE_REGISTRATION( testHttp1Parser ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestHttp1Parser ); void -testHttp1Parser::globalSetup() +TestHttp1Parser::globalSetup() { static bool setup_done = false; if (setup_done) @@ -121,7 +121,7 @@ testResults(int line, const SBuf &input, Http1::RequestParser &output, struct re } void -testHttp1Parser::testParserConstruct() +TestHttp1Parser::testParserConstruct() { // whether the constructor works { @@ -150,7 +150,7 @@ testHttp1Parser::testParserConstruct() } void -testHttp1Parser::testParseRequestLineProtocols() +TestHttp1Parser::testParseRequestLineProtocols() { // ensure MemPools etc exist globalSetup(); @@ -432,7 +432,7 @@ testHttp1Parser::testParseRequestLineProtocols() } void -testHttp1Parser::testParseRequestLineStrange() +TestHttp1Parser::testParseRequestLineStrange() { // ensure MemPools etc exist globalSetup(); @@ -528,7 +528,7 @@ testHttp1Parser::testParseRequestLineStrange() } void -testHttp1Parser::testParseRequestLineTerminators() +TestHttp1Parser::testParseRequestLineTerminators() { // ensure MemPools etc exist globalSetup(); @@ -626,7 +626,7 @@ testHttp1Parser::testParseRequestLineTerminators() } void -testHttp1Parser::testParseRequestLineMethods() +TestHttp1Parser::testParseRequestLineMethods() { // ensure MemPools etc exist globalSetup(); @@ -880,7 +880,7 @@ testHttp1Parser::testParseRequestLineMethods() } void -testHttp1Parser::testParseRequestLineInvalid() +TestHttp1Parser::testParseRequestLineInvalid() { // ensure MemPools etc exist globalSetup(); @@ -1070,7 +1070,7 @@ testHttp1Parser::testParseRequestLineInvalid() } void -testHttp1Parser::testDripFeed() +TestHttp1Parser::testDripFeed() { // Simulate a client drip-feeding Squid a few bytes at a time. // extend the size of the buffer from 0 bytes to full request length diff --git a/src/tests/testHttp1Parser.h b/src/tests/testHttp1Parser.h index c7b67b4ea0..ba53e640b8 100644 --- a/src/tests/testHttp1Parser.h +++ b/src/tests/testHttp1Parser.h @@ -11,9 +11,9 @@ #include "compat/cppunit.h" -class testHttp1Parser : public CPPUNIT_NS::TestFixture +class TestHttp1Parser: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testHttp1Parser ); + CPPUNIT_TEST_SUITE( TestHttp1Parser ); // object basics are working, just in case. CPPUNIT_TEST( testParserConstruct ); CPPUNIT_TEST( testDripFeed ); diff --git a/src/tests/testHttpReply.cc b/src/tests/testHttpReply.cc index 05b7d7ae86..ec28c57a67 100644 --- a/src/tests/testHttpReply.cc +++ b/src/tests/testHttpReply.cc @@ -16,7 +16,7 @@ #include "testHttpReply.h" #include "unitTestMain.h" -CPPUNIT_TEST_SUITE_REGISTRATION( testHttpReply ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestHttpReply ); class SquidConfig Config; @@ -32,14 +32,14 @@ MemObject::endOffset() const /* end */ void -testHttpReply::setUp() +TestHttpReply::setUp() { Mem::Init(); httpHeaderInitModule(); } void -testHttpReply::testSanityCheckFirstLine() +TestHttpReply::testSanityCheckFirstLine() { MemBuf input; HttpReply engine; diff --git a/src/tests/testHttpReply.h b/src/tests/testHttpReply.h index 3d01f38ab4..152b294a4a 100644 --- a/src/tests/testHttpReply.h +++ b/src/tests/testHttpReply.h @@ -15,9 +15,9 @@ * test HttpReply */ -class testHttpReply : public CPPUNIT_NS::TestFixture +class TestHttpReply: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testHttpReply ); + CPPUNIT_TEST_SUITE( TestHttpReply ); CPPUNIT_TEST( testSanityCheckFirstLine ); CPPUNIT_TEST_SUITE_END(); diff --git a/src/tests/testHttpRequest.cc b/src/tests/testHttpRequest.cc index 1fda137a3f..fb4b689cf3 100644 --- a/src/tests/testHttpRequest.cc +++ b/src/tests/testHttpRequest.cc @@ -17,7 +17,7 @@ #include "testHttpRequest.h" #include "unitTestMain.h" -CPPUNIT_TEST_SUITE_REGISTRATION( testHttpRequest ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestHttpRequest ); /** wrapper for testing HttpRequest object private and protected functions */ class PrivateHttpRequest : public HttpRequest @@ -30,7 +30,7 @@ public: /* init memory pools */ void -testHttpRequest::setUp() +TestHttpRequest::setUp() { Mem::Init(); AnyP::UriScheme::Init(); @@ -41,7 +41,7 @@ testHttpRequest::setUp() * Test creating an HttpRequest object from a Url and method */ void -testHttpRequest::testCreateFromUrl() +TestHttpRequest::testCreateFromUrl() { /* vanilla url, implicit method */ unsigned short expected_port; @@ -102,7 +102,7 @@ testHttpRequest::testCreateFromUrl() * Test BUG: URL '2000:800:45' opens host 2000 port 800 !! */ void -testHttpRequest::testIPv6HostColonBug() +TestHttpRequest::testIPv6HostColonBug() { unsigned short expected_port; HttpRequest *aRequest = nullptr; @@ -140,7 +140,7 @@ testHttpRequest::testIPv6HostColonBug() } void -testHttpRequest::testSanityCheckStartLine() +TestHttpRequest::testSanityCheckStartLine() { MemBuf input; const auto mx = MasterXaction::MakePortless(); diff --git a/src/tests/testHttpRequest.h b/src/tests/testHttpRequest.h index 3605edebb4..9c03e2733f 100644 --- a/src/tests/testHttpRequest.h +++ b/src/tests/testHttpRequest.h @@ -15,9 +15,9 @@ * test HttpRequest */ -class testHttpRequest : public CPPUNIT_NS::TestFixture +class TestHttpRequest: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testHttpRequest ); + CPPUNIT_TEST_SUITE( TestHttpRequest ); CPPUNIT_TEST( testCreateFromUrl ); CPPUNIT_TEST( testIPv6HostColonBug ); CPPUNIT_TEST( testSanityCheckStartLine ); diff --git a/src/tests/testHttpRequestMethod.cc b/src/tests/testHttpRequestMethod.cc index 75e9557f09..8f781b0170 100644 --- a/src/tests/testHttpRequestMethod.cc +++ b/src/tests/testHttpRequestMethod.cc @@ -15,13 +15,13 @@ #include -CPPUNIT_TEST_SUITE_REGISTRATION( testHttpRequestMethod ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestHttpRequestMethod ); /* * We should be able to make an HttpRequestMethod straight from a string. */ void -testHttpRequestMethod::testConstructCharStart() +TestHttpRequestMethod::testConstructCharStart() { // string in SBuf @@ -59,7 +59,7 @@ testHttpRequestMethod::testConstructCharStart() * We can also parse precise ranges of characters with SBuf */ void -testHttpRequestMethod::testConstructCharStartEnd() +TestHttpRequestMethod::testConstructCharStartEnd() { char const * buffer; /* parse an empty string -> Http::METHOD_NONE */ @@ -75,7 +75,7 @@ testHttpRequestMethod::testConstructCharStartEnd() * we should be able to assign a Http::MethodType to a HttpRequestMethod */ void -testHttpRequestMethod::testAssignFrommethod_t() +TestHttpRequestMethod::testAssignFrommethod_t() { HttpRequestMethod method; method = Http::METHOD_NONE; @@ -88,7 +88,7 @@ testHttpRequestMethod::testAssignFrommethod_t() * a default constructed HttpRequestMethod is == Http::METHOD_NONE */ void -testHttpRequestMethod::testDefaultConstructor() +TestHttpRequestMethod::testDefaultConstructor() { HttpRequestMethod lhs; HttpRequestMethod rhs(Http::METHOD_NONE); @@ -99,7 +99,7 @@ testHttpRequestMethod::testDefaultConstructor() * we should be able to construct a HttpRequestMethod from a Http::MethodType */ void -testHttpRequestMethod::testConstructmethod_t() +TestHttpRequestMethod::testConstructmethod_t() { CPPUNIT_ASSERT_EQUAL(HttpRequestMethod(Http::METHOD_NONE), HttpRequestMethod(Http::METHOD_NONE)); CPPUNIT_ASSERT_EQUAL(HttpRequestMethod(Http::METHOD_POST), HttpRequestMethod(Http::METHOD_POST)); @@ -110,7 +110,7 @@ testHttpRequestMethod::testConstructmethod_t() * we should be able to get a char const * version of the method. */ void -testHttpRequestMethod::testImage() +TestHttpRequestMethod::testImage() { // relaxed RFC-compliance parse HTTP methods are upgraded to correct case Config.onoff.relaxed_header_parser = 1; @@ -130,7 +130,7 @@ testHttpRequestMethod::testImage() * matches */ void -testHttpRequestMethod::testEqualmethod_t() +TestHttpRequestMethod::testEqualmethod_t() { CPPUNIT_ASSERT(HttpRequestMethod(Http::METHOD_NONE) == Http::METHOD_NONE); CPPUNIT_ASSERT(not (HttpRequestMethod(Http::METHOD_POST) == Http::METHOD_GET)); @@ -142,7 +142,7 @@ testHttpRequestMethod::testEqualmethod_t() * an HttpRequestMethod should testable for inequality without fail maatches */ void -testHttpRequestMethod::testNotEqualmethod_t() +TestHttpRequestMethod::testNotEqualmethod_t() { CPPUNIT_ASSERT(HttpRequestMethod(Http::METHOD_NONE) != Http::METHOD_GET); CPPUNIT_ASSERT(not (HttpRequestMethod(Http::METHOD_POST) != Http::METHOD_POST)); @@ -154,7 +154,7 @@ testHttpRequestMethod::testNotEqualmethod_t() * we should be able to send it to a stream and get the normalised version */ void -testHttpRequestMethod::testStream() +TestHttpRequestMethod::testStream() { // relaxed RFC-compliance parse HTTP methods are upgraded to correct case Config.onoff.relaxed_header_parser = 1; diff --git a/src/tests/testHttpRequestMethod.h b/src/tests/testHttpRequestMethod.h index 691657c36f..7f47fb0d40 100644 --- a/src/tests/testHttpRequestMethod.h +++ b/src/tests/testHttpRequestMethod.h @@ -15,9 +15,9 @@ * test HttpRequestMethod */ -class testHttpRequestMethod : public CPPUNIT_NS::TestFixture +class TestHttpRequestMethod: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testHttpRequestMethod ); + CPPUNIT_TEST_SUITE( TestHttpRequestMethod ); CPPUNIT_TEST( testAssignFrommethod_t ); CPPUNIT_TEST( testConstructmethod_t ); CPPUNIT_TEST( testConstructCharStart ); diff --git a/src/tests/testIcmp.cc b/src/tests/testIcmp.cc index a1e1e12285..5b93c739cc 100644 --- a/src/tests/testIcmp.cc +++ b/src/tests/testIcmp.cc @@ -14,13 +14,13 @@ #include -CPPUNIT_TEST_SUITE_REGISTRATION( testIcmp ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestIcmp ); void -testIcmp::testChecksum() +TestIcmp::testChecksum() { #if USE_ICMP - stubIcmp icmp; + IcmpStub icmp; uint16_t buf[10], tmpval; for (tmpval=0; tmpval < 10; ++tmpval) buf[tmpval]=htons(1+tmpval); @@ -72,10 +72,10 @@ testIcmp::testChecksum() } void -testIcmp::testHops() +TestIcmp::testHops() { #if USE_ICMP - stubIcmp icmp; + IcmpStub icmp; /* test invalid -(under values) */ // negative : n > 33 diff --git a/src/tests/testIcmp.h b/src/tests/testIcmp.h index 646eaa50ba..5cdda1c185 100644 --- a/src/tests/testIcmp.h +++ b/src/tests/testIcmp.h @@ -15,11 +15,11 @@ #include "icmp/Icmp.h" -class stubIcmp : public Icmp +class IcmpStub: public Icmp { public: - stubIcmp() {}; - ~stubIcmp() override {}; + IcmpStub() {}; + ~IcmpStub() override {}; int Open() override { return 0; }; void Close() override {}; @@ -38,9 +38,9 @@ public: /** * test the ICMP base class. */ -class testIcmp : public CPPUNIT_NS::TestFixture +class TestIcmp: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testIcmp ); + CPPUNIT_TEST_SUITE( TestIcmp ); CPPUNIT_TEST( testChecksum ); CPPUNIT_TEST( testHops ); CPPUNIT_TEST_SUITE_END(); diff --git a/src/tests/testIpAddress.cc b/src/tests/testIpAddress.cc index 851c0aca19..bb2cef4d76 100644 --- a/src/tests/testIpAddress.cc +++ b/src/tests/testIpAddress.cc @@ -25,10 +25,10 @@ #include #endif -CPPUNIT_TEST_SUITE_REGISTRATION( testIpAddress ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestIpAddress ); void -testIpAddress::testDefaults() +TestIpAddress::testDefaults() { Ip::Address anIPA; @@ -42,7 +42,7 @@ testIpAddress::testDefaults() } void -testIpAddress::testInAddrConstructor() +TestIpAddress::testInAddrConstructor() { struct in_addr inval; struct in_addr outval; @@ -64,7 +64,7 @@ testIpAddress::testInAddrConstructor() } void -testIpAddress::testInAddr6Constructor() +TestIpAddress::testInAddr6Constructor() { struct in6_addr inval; struct in6_addr outval = IN6ADDR_ANY_INIT; @@ -88,7 +88,7 @@ testIpAddress::testInAddr6Constructor() } void -testIpAddress::testSockAddrConstructor() +TestIpAddress::testSockAddrConstructor() { struct sockaddr_in insock; struct sockaddr_in outsock; @@ -117,7 +117,7 @@ testIpAddress::testSockAddrConstructor() } void -testIpAddress::testSockAddr6Constructor() +TestIpAddress::testSockAddr6Constructor() { struct sockaddr_in6 insock; struct sockaddr_in6 outsock; @@ -149,7 +149,7 @@ testIpAddress::testSockAddr6Constructor() } void -testIpAddress::testCopyConstructor() +TestIpAddress::testCopyConstructor() { struct sockaddr_in insock; struct sockaddr_in outsock; @@ -179,7 +179,7 @@ testIpAddress::testCopyConstructor() } void -testIpAddress::testHostentConstructor() +TestIpAddress::testHostentConstructor() { struct hostent *hp = nullptr; struct in_addr outval; @@ -204,7 +204,7 @@ testIpAddress::testHostentConstructor() } void -testIpAddress::testStringConstructor() +TestIpAddress::testStringConstructor() { struct in_addr outval; struct in_addr expectval; @@ -267,7 +267,7 @@ testIpAddress::testStringConstructor() } void -testIpAddress::testsetEmpty() +TestIpAddress::testsetEmpty() { Ip::Address anIPA; struct in_addr inval; @@ -296,7 +296,7 @@ testIpAddress::testsetEmpty() } void -testIpAddress::testBooleans() +TestIpAddress::testBooleans() { Ip::Address lhsIPA; Ip::Address rhsIPA; @@ -408,7 +408,7 @@ testIpAddress::testBooleans() } void -testIpAddress::testtoStr() +TestIpAddress::testtoStr() { struct in_addr inval; char buf[MAX_IPSTRLEN]; @@ -432,7 +432,7 @@ testIpAddress::testtoStr() } void -testIpAddress::testtoUrl_fromInAddr() +TestIpAddress::testtoUrl_fromInAddr() { char buf[MAX_IPSTRLEN]; buf[0] = '\0'; @@ -461,7 +461,7 @@ testIpAddress::testtoUrl_fromInAddr() } void -testIpAddress::testtoUrl_fromSockAddr() +TestIpAddress::testtoUrl_fromSockAddr() { struct sockaddr_in sock; sock.sin_addr.s_addr = htonl(0xC0A8640C); @@ -498,7 +498,7 @@ testIpAddress::testtoUrl_fromSockAddr() } void -testIpAddress::testgetReverseString() +TestIpAddress::testgetReverseString() { char buf[MAX_IPSTRLEN]; @@ -532,7 +532,7 @@ testIpAddress::testgetReverseString() } void -testIpAddress::testMasking() +TestIpAddress::testMasking() { char buf[MAX_IPSTRLEN]; Ip::Address anIPA; @@ -613,7 +613,7 @@ testIpAddress::testMasking() } void -testIpAddress::testAddrInfo() +TestIpAddress::testAddrInfo() { struct addrinfo *expect; struct addrinfo *ipval = nullptr; @@ -677,7 +677,7 @@ testIpAddress::testAddrInfo() } void -testIpAddress::testBugNullingDisplay() +TestIpAddress::testBugNullingDisplay() { // Weird Bug: address set to empty during string conversion somewhere. // initial string gets created and returned OK. diff --git a/src/tests/testIpAddress.h b/src/tests/testIpAddress.h index f2320710d1..97d1cac8b4 100644 --- a/src/tests/testIpAddress.h +++ b/src/tests/testIpAddress.h @@ -15,9 +15,9 @@ * test the IP storage type */ -class testIpAddress : public CPPUNIT_NS::TestFixture +class TestIpAddress: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testIpAddress ); + CPPUNIT_TEST_SUITE( TestIpAddress ); CPPUNIT_TEST( testDefaults ); CPPUNIT_TEST( testInAddrConstructor ); CPPUNIT_TEST( testInAddr6Constructor ); diff --git a/src/tests/testLookupTable.cc b/src/tests/testLookupTable.cc index dcff5e57ca..306889d247 100644 --- a/src/tests/testLookupTable.cc +++ b/src/tests/testLookupTable.cc @@ -11,7 +11,7 @@ #include "testLookupTable.h" #include "unitTestMain.h" -CPPUNIT_TEST_SUITE_REGISTRATION( testLookupTable ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestLookupTable ); enum EnumData { ENUM_1, @@ -36,7 +36,7 @@ static const LookupTable::Record tableData[] = { }; void -testLookupTable::testLookupTableLookup() +TestLookupTable::testLookupTableLookup() { LookupTable lt(ENUM_INVALID, tableData); // element found diff --git a/src/tests/testLookupTable.h b/src/tests/testLookupTable.h index f944a50c0d..c1da774f43 100644 --- a/src/tests/testLookupTable.h +++ b/src/tests/testLookupTable.h @@ -11,9 +11,9 @@ #include "compat/cppunit.h" -class testLookupTable : public CPPUNIT_NS::TestFixture +class TestLookupTable: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testLookupTable ); + CPPUNIT_TEST_SUITE( TestLookupTable ); CPPUNIT_TEST( testLookupTableLookup ); CPPUNIT_TEST_SUITE_END(); public: diff --git a/src/tests/testMem.cc b/src/tests/testMem.cc index 6fce58c3a3..9fd69ee2df 100644 --- a/src/tests/testMem.cc +++ b/src/tests/testMem.cc @@ -15,7 +15,7 @@ #include #include -CPPUNIT_TEST_SUITE_REGISTRATION( testMem ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestMem ); class SomethingToAlloc { @@ -32,7 +32,7 @@ public: }; void -testMem::testMemPool() +TestMem::testMemPool() { const auto Pool = memPoolCreate("Test Pool", sizeof(SomethingToAlloc)); CPPUNIT_ASSERT(Pool); @@ -53,7 +53,7 @@ testMem::testMemPool() } void -testMem::testMemProxy() +TestMem::testMemProxy() { auto *something = new MoreToAlloc; CPPUNIT_ASSERT(something); diff --git a/src/tests/testMem.h b/src/tests/testMem.h index 0b99748dd4..83f1ee6aaf 100644 --- a/src/tests/testMem.h +++ b/src/tests/testMem.h @@ -11,9 +11,9 @@ #include "compat/cppunit.h" -class testMem : public CPPUNIT_NS::TestFixture +class TestMem: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testMem ); + CPPUNIT_TEST_SUITE( TestMem ); /* note the statement here and then the actual prototype below */ CPPUNIT_TEST( testMemPool ); CPPUNIT_TEST( testMemProxy ); diff --git a/src/tests/testNetDb.cc b/src/tests/testNetDb.cc index 5a078ce528..03a9419af7 100644 --- a/src/tests/testNetDb.cc +++ b/src/tests/testNetDb.cc @@ -13,10 +13,10 @@ #include -CPPUNIT_TEST_SUITE_REGISTRATION( testNetDb ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestNetDb ); void -testNetDb::testConstruct() +TestNetDb::testConstruct() { // default construct and destruct { diff --git a/src/tests/testNetDb.h b/src/tests/testNetDb.h index c2a8dec691..ca6839c033 100644 --- a/src/tests/testNetDb.h +++ b/src/tests/testNetDb.h @@ -11,9 +11,9 @@ #include "compat/cppunit.h" -class testNetDb : public CPPUNIT_NS::TestFixture +class TestNetDb: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testNetDb ); + CPPUNIT_TEST_SUITE( TestNetDb ); /* note the statement here and then the actual prototype below */ CPPUNIT_TEST( testConstruct ); CPPUNIT_TEST_SUITE_END(); diff --git a/src/tests/testPackableStream.cc b/src/tests/testPackableStream.cc index 2e3c923fff..769b76ff45 100644 --- a/src/tests/testPackableStream.cc +++ b/src/tests/testPackableStream.cc @@ -16,11 +16,11 @@ #include #include -CPPUNIT_TEST_SUITE_REGISTRATION( testPackableStream ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestPackableStream ); /* init memory pools */ -void testPackableStream::setUp() +void TestPackableStream::setUp() { Mem::Init(); } @@ -28,7 +28,7 @@ void testPackableStream::setUp() // TODO: test streaming to a MemBuf as well. void -testPackableStream::testGetStream() +TestPackableStream::testGetStream() { /* Setup a store root so we can create a StoreEntry */ Store::Init(); diff --git a/src/tests/testPackableStream.h b/src/tests/testPackableStream.h index 47da3b725a..5549874f03 100644 --- a/src/tests/testPackableStream.h +++ b/src/tests/testPackableStream.h @@ -15,9 +15,9 @@ * test PackableStream */ -class testPackableStream : public CPPUNIT_NS::TestFixture +class TestPackableStream: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testPackableStream ); + CPPUNIT_TEST_SUITE( TestPackableStream ); CPPUNIT_TEST( testGetStream ); CPPUNIT_TEST_SUITE_END(); diff --git a/src/tests/testRFC1035.cc b/src/tests/testRFC1035.cc index 3bcf0c8ccc..0caefaeb04 100644 --- a/src/tests/testRFC1035.cc +++ b/src/tests/testRFC1035.cc @@ -13,13 +13,13 @@ #include -CPPUNIT_TEST_SUITE_REGISTRATION( testRFC1035 ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestRfc1035 ); // TODO Test each function in the Library independently // Just because we can for global functions. // It's good for the code too. -void testRFC1035::testHeaderUnpack() +void TestRfc1035::testHeaderUnpack() { /* Setup a buffer with the known-content packet */ const char *buf = "\x76\xb1\x81\x80\x00\x01\x00\x01\x00\x02\x00\x02\x03\x77\x77\x77\x07\x67\x61\x6d\x65\x64\x65\x76\x03\x6e\x65\x74\x00\x00\x01\x00\x01\xc0\x0c\x00\x01\x00\x01\x00\x00\x00\xef\x00\x04\xd8\xb9\x60\xea\xc0\x10\x00\x02\x00\x01\x00\x00\x00\xef\x00\x0f\x03\x6e\x73\x32\x05\x7a\x77\x61\x76\x65\x03\x63\x6f\x6d\x00\xc0\x10\x00\x02\x00\x01\x00\x00\x00\xef\x00\x06\x03\x6e\x73\x31\xc0\x41\xc0\x3d\x00\x01\x00\x01\x00\x00\x29\x6b\x00\x04\xd8\xea\xee\x4a\xc0\x58\x00\x01\x00\x01\x00\x00\x29\x6b\x00\x04\xd8\xea\xee\x4b"; @@ -52,7 +52,7 @@ void testRFC1035::testHeaderUnpack() msg = nullptr; } -void testRFC1035::testParseAPacket() +void TestRfc1035::testParseAPacket() { /* Setup a buffer with the known-content packet */ const char *buf = "\x76\xb1\x81\x80\x00\x01\x00\x01\x00\x02\x00\x02\x03\x77\x77\x77\x07\x67\x61\x6d\x65\x64\x65\x76\x03\x6e\x65\x74\x00\x00\x01\x00\x01\xc0\x0c\x00\x01\x00\x01\x00\x00\x00\xef\x00\x04\xd8\xb9\x60\xea\xc0\x10\x00\x02\x00\x01\x00\x00\x00\xef\x00\x0f\x03\x6e\x73\x32\x05\x7a\x77\x61\x76\x65\x03\x63\x6f\x6d\x00\xc0\x10\x00\x02\x00\x01\x00\x00\x00\xef\x00\x06\x03\x6e\x73\x31\xc0\x41\xc0\x3d\x00\x01\x00\x01\x00\x00\x29\x6b\x00\x04\xd8\xea\xee\x4a\xc0\x58\x00\x01\x00\x01\x00\x00\x29\x6b\x00\x04\xd8\xea\xee\x4b"; @@ -70,7 +70,7 @@ void testRFC1035::testParseAPacket() CPPUNIT_ASSERT(msg == nullptr); } -void testRFC1035::testBugPacketEndingOnCompressionPtr() +void TestRfc1035::testBugPacketEndingOnCompressionPtr() { /* Setup a buffer with the known-to-fail packet */ const char *buf = "\xec\x7b\x81\x80\x00\x01\x00\x01\x00\x00\x00\x00\x05\x62\x75\x72\x73\x74\x02\x74\x65\x06\x74\x61\x63\x6f\x64\x61\x03\x6e\x65\x74\x00\x00\x1c\x00\x01\xc0\x0c\x00\x05\x00\x01\x00\x00\x19\xe5\x00\x0a\x02\x74\x65\x04\x67\x73\x6c\x62\xc0\x15"; @@ -113,7 +113,7 @@ void testRFC1035::testBugPacketEndingOnCompressionPtr() rfc1035MessageDestroy(&msg); } -void testRFC1035::testBugPacketHeadersOnly() +void TestRfc1035::testBugPacketHeadersOnly() { /* Setup a buffer with the known-to-fail headers-only packet */ const char *buf = "\xab\xcd\x81\x80\x00\x01\x00\x05\x00\x04\x00\x04"; diff --git a/src/tests/testRFC1035.h b/src/tests/testRFC1035.h index 5fa1fd7a71..f4621bdec0 100644 --- a/src/tests/testRFC1035.h +++ b/src/tests/testRFC1035.h @@ -15,9 +15,9 @@ * test the DNS resolver RFC 1035 Engine */ -class testRFC1035 : public CPPUNIT_NS::TestFixture +class TestRfc1035: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testRFC1035 ); + CPPUNIT_TEST_SUITE( TestRfc1035 ); CPPUNIT_TEST( testHeaderUnpack ); CPPUNIT_TEST( testParseAPacket ); diff --git a/src/tests/testRefCount.cc b/src/tests/testRefCount.cc index 8c9dffa051..08dd2b5206 100644 --- a/src/tests/testRefCount.cc +++ b/src/tests/testRefCount.cc @@ -13,7 +13,7 @@ #include "testRefCount.h" #include "unitTestMain.h" -CPPUNIT_TEST_SUITE_REGISTRATION( testRefCount ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestRefCount ); class _ToRefCount : public RefCountable { @@ -48,7 +48,7 @@ public: }; void -testRefCount::testCountability() +TestRefCount::testCountability() { { CPPUNIT_ASSERT_EQUAL(0, _ToRefCount::Instances); @@ -80,7 +80,7 @@ testRefCount::testCountability() } void -testRefCount::testObjectToRefCounted() +TestRefCount::testObjectToRefCounted() { /* Test creating an object, using it , and then making available as a * refcounted one: @@ -93,7 +93,7 @@ testRefCount::testObjectToRefCounted() } void -testRefCount::testStandalonePointer() +TestRefCount::testStandalonePointer() { /* standalone pointers should be usable */ ToRefCount anObject; @@ -101,7 +101,7 @@ testRefCount::testStandalonePointer() } void -testRefCount::testCheckPointers() +TestRefCount::testCheckPointers() { /* Can we check pointers for equality */ ToRefCount anObject; @@ -118,7 +118,7 @@ testRefCount::testCheckPointers() } void -testRefCount::testPointerConst() +TestRefCount::testPointerConst() { /* Can we get the pointer for a const object */ CPPUNIT_ASSERT_EQUAL(0, _ToRefCount::Instances); @@ -130,7 +130,7 @@ testRefCount::testPointerConst() CPPUNIT_ASSERT_EQUAL(1, _ToRefCount::Instances); } -void testRefCount::testRefCountFromConst() +void TestRefCount::testRefCountFromConst() { /* Can we get a refcounted pointer from a const object */ CPPUNIT_ASSERT_EQUAL(0, _ToRefCount::Instances); @@ -142,7 +142,7 @@ void testRefCount::testRefCountFromConst() } void -testRefCount::testPointerFromRefCounter() +TestRefCount::testPointerFromRefCounter() { /* Can we get a pointer to nonconst from a nonconst refcounter */ CPPUNIT_ASSERT_EQUAL(0, _ToRefCount::Instances); @@ -154,7 +154,7 @@ testRefCount::testPointerFromRefCounter() } void -testRefCount::testDoubleInheritToSingleInherit() +TestRefCount::testDoubleInheritToSingleInherit() { CPPUNIT_ASSERT_EQUAL(0, _ToRefCount::Instances); diff --git a/src/tests/testRefCount.h b/src/tests/testRefCount.h index c62fd37da3..a42a185dd4 100644 --- a/src/tests/testRefCount.h +++ b/src/tests/testRefCount.h @@ -11,9 +11,9 @@ #include "compat/cppunit.h" -class testRefCount : public CPPUNIT_NS::TestFixture +class TestRefCount: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testRefCount ); + CPPUNIT_TEST_SUITE( TestRefCount ); CPPUNIT_TEST( testCountability ); CPPUNIT_TEST( testObjectToRefCounted ); CPPUNIT_TEST( testStandalonePointer ); diff --git a/src/tests/testRock.cc b/src/tests/testRock.cc index 32f2b5f45c..859594f307 100644 --- a/src/tests/testRock.cc +++ b/src/tests/testRock.cc @@ -36,14 +36,14 @@ #define TESTDIR "tr" -CPPUNIT_TEST_SUITE_REGISTRATION( testRock ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestRock ); extern REMOVALPOLICYCREATE createRemovalPolicy_lru; static char cwd[MAXPATHLEN]; static void -addSwapDir(testRock::SwapDirPointer aStore) +addSwapDir(TestRock::SwapDirPointer aStore) { allocate_new_swapdir(Config.cacheSwap); Config.cacheSwap.swapDirs[Config.cacheSwap.n_configured] = aStore.getRaw(); @@ -51,7 +51,7 @@ addSwapDir(testRock::SwapDirPointer aStore) } void -testRock::setUp() +TestRock::setUp() { CPPUNIT_NS::TestFixture::setUp(); @@ -95,7 +95,7 @@ testRock::setUp() } void -testRock::tearDown() +TestRock::tearDown() { CPPUNIT_NS::TestFixture::tearDown(); @@ -117,7 +117,7 @@ testRock::tearDown() } void -testRock::commonInit() +TestRock::commonInit() { static bool inited = false; @@ -153,7 +153,7 @@ testRock::commonInit() } void -testRock::storeInit() +TestRock::storeInit() { /* ok, ready to use */ Store::Root().init(); @@ -184,7 +184,7 @@ storeId(const int i) } StoreEntry * -testRock::createEntry(const int i) +TestRock::createEntry(const int i) { RequestFlags flags; flags.cachable.support(); @@ -199,7 +199,7 @@ testRock::createEntry(const int i) } StoreEntry * -testRock::addEntry(const int i) +TestRock::addEntry(const int i) { StoreEntry *const pe = createEntry(i); @@ -214,13 +214,13 @@ testRock::addEntry(const int i) } StoreEntry * -testRock::getEntry(const int i) +TestRock::getEntry(const int i) { return storeGetPublic(storeId(i), Http::METHOD_GET); } void -testRock::testRockCreate() +TestRock::testRockCreate() { struct stat sb; @@ -232,7 +232,7 @@ testRock::testRockCreate() } void -testRock::testRockSwapOut() +TestRock::testRockSwapOut() { storeInit(); @@ -253,7 +253,7 @@ testRock::testRockSwapOut() CPPUNIT_ASSERT_EQUAL(SWAPOUT_DONE, pe->swap_status); - pe->unlock("testRock::testRockSwapOut priming"); + pe->unlock("TestRock::testRockSwapOut priming"); } CPPUNIT_ASSERT_EQUAL((uint64_t)5, store->currentCount()); @@ -266,7 +266,7 @@ testRock::testRockSwapOut() CPPUNIT_ASSERT_EQUAL(SWAPOUT_NONE, pe->swap_status); CPPUNIT_ASSERT_EQUAL(-1, pe->swap_dirn); CPPUNIT_ASSERT_EQUAL(-1, pe->swap_filen); - pe->unlock("testRock::testRockSwapOut e#3"); + pe->unlock("TestRock::testRockSwapOut e#3"); // after marking the old entry as deleted StoreEntry *const pe2 = getEntry(4); @@ -283,7 +283,7 @@ testRock::testRockSwapOut() CPPUNIT_ASSERT_EQUAL(SWAPOUT_DONE, pe3->swap_status); - pe->unlock("testRock::testRockSwapOut e#4"); + pe->unlock("TestRock::testRockSwapOut e#4"); } // try to swap out entry to a used locked slot @@ -304,8 +304,8 @@ testRock::testRockSwapOut() StockEventLoop loop; loop.run(); - pe->unlock("testRock::testRockSwapOut e#5.1"); - pe2->unlock("testRock::testRockSwapOut e#5.2"); + pe->unlock("TestRock::testRockSwapOut e#5.1"); + pe2->unlock("TestRock::testRockSwapOut e#5.2"); // pe2 has the same public key as pe so it marks old pe for release // here, we add another entry #5 into the now-available slot @@ -315,7 +315,7 @@ testRock::testRockSwapOut() CPPUNIT_ASSERT(pe3->swap_filen >= 0); loop.run(); CPPUNIT_ASSERT_EQUAL(SWAPOUT_DONE, pe3->swap_status); - pe3->unlock("testRock::testRockSwapOut e#5.3"); + pe3->unlock("TestRock::testRockSwapOut e#5.3"); } CPPUNIT_ASSERT_EQUAL((uint64_t)6, store->currentCount()); diff --git a/src/tests/testRock.h b/src/tests/testRock.h index 93adf6349a..cf3d322178 100644 --- a/src/tests/testRock.h +++ b/src/tests/testRock.h @@ -15,15 +15,15 @@ * test the store framework */ -class testRock : public CPPUNIT_NS::TestFixture +class TestRock: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testRock ); + CPPUNIT_TEST_SUITE( TestRock ); CPPUNIT_TEST( testRockCreate ); CPPUNIT_TEST( testRockSwapOut ); CPPUNIT_TEST_SUITE_END(); public: - testRock() : rr(nullptr) {} + TestRock() : rr(nullptr) {} void setUp() override; void tearDown() override; diff --git a/src/tests/testSBuf.cc b/src/tests/testSBuf.cc index 259a05aa18..acfb9bd080 100644 --- a/src/tests/testSBuf.cc +++ b/src/tests/testSBuf.cc @@ -20,7 +20,7 @@ #include #include -CPPUNIT_TEST_SUITE_REGISTRATION( testSBuf ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestSBuf ); /* let this test link sanely */ #include "event.h" @@ -45,7 +45,7 @@ SBuf empty_sbuf; SBuf literal("The quick brown fox jumped over the lazy dog"); void -testSBuf::testSBufConstructDestruct() +TestSBuf::testSBufConstructDestruct() { /* NOTE: Do not initialize memory here because we need * to test correct operation before and after Mem::Init @@ -125,14 +125,14 @@ testSBuf::testSBufConstructDestruct() } void -testSBuf::testSBufConstructDestructAfterMemInit() +TestSBuf::testSBufConstructDestructAfterMemInit() { Mem::Init(); testSBufConstructDestruct(); } void -testSBuf::testEqualityTest() +TestSBuf::testEqualityTest() { SBuf s1(fox),s2(fox); CPPUNIT_ASSERT_EQUAL(s1,s1); //self-equality @@ -150,7 +150,7 @@ testSBuf::testEqualityTest() } void -testSBuf::testAppendSBuf() +TestSBuf::testAppendSBuf() { const SBuf appendix(fox1); const char * const rawAppendix = appendix.rawContent(); @@ -171,7 +171,7 @@ testSBuf::testAppendSBuf() } void -testSBuf::testPrintf() +TestSBuf::testPrintf() { SBuf s1,s2; s1.Printf("%s:%d:%03.3f","fox",10,12345.67); @@ -180,7 +180,7 @@ testSBuf::testPrintf() } void -testSBuf::testAppendCString() +TestSBuf::testAppendCString() { SBuf s1(fox1); s1.append(fox2); @@ -188,7 +188,7 @@ testSBuf::testAppendCString() } void -testSBuf::testAppendStdString() +TestSBuf::testAppendStdString() { const char *alphabet="abcdefghijklmnopqrstuvwxyz"; { @@ -213,7 +213,7 @@ testSBuf::testAppendStdString() } void -testSBuf::testAppendf() +TestSBuf::testAppendf() { SBuf s1,s2; s1.appendf("%s:%d:%03.2f",fox,1234,1234.56); @@ -222,7 +222,7 @@ testSBuf::testAppendf() } void -testSBuf::testDumpStats() +TestSBuf::testDumpStats() { SBuf::GetStats().dump(std::cout); MemBlob::GetStats().dump(std::cout); @@ -231,7 +231,7 @@ testSBuf::testDumpStats() } void -testSBuf::testSubscriptOp() +TestSBuf::testSubscriptOp() { SBuf chg(literal); CPPUNIT_ASSERT_EQUAL(chg[5],'u'); @@ -243,7 +243,7 @@ testSBuf::testSubscriptOp() // note: can't use cppunit's CPPUNIT_TEST_EXCEPTION because TextException asserts, and // so the test can't be properly completed. void -testSBuf::testSubscriptOpFail() +TestSBuf::testSubscriptOpFail() { char c; c=literal.at(literal.length()); //out of bounds by 1 @@ -318,7 +318,7 @@ testComparisonStd(const char *s1, const char *s2) } void -testSBuf::testComparisons() +TestSBuf::testComparisons() { //same length SBuf s1("foo"),s2("foe"); @@ -389,7 +389,7 @@ testSBuf::testComparisons() } void -testSBuf::testConsume() +TestSBuf::testConsume() { SBuf s1(literal),s2,s3; s2=s1.consume(4); @@ -402,7 +402,7 @@ testSBuf::testConsume() } void -testSBuf::testRawContent() +TestSBuf::testRawContent() { SBuf s1(literal); SBuf s2(s1); @@ -415,7 +415,7 @@ testSBuf::testRawContent() } void -testSBuf::testRawSpace() +TestSBuf::testRawSpace() { SBuf s1(literal); SBuf s2(fox1); @@ -426,7 +426,7 @@ testSBuf::testRawSpace() } void -testSBuf::testChop() +TestSBuf::testChop() { SBuf s1(literal),s2; s1.chop(4,5); @@ -490,7 +490,7 @@ testSBuf::testChop() } void -testSBuf::testChomp() +TestSBuf::testChomp() { SBuf s1("complete string"); SBuf s2(s1); @@ -527,7 +527,7 @@ public: }; void -testSBuf::testSubstr() +TestSBuf::testSubstr() { SBuf s1(literal),s2,s3; s2=s1.substr(4,5); @@ -539,7 +539,7 @@ testSBuf::testSubstr() } void -testSBuf::testFindChar() +TestSBuf::testFindChar() { const char *alphabet="abcdefghijklmnopqrstuvwxyz"; SBuf s1(alphabet); @@ -596,7 +596,7 @@ testSBuf::testFindChar() } void -testSBuf::testFindSBuf() +TestSBuf::testFindSBuf() { const char *alphabet="abcdefghijklmnopqrstuvwxyz"; SBuf haystack(alphabet); @@ -705,7 +705,7 @@ testSBuf::testFindSBuf() } void -testSBuf::testRFindChar() +TestSBuf::testRFindChar() { SBuf s1(literal); SBuf::size_type idx; @@ -715,7 +715,7 @@ testSBuf::testRFindChar() } void -testSBuf::testRFindSBuf() +TestSBuf::testRFindSBuf() { SBuf haystack(literal),afox("fox"); SBuf goobar("goobar"); @@ -760,14 +760,14 @@ testSBuf::testRFindSBuf() } void -testSBuf::testSBufLength() +TestSBuf::testSBufLength() { SBuf s(fox); CPPUNIT_ASSERT_EQUAL(strlen(fox),(size_t)s.length()); } void -testSBuf::testCopy() +TestSBuf::testCopy() { char buf[40]; //shorter than literal() SBuf s(fox1),s2; @@ -781,7 +781,7 @@ testSBuf::testCopy() } void -testSBuf::testStringOps() +TestSBuf::testStringOps() { SBuf sng(ToLower(literal)), ref("the quick brown fox jumped over the lazy dog"); @@ -795,7 +795,7 @@ testSBuf::testStringOps() } void -testSBuf::testGrow() +TestSBuf::testGrow() { SBuf t; t.assign("foo"); @@ -810,7 +810,7 @@ testSBuf::testGrow() } void -testSBuf::testReserve() +TestSBuf::testReserve() { SBufReservationRequirements requirements; // use unusual numbers to ensure we do not hit a lucky boundary situation @@ -944,7 +944,7 @@ testSBuf::testReserve() } void -testSBuf::testStartsWith() +TestSBuf::testStartsWith() { static SBuf casebuf("THE QUICK"); CPPUNIT_ASSERT(literal.startsWith(SBuf(fox1))); @@ -961,7 +961,7 @@ testSBuf::testStartsWith() } void -testSBuf::testSBufStream() +TestSBuf::testSBufStream() { SBuf b("const.string, int 10 and a float 10.5"); SBufStream ss; @@ -979,7 +979,7 @@ testSBuf::testSBufStream() } void -testSBuf::testFindFirstOf() +TestSBuf::testFindFirstOf() { SBuf haystack(literal); SBuf::size_type idx; @@ -1002,7 +1002,7 @@ testSBuf::testFindFirstOf() } void -testSBuf::testFindFirstNotOf() +TestSBuf::testFindFirstNotOf() { SBuf haystack(literal); SBuf::size_type idx; @@ -1025,14 +1025,14 @@ testSBuf::testFindFirstNotOf() } void -testSBuf::testAutoFind() +TestSBuf::testAutoFind() { SBufFindTest test; test.run(); } void -testSBuf::testStdStringOps() +TestSBuf::testStdStringOps() { const char *alphabet="abcdefghijklmnopqrstuvwxyz"; std::string astr(alphabet); @@ -1041,7 +1041,7 @@ testSBuf::testStdStringOps() } void -testSBuf::testIterators() +TestSBuf::testIterators() { SBuf text("foo"), text2("foo"); CPPUNIT_ASSERT(text.begin() == text.begin()); @@ -1078,7 +1078,7 @@ testSBuf::testIterators() } void -testSBuf::testSBufHash() +TestSBuf::testSBufHash() { // same SBuf must have same hash auto hasher=std::hash(); diff --git a/src/tests/testSBuf.h b/src/tests/testSBuf.h index 59b0ff5286..3b66acc7ca 100644 --- a/src/tests/testSBuf.h +++ b/src/tests/testSBuf.h @@ -17,9 +17,9 @@ * test the SBuf functionalities */ -class testSBuf : public CPPUNIT_NS::TestFixture +class TestSBuf: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testSBuf ); + CPPUNIT_TEST_SUITE( TestSBuf ); CPPUNIT_TEST( testSBufConstructDestruct ); CPPUNIT_TEST( testSBufConstructDestructAfterMemInit ); CPPUNIT_TEST( testSBufLength ); diff --git a/src/tests/testSBufList.cc b/src/tests/testSBufList.cc index e607d92e30..ec05c5b970 100644 --- a/src/tests/testSBufList.cc +++ b/src/tests/testSBufList.cc @@ -12,7 +12,7 @@ #include "tests/testSBufList.h" #include "unitTestMain.h" -CPPUNIT_TEST_SUITE_REGISTRATION( testSBufList ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestSBufList ); SBuf literal("The quick brown fox jumped over the lazy dog"); static int sbuf_tokens_number=9; @@ -23,7 +23,7 @@ static SBuf tokens[]= { }; void -testSBufList::testSBufListMembership() +TestSBufList::testSBufListMembership() { SBufList foo; for (int j=0; j -CPPUNIT_TEST_SUITE_REGISTRATION( testStore ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestStore ); int -TestStore::callback() +StoreControllerStub::callback() { return 1; } StoreEntry* -TestStore::get(const cache_key*) +StoreControllerStub::get(const cache_key*) { return nullptr; } void -TestStore::get(String, void (*)(StoreEntry*, void*), void*) +StoreControllerStub::get(String, void (*)(StoreEntry*, void*), void*) {} void -TestStore::init() +StoreControllerStub::init() {} uint64_t -TestStore::maxSize() const +StoreControllerStub::maxSize() const { return 3; } uint64_t -TestStore::minSize() const +StoreControllerStub::minSize() const { return 1; } uint64_t -TestStore::currentSize() const +StoreControllerStub::currentSize() const { return 2; } uint64_t -TestStore::currentCount() const +StoreControllerStub::currentCount() const { return 2; } int64_t -TestStore::maxObjectSize() const +StoreControllerStub::maxObjectSize() const { return 1; } void -TestStore::getStats(StoreInfoStats &) const +StoreControllerStub::getStats(StoreInfoStats &) const { } void -TestStore::stat(StoreEntry &) const +StoreControllerStub::stat(StoreEntry &) const { - const_cast(this)->statsCalled = true; + const_cast(this)->statsCalled = true; } StoreSearch * -TestStore::search() +StoreControllerStub::search() { return nullptr; } void -testStore::testSetRoot() +TestStore::testSetRoot() { - Store::Controller *aStore(new TestStore); + Store::Controller *aStore(new StoreControllerStub); Store::Init(aStore); CPPUNIT_ASSERT_EQUAL(&Store::Root(), aStore); @@ -94,10 +94,10 @@ testStore::testSetRoot() } void -testStore::testUnsetRoot() +TestStore::testUnsetRoot() { - Store::Controller *aStore(new TestStore); - Store::Controller *aStore2(new TestStore); + Store::Controller *aStore(new StoreControllerStub); + Store::Controller *aStore2(new StoreControllerStub); Store::Init(aStore); Store::FreeMemory(); Store::Init(aStore2); @@ -106,9 +106,9 @@ testStore::testUnsetRoot() } void -testStore::testStats() +TestStore::testStats() { - TestStore *aStore(new TestStore); + StoreControllerStub *aStore(new StoreControllerStub); Store::Init(aStore); CPPUNIT_ASSERT_EQUAL(false, aStore->statsCalled); StoreEntry entry; @@ -118,9 +118,9 @@ testStore::testStats() } void -testStore::testMaxSize() +TestStore::testMaxSize() { - Store::Controller *aStore(new TestStore); + Store::Controller *aStore(new StoreControllerStub); Store::Init(aStore); CPPUNIT_ASSERT_EQUAL(static_cast(3), aStore->maxSize()); Store::FreeMemory(); @@ -188,7 +188,7 @@ checkSwapMetaRawType(const RawSwapMetaType rawType) } // namespace Store void -testStore::testSwapMetaTypeClassification() +TestStore::testSwapMetaTypeClassification() { using limits = std::numeric_limits; for (auto rawType = limits::min(); true; ++rawType) { diff --git a/src/tests/testStore.h b/src/tests/testStore.h index 2e043381ab..72cec1061e 100644 --- a/src/tests/testStore.h +++ b/src/tests/testStore.h @@ -18,9 +18,9 @@ * test the store framework */ -class testStore : public CPPUNIT_NS::TestFixture +class TestStore: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testStore ); + CPPUNIT_TEST_SUITE( TestStore ); CPPUNIT_TEST( testSetRoot ); CPPUNIT_TEST( testUnsetRoot ); CPPUNIT_TEST( testStats ); @@ -39,11 +39,11 @@ protected: }; /// allows testing of methods without having all the other components live -class TestStore : public Store::Controller +class StoreControllerStub : public Store::Controller { public: - TestStore() : statsCalled (false) {} + StoreControllerStub() : statsCalled (false) {} bool statsCalled; @@ -78,7 +78,7 @@ public: virtual StoreSearch *search(); }; -typedef RefCount TestStorePointer; +typedef RefCount StoreControllerStubPointer; #endif diff --git a/src/tests/testStoreController.cc b/src/tests/testStoreController.cc index 8848dd45f9..ff528f135f 100644 --- a/src/tests/testStoreController.cc +++ b/src/tests/testStoreController.cc @@ -15,7 +15,7 @@ #include "testStoreController.h" #include "TestSwapDir.h" -CPPUNIT_TEST_SUITE_REGISTRATION( testStoreController ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestStoreController ); static void addSwapDir(TestSwapDirPointer aStore) @@ -26,7 +26,7 @@ addSwapDir(TestSwapDirPointer aStore) } void -testStoreController::testStats() +TestStoreController::testStats() { Store::Init(); StoreEntry *logEntry = new StoreEntry; @@ -67,7 +67,7 @@ commonInit() } void -testStoreController::testMaxSize() +TestStoreController::testMaxSize() { commonInit(); StoreEntry *logEntry = new StoreEntry; @@ -126,7 +126,7 @@ searchCallback(void *) } void -testStoreController::testSearch() +TestStoreController::testSearch() { commonInit(); Store::Init(); diff --git a/src/tests/testStoreController.h b/src/tests/testStoreController.h index 2c1aff615e..5a5bcde35e 100644 --- a/src/tests/testStoreController.h +++ b/src/tests/testStoreController.h @@ -15,9 +15,9 @@ * test the store framework */ -class testStoreController : public CPPUNIT_NS::TestFixture +class TestStoreController: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testStoreController ); + CPPUNIT_TEST_SUITE( TestStoreController ); CPPUNIT_TEST( testStats ); CPPUNIT_TEST( testMaxSize ); CPPUNIT_TEST( testSearch ); diff --git a/src/tests/testStoreHashIndex.cc b/src/tests/testStoreHashIndex.cc index faed92cc2c..7ddf48f667 100644 --- a/src/tests/testStoreHashIndex.cc +++ b/src/tests/testStoreHashIndex.cc @@ -15,7 +15,7 @@ #include "testStoreHashIndex.h" #include "TestSwapDir.h" -CPPUNIT_TEST_SUITE_REGISTRATION( testStoreHashIndex ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestStoreHashIndex ); static void addSwapDir(TestSwapDirPointer aStore) @@ -26,7 +26,7 @@ addSwapDir(TestSwapDirPointer aStore) } void -testStoreHashIndex::testStats() +TestStoreHashIndex::testStats() { StoreEntry *logEntry = new StoreEntry; logEntry->createMemObject("dummy_storeId", nullptr, HttpRequestMethod()); @@ -46,7 +46,7 @@ testStoreHashIndex::testStats() } void -testStoreHashIndex::testMaxSize() +TestStoreHashIndex::testMaxSize() { StoreEntry *logEntry = new StoreEntry; logEntry->createMemObject("dummy_storeId", nullptr, HttpRequestMethod()); @@ -126,7 +126,7 @@ searchCallback(void *) } void -testStoreHashIndex::testSearch() +TestStoreHashIndex::testSearch() { commonInit(); Store::Init(); diff --git a/src/tests/testStoreHashIndex.h b/src/tests/testStoreHashIndex.h index 282bbfd484..0e70fc3357 100644 --- a/src/tests/testStoreHashIndex.h +++ b/src/tests/testStoreHashIndex.h @@ -15,9 +15,9 @@ * test the store framework */ -class testStoreHashIndex : public CPPUNIT_NS::TestFixture +class TestStoreHashIndex: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testStoreHashIndex ); + CPPUNIT_TEST_SUITE( TestStoreHashIndex ); CPPUNIT_TEST( testStats ); CPPUNIT_TEST( testMaxSize ); CPPUNIT_TEST( testSearch ); diff --git a/src/tests/testString.cc b/src/tests/testString.cc index 34a11e95ca..2af7b74eda 100644 --- a/src/tests/testString.cc +++ b/src/tests/testString.cc @@ -12,18 +12,18 @@ #include "testString.h" #include "unitTestMain.h" -CPPUNIT_TEST_SUITE_REGISTRATION( testString ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestString ); /* init memory pools */ void -testString::setUp() +TestString::setUp() { Mem::Init(); } void -testString::testCmpDefault() +TestString::testCmpDefault() { String left, right; /* two default strings are equal */ @@ -33,7 +33,7 @@ testString::testCmpDefault() } void -testString::testCmpEmptyString() +TestString::testCmpEmptyString() { String left(""); String right; @@ -48,7 +48,7 @@ testString::testCmpEmptyString() } void -testString::testCmpNotEmptyDefault() +TestString::testCmpNotEmptyDefault() { String left("foo"); String right; @@ -62,7 +62,7 @@ testString::testCmpNotEmptyDefault() CPPUNIT_ASSERT(right.cmp("foo", 1) < 0); } -void testString::testSubstr() +void TestString::testSubstr() { String s("0123456789"); String check=s.substr(3,5); diff --git a/src/tests/testString.h b/src/tests/testString.h index 66f0d3d4ae..2d176276fe 100644 --- a/src/tests/testString.h +++ b/src/tests/testString.h @@ -15,9 +15,9 @@ * test the store framework */ -class testString : public CPPUNIT_NS::TestFixture +class TestString: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testString ); + CPPUNIT_TEST_SUITE( TestString ); CPPUNIT_TEST( testCmpDefault ); CPPUNIT_TEST( testCmpEmptyString ); CPPUNIT_TEST( testCmpNotEmptyDefault ); diff --git a/src/tests/testTokenizer.cc b/src/tests/testTokenizer.cc index 3fd2365412..dcf0709bcb 100644 --- a/src/tests/testTokenizer.cc +++ b/src/tests/testTokenizer.cc @@ -12,7 +12,7 @@ #include "tests/testTokenizer.h" #include "unitTestMain.h" -CPPUNIT_TEST_SUITE_REGISTRATION( testTokenizer ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestTokenizer ); SBuf text("GET http://resource.com/path HTTP/1.1\r\n" "Host: resource.com\r\n" @@ -25,7 +25,7 @@ const CharacterSet tab("tab","\t"); const CharacterSet numbers("numbers","0123456789"); void -testTokenizer::testTokenizerPrefix() +TestTokenizer::testTokenizerPrefix() { const SBuf canary("This text should not be changed."); @@ -77,7 +77,7 @@ testTokenizer::testTokenizerPrefix() } void -testTokenizer::testTokenizerSkip() +TestTokenizer::testTokenizerSkip() { Parser::Tokenizer t(text); SBuf s; @@ -111,7 +111,7 @@ testTokenizer::testTokenizerSkip() } void -testTokenizer::testTokenizerToken() +TestTokenizer::testTokenizerToken() { Parser::Tokenizer t(text); SBuf s; @@ -129,7 +129,7 @@ testTokenizer::testTokenizerToken() } void -testTokenizer::testTokenizerSuffix() +TestTokenizer::testTokenizerSuffix() { const SBuf canary("This text should not be changed."); @@ -189,13 +189,13 @@ testTokenizer::testTokenizerSuffix() } void -testTokenizer::testCharacterSet() +TestTokenizer::testCharacterSet() { } void -testTokenizer::testTokenizerInt64() +TestTokenizer::testTokenizerInt64() { // successful parse in base 10 { diff --git a/src/tests/testTokenizer.h b/src/tests/testTokenizer.h index b3d36d73c1..c0d519ae5e 100644 --- a/src/tests/testTokenizer.h +++ b/src/tests/testTokenizer.h @@ -11,9 +11,9 @@ #include "compat/cppunit.h" -class testTokenizer : public CPPUNIT_NS::TestFixture +class TestTokenizer: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testTokenizer ); + CPPUNIT_TEST_SUITE( TestTokenizer ); CPPUNIT_TEST ( testCharacterSet ); CPPUNIT_TEST ( testTokenizerPrefix ); CPPUNIT_TEST ( testTokenizerSuffix ); diff --git a/src/tests/testURL.cc b/src/tests/testURL.cc index a1af4eafb9..c18618d8b8 100644 --- a/src/tests/testURL.cc +++ b/src/tests/testURL.cc @@ -17,12 +17,12 @@ #include -CPPUNIT_TEST_SUITE_REGISTRATION( testURL ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestUri ); /* init memory pools */ void -testURL::setUp() +TestUri::setUp() { Mem::Init(); AnyP::UriScheme::Init(); @@ -33,7 +33,7 @@ testURL::setUp() * This creates a URL for that scheme. */ void -testURL::testConstructScheme() +TestUri::testConstructScheme() { AnyP::UriScheme empty_scheme; AnyP::Uri protoless_url(AnyP::PROTO_NONE); @@ -50,7 +50,7 @@ testURL::testConstructScheme() * scheme instances. */ void -testURL::testDefaultConstructor() +TestUri::testDefaultConstructor() { AnyP::UriScheme aScheme; AnyP::Uri aUrl; diff --git a/src/tests/testURL.h b/src/tests/testURL.h index 898b0ee5b2..dc097ab6a9 100644 --- a/src/tests/testURL.h +++ b/src/tests/testURL.h @@ -12,12 +12,12 @@ #include "compat/cppunit.h" /* - * test the URL class. + * test the Anyp::Uri-related classes */ -class testURL : public CPPUNIT_NS::TestFixture +class TestUri: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testURL ); + CPPUNIT_TEST_SUITE( TestUri ); CPPUNIT_TEST( testConstructScheme ); CPPUNIT_TEST( testDefaultConstructor ); CPPUNIT_TEST_SUITE_END(); diff --git a/src/tests/testUfs.cc b/src/tests/testUfs.cc index 3900859ea7..e094aef0f0 100644 --- a/src/tests/testUfs.cc +++ b/src/tests/testUfs.cc @@ -24,9 +24,9 @@ #include -#define TESTDIR "testUfs_Store" +#define TESTDIR "TestUfs_Store" -CPPUNIT_TEST_SUITE_REGISTRATION( testUfs ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestUfs ); typedef RefCount MySwapDirPointer; extern REMOVALPOLICYCREATE createRemovalPolicy_lru; /* XXX fails with --enable-removal-policies=heap */ @@ -48,7 +48,7 @@ searchCallback(void *) } void -testUfs::commonInit() +TestUfs::commonInit() { static bool inited = false; @@ -81,7 +81,7 @@ testUfs::commonInit() } void -testUfs::testUfsSearch() +TestUfs::testUfsSearch() { /* test sequence * make a valid working ufs swapdir @@ -160,7 +160,7 @@ testUfs::testUfsSearch() pe->swapOut(); CPPUNIT_ASSERT_EQUAL(0, pe->swap_dirn); CPPUNIT_ASSERT_EQUAL(0, pe->swap_filen); - pe->unlock("testUfs::testUfsSearch vary"); + pe->unlock("TestUfs::testUfsSearch vary"); } storeDirWriteCleanLogs(0); @@ -213,7 +213,7 @@ testUfs::testUfsSearch() * supplied on the configuration line. */ void -testUfs::testUfsDefaultEngine() +TestUfs::testUfsDefaultEngine() { /* boring common test boilerplate */ if (0 > system ("rm -rf " TESTDIR)) diff --git a/src/tests/testUfs.h b/src/tests/testUfs.h index 7277814db3..07c244f7c8 100644 --- a/src/tests/testUfs.h +++ b/src/tests/testUfs.h @@ -15,9 +15,9 @@ * test the store framework */ -class testUfs : public CPPUNIT_NS::TestFixture +class TestUfs: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testUfs ); + CPPUNIT_TEST_SUITE( TestUfs ); CPPUNIT_TEST( testUfsSearch ); CPPUNIT_TEST( testUfsDefaultEngine ); CPPUNIT_TEST_SUITE_END(); diff --git a/src/tests/testUriScheme.cc b/src/tests/testUriScheme.cc index 856babf7a0..960c054dc7 100644 --- a/src/tests/testUriScheme.cc +++ b/src/tests/testUriScheme.cc @@ -15,14 +15,14 @@ #include -CPPUNIT_TEST_SUITE_REGISTRATION( testUriScheme ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestUriScheme ); /* * we should be able to assign a protocol_t to a AnyP::UriScheme for ease * of code conversion */ void -testUriScheme::testAssignFromprotocol_t() +TestUriScheme::testAssignFromprotocol_t() { AnyP::UriScheme empty_scheme; AnyP::UriScheme scheme; @@ -39,7 +39,7 @@ testUriScheme::testAssignFromprotocol_t() * of migration */ void -testUriScheme::testCastToprotocol_t() +TestUriScheme::testCastToprotocol_t() { /* explicit cast */ AnyP::ProtocolType protocol = static_cast(AnyP::UriScheme()); @@ -53,7 +53,7 @@ testUriScheme::testCastToprotocol_t() * a default constructed AnyP::UriScheme is == AnyP::PROTO_NONE */ void -testUriScheme::testDefaultConstructor() +TestUriScheme::testDefaultConstructor() { AnyP::UriScheme lhs; AnyP::UriScheme rhs(AnyP::PROTO_NONE); @@ -64,7 +64,7 @@ testUriScheme::testDefaultConstructor() * we should be able to construct a AnyP::UriScheme from the old 'protocol_t' enum. */ void -testUriScheme::testConstructprotocol_t() +TestUriScheme::testConstructprotocol_t() { AnyP::UriScheme lhs_none(AnyP::PROTO_NONE), rhs_none(AnyP::PROTO_NONE); CPPUNIT_ASSERT_EQUAL(lhs_none, rhs_none); @@ -78,7 +78,7 @@ testUriScheme::testConstructprotocol_t() * we should be able to get a char const * version of the method. */ void -testUriScheme::testC_str() +TestUriScheme::testC_str() { SBuf lhs("wais"); AnyP::UriScheme wais(AnyP::PROTO_WAIS); @@ -91,7 +91,7 @@ testUriScheme::testC_str() * either the left or right hand side seamlessly. */ void -testUriScheme::testEqualprotocol_t() +TestUriScheme::testEqualprotocol_t() { CPPUNIT_ASSERT(AnyP::UriScheme() == AnyP::PROTO_NONE); CPPUNIT_ASSERT(not (AnyP::UriScheme(AnyP::PROTO_WAIS) == AnyP::PROTO_HTTP)); @@ -103,7 +103,7 @@ testUriScheme::testEqualprotocol_t() * a AnyP::UriScheme should testable for inequality with a protocol_t. */ void -testUriScheme::testNotEqualprotocol_t() +TestUriScheme::testNotEqualprotocol_t() { CPPUNIT_ASSERT(AnyP::UriScheme(AnyP::PROTO_NONE) != AnyP::PROTO_HTTP); CPPUNIT_ASSERT(not (AnyP::UriScheme(AnyP::PROTO_HTTP) != AnyP::PROTO_HTTP)); @@ -115,7 +115,7 @@ testUriScheme::testNotEqualprotocol_t() * we should be able to send it to a stream and get the normalised version */ void -testUriScheme::testStream() +TestUriScheme::testStream() { std::ostringstream buffer; buffer << AnyP::UriScheme(AnyP::PROTO_HTTP); @@ -125,7 +125,7 @@ testUriScheme::testStream() } void -testUriScheme::setUp() +TestUriScheme::setUp() { Mem::Init(); AnyP::UriScheme::Init(); diff --git a/src/tests/testUriScheme.h b/src/tests/testUriScheme.h index 5418ee5ef1..0b9157cd72 100644 --- a/src/tests/testUriScheme.h +++ b/src/tests/testUriScheme.h @@ -15,9 +15,9 @@ * test UriScheme */ -class testUriScheme : public CPPUNIT_NS::TestFixture +class TestUriScheme: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testUriScheme ); + CPPUNIT_TEST_SUITE( TestUriScheme ); CPPUNIT_TEST( testAssignFromprotocol_t ); CPPUNIT_TEST( testCastToprotocol_t ); CPPUNIT_TEST( testConstructprotocol_t ); diff --git a/src/tests/testYesNoNone.cc b/src/tests/testYesNoNone.cc index 30cc3b16b0..0a7233551c 100644 --- a/src/tests/testYesNoNone.cc +++ b/src/tests/testYesNoNone.cc @@ -13,10 +13,10 @@ #include -CPPUNIT_TEST_SUITE_REGISTRATION( testYesNoNone ); +CPPUNIT_TEST_SUITE_REGISTRATION( TestYesNoNone ); void -testYesNoNone::testBasics() +TestYesNoNone::testBasics() { // unconfigured, non-implicit { diff --git a/src/tests/testYesNoNone.h b/src/tests/testYesNoNone.h index 05ba6ba198..8b79757021 100644 --- a/src/tests/testYesNoNone.h +++ b/src/tests/testYesNoNone.h @@ -13,12 +13,12 @@ /* * demonstration test file, as new idioms are made they will - * be shown in the testYesNoNone source. + * be shown in the TestYesNoNone source. */ -class testYesNoNone : public CPPUNIT_NS::TestFixture +class TestYesNoNone: public CPPUNIT_NS::TestFixture { - CPPUNIT_TEST_SUITE( testYesNoNone ); + CPPUNIT_TEST_SUITE( TestYesNoNone ); /* note the statement here and then the actual prototype below */ CPPUNIT_TEST( testBasics ); CPPUNIT_TEST_SUITE_END();