#include <cassert>
-CPPUNIT_TEST_SUITE_REGISTRATION( testPreCompiler );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestPreCompiler );
/**
* Test several ways of defining pre-compiler directives.
* 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
* 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
* 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
* 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 );
/* 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;
* rfc1738_escape_unescaped == -1
* rfc1738_escape_part == 1
*/
-void testRFC1738::testUrlEncode()
+void TestRfc1738::testUrlEncode()
{
char *result;
}
/** SECURITY BUG TESTS: avoid null truncation attacks by skipping %00 bytes */
-void testRFC1738::PercentZeroNullDecoding()
+void TestRfc1738::PercentZeroNullDecoding()
{
char *unescaped_str;
/**
* 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 );
// 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();
}
int64_t
MemObject::endOffset() const
{
- // XXX: required by testStore
+ // XXX: required by TestStore
return data_hdr.endOffset();
}
*/
#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"
#include <stdexcept>
-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 */
}
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");
/*
* 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 );
#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"
* authentication types
*/
void
-testAuthConfig::create()
+TestAuthConfig::create()
{
Debug::Levels[29]=9;
fake_auth_setup();
* authentication types
*/
void
-testAuthUserRequest::scheme()
+TestAuthUserRequest::scheme()
{
Debug::Levels[29]=9;
fake_auth_setup();
/* AuthBasicUserRequest::AuthBasicUserRequest works
*/
void
-testAuthBasicUserRequest::construction()
+TestAuthBasicUserRequest::construction()
{
AuthBasicUserRequest();
AuthBasicUserRequest *temp=new AuthBasicUserRequest();
}
void
-testAuthBasicUserRequest::username()
+TestAuthBasicUserRequest::username()
{
AuthUserRequest::Pointer temp = new AuthBasicUserRequest();
Auth::Basic::User *basic_auth=new Auth::Basic::User(Auth::Config::Find("basic"));
/* AuthDigestUserRequest::AuthDigestUserRequest works
*/
void
-testAuthDigestUserRequest::construction()
+TestAuthDigestUserRequest::construction()
{
AuthDigestUserRequest();
AuthDigestUserRequest *temp=new AuthDigestUserRequest();
}
void
-testAuthDigestUserRequest::username()
+TestAuthDigestUserRequest::username()
{
AuthUserRequest::Pointer temp = new AuthDigestUserRequest();
Auth::Digest::User *duser=new Auth::Digest::User(Auth::Config::Find("digest"));
/* AuthNTLMUserRequest::AuthNTLMUserRequest works
*/
void
-testAuthNTLMUserRequest::construction()
+TestAuthNtlmUserRequest::construction()
{
AuthNTLMUserRequest();
AuthNTLMUserRequest *temp=new AuthNTLMUserRequest();
}
void
-testAuthNTLMUserRequest::username()
+TestAuthNtlmUserRequest::username()
{
AuthUserRequest::Pointer temp = new AuthNTLMUserRequest();
Auth::Ntlm::User *nuser=new Auth::Ntlm::User(Auth::Config::Find("ntlm"));
/* AuthNegotiateUserRequest::AuthNegotiateUserRequest works
*/
void
-testAuthNegotiateUserRequest::construction()
+TestAuthNegotiateUserRequest::construction()
{
AuthNegotiateUserRequest();
AuthNegotiateUserRequest *temp=new AuthNegotiateUserRequest();
}
void
-testAuthNegotiateUserRequest::username()
+TestAuthNegotiateUserRequest::username()
{
AuthUserRequest::Pointer temp = new AuthNegotiateUserRequest();
Auth::Negotiate::User *nuser=new Auth::Negotiate::User(Auth::Config::Find("negotiate"));
* 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();
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();
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();
#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();
#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();
#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();
#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();
#include <stdexcept>
-CPPUNIT_TEST_SUITE_REGISTRATION( testBoilerplate );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestBoilerplate );
void
-testBoilerplate::testDemonstration()
+TestBoilerplate::testDemonstration()
{
CPPUNIT_ASSERT_EQUAL(0, 0);
}
/*
* 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();
#include <cppunit/TestAssert.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( testCacheManager );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestCacheManager );
/// Provides test code access to CacheManager internal symbols
class CacheManagerInternals : public CacheManager
/* init memory pools */
-void testCacheManager::setUp()
+void TestCacheManager::setUp()
{
Mem::Init();
AnyP::UriScheme::Init();
* Test creating a CacheManager
*/
void
-testCacheManager::testCreate()
+TestCacheManager::testCreate()
{
CacheManager::GetInstance(); //it's a singleton..
}
* registering an action makes it findable.
*/
void
-testCacheManager::testRegister()
+TestCacheManager::testRegister()
{
CacheManager *manager=CacheManager::GetInstance();
CPPUNIT_ASSERT(manager != nullptr);
}
void
-testCacheManager::testParseUrl()
+TestCacheManager::testParseUrl()
{
auto *mgr = static_cast<CacheManagerInternals *>(CacheManager::GetInstance());
CPPUNIT_ASSERT(mgr != nullptr);
* 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 );
#include <string>
-CPPUNIT_TEST_SUITE_REGISTRATION( testCharacterSet );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestCharacterSet );
void
-testCharacterSet::CharacterSetConstruction()
+TestCharacterSet::CharacterSetConstruction()
{
{
CharacterSet t(nullptr,"");
}
void
-testCharacterSet::CharacterSetAdd()
+TestCharacterSet::CharacterSetAdd()
{
CharacterSet t("test","0");
t.add(0);
}
void
-testCharacterSet::CharacterSetAddRange()
+TestCharacterSet::CharacterSetAddRange()
{
CharacterSet t("test","");
t.addRange('0','9');
}
void
-testCharacterSet::CharacterSetConstants()
+TestCharacterSet::CharacterSetConstants()
{
CPPUNIT_ASSERT_EQUAL(true,CharacterSet::ALPHA['a']);
CPPUNIT_ASSERT_EQUAL(true,CharacterSet::ALPHA['z']);
}
void
-testCharacterSet::CharacterSetUnion()
+TestCharacterSet::CharacterSetUnion()
{
{
CharacterSet hex("hex","");
}
void
-testCharacterSet::CharacterSetEqualityOp()
+TestCharacterSet::CharacterSetEqualityOp()
{
CPPUNIT_ASSERT_EQUAL(CharacterSet::ALPHA, CharacterSet::ALPHA);
CPPUNIT_ASSERT_EQUAL(CharacterSet::BIT, CharacterSet(nullptr,"01"));
}
void
-testCharacterSet::CharacterSetSubtract()
+TestCharacterSet::CharacterSetSubtract()
{
CharacterSet sample(nullptr, "0123456789aAbBcCdDeEfFz");
#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 );
#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];
return quotedOk && interpOk ;
}
-void testConfigParser::testParseQuoted()
+void TestConfigParser::testParseQuoted()
{
// SingleToken
CPPUNIT_ASSERT_EQUAL(true, doParseQuotedTest("SingleToken", "SingleToken"));
* 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();
#include <stdexcept>
-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
* 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();
#include <cppunit/TestAssert.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( testEnumIterator );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestEnumIterator );
enum class TestEnum {
enumBegin_ = 0,
};
void
-testEnumIterator::testForwardIter()
+TestEnumIterator::testForwardIter()
{
WholeEnum<TestEnum>::iterator i = WholeEnum<TestEnum>().begin();
CPPUNIT_ASSERT(*i == TestEnum::zero);
}
void
-testEnumIterator::testReverseIter()
+TestEnumIterator::testReverseIter()
{
WholeEnum<TestEnum>::reverse_iterator i = WholeEnum<TestEnum>().rbegin();
CPPUNIT_ASSERT(*i == TestEnum::four);
}
void
-testEnumIterator::testBidirectionalIter()
+TestEnumIterator::testBidirectionalIter()
{
WholeEnum<TestEnum>::iterator i = WholeEnum<TestEnum>().begin();
CPPUNIT_ASSERT(*i == TestEnum::zero);
}
void
-testEnumIterator::testRangeFor()
+TestEnumIterator::testRangeFor()
{
int j = 0;
for (auto e : WholeEnum<TestEnum>()) {
}
void
-testEnumIterator::testRangeForRange()
+TestEnumIterator::testRangeForRange()
{
int j = 0;
// free function-based range
}
void
-testEnumIterator::testUnsignedEnum()
+TestEnumIterator::testUnsignedEnum()
{
int j = 0;
for (auto e = WholeEnum<TestEnum>().rbegin(); e != WholeEnum<TestEnum>().rend(); ++e ) {
#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 );
#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();
}
* Test creating a Scheduler
*/
void
-testEvent::testCreate()
+TestEvent::testCreate()
{
EventScheduler scheduler = EventScheduler();
}
/* submit two callbacks, and cancel one, then dispatch and only the other should run.
*/
void
-testEvent::testCancel()
+TestEvent::testCancel()
{
EventScheduler scheduler;
CalledEvent event;
// submit two callbacks, and then dump the queue.
void
-testEvent::testDump()
+TestEvent::testDump()
{
EventScheduler scheduler;
CalledEvent event;
/* submit two callbacks, and find the right one.
*/
void
-testEvent::testFind()
+TestEvent::testFind()
{
EventScheduler scheduler;
CalledEvent event;
/* do a trivial test of invoking callbacks */
void
-testEvent::testCheckEvents()
+TestEvent::testCheckEvents()
{
EventScheduler scheduler;
CalledEvent event;
/* for convenience we have a singleton scheduler */
void
-testEvent::testSingleton()
+TestEvent::testSingleton()
{
EventScheduler *scheduler = dynamic_cast<EventScheduler *>(EventScheduler::GetInstance());
CPPUNIT_ASSERT(nullptr != scheduler);
* 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 );
#include <cppunit/TestAssert.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( testEventLoop );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestEventLoop );
void
-testEventLoop::testCreate()
+TestEventLoop::testCreate()
{
EventLoop();
}
* we do this with an instrumented async engine.
*/
void
-testEventLoop::testRunOnce()
+TestEventLoop::testRunOnce()
{
{
/* trivial case - no engine, should quit immediately */
* tracked, and the lowest non-negative value given to the last engine.
*/
void
-testEventLoop::testEngineTimeout()
+TestEventLoop::testEngineTimeout()
{
EventLoop theLoop;
RecordingEngine engineOne(5);
* hard-coded into EventLoop::runOnce()
*/
void
-testEventLoop::testEngineErrors()
+TestEventLoop::testEngineErrors()
{
EventLoop theLoop;
RecordingEngine failing_engine(AsyncEngine::EVENT_ERROR);
};
void
-testEventLoop::testSetTimeService()
+TestEventLoop::testSetTimeService()
{
EventLoop theLoop;
StubTime myTime;
* this defaults to the last added one, but can be explicitly nominated
*/
void
-testEventLoop::testSetPrimaryEngine()
+TestEventLoop::testSetPrimaryEngine()
{
EventLoop theLoop;
RecordingEngine first_engine(10);
* 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 );
#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)
}
void
-testHttp1Parser::testParserConstruct()
+TestHttp1Parser::testParserConstruct()
{
// whether the constructor works
{
}
void
-testHttp1Parser::testParseRequestLineProtocols()
+TestHttp1Parser::testParseRequestLineProtocols()
{
// ensure MemPools etc exist
globalSetup();
}
void
-testHttp1Parser::testParseRequestLineStrange()
+TestHttp1Parser::testParseRequestLineStrange()
{
// ensure MemPools etc exist
globalSetup();
}
void
-testHttp1Parser::testParseRequestLineTerminators()
+TestHttp1Parser::testParseRequestLineTerminators()
{
// ensure MemPools etc exist
globalSetup();
}
void
-testHttp1Parser::testParseRequestLineMethods()
+TestHttp1Parser::testParseRequestLineMethods()
{
// ensure MemPools etc exist
globalSetup();
}
void
-testHttp1Parser::testParseRequestLineInvalid()
+TestHttp1Parser::testParseRequestLineInvalid()
{
// ensure MemPools etc exist
globalSetup();
}
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
#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 );
#include "testHttpReply.h"
#include "unitTestMain.h"
-CPPUNIT_TEST_SUITE_REGISTRATION( testHttpReply );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestHttpReply );
class SquidConfig Config;
/* end */
void
-testHttpReply::setUp()
+TestHttpReply::setUp()
{
Mem::Init();
httpHeaderInitModule();
}
void
-testHttpReply::testSanityCheckFirstLine()
+TestHttpReply::testSanityCheckFirstLine()
{
MemBuf input;
HttpReply engine;
* 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();
#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
/* init memory pools */
void
-testHttpRequest::setUp()
+TestHttpRequest::setUp()
{
Mem::Init();
AnyP::UriScheme::Init();
* Test creating an HttpRequest object from a Url and method
*/
void
-testHttpRequest::testCreateFromUrl()
+TestHttpRequest::testCreateFromUrl()
{
/* vanilla url, implicit method */
unsigned short expected_port;
* Test BUG: URL '2000:800:45' opens host 2000 port 800 !!
*/
void
-testHttpRequest::testIPv6HostColonBug()
+TestHttpRequest::testIPv6HostColonBug()
{
unsigned short expected_port;
HttpRequest *aRequest = nullptr;
}
void
-testHttpRequest::testSanityCheckStartLine()
+TestHttpRequest::testSanityCheckStartLine()
{
MemBuf input;
const auto mx = MasterXaction::MakePortless<XactionInitiator::initHtcp>();
* 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 );
#include <sstream>
-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
* 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 */
* 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;
* a default constructed HttpRequestMethod is == Http::METHOD_NONE
*/
void
-testHttpRequestMethod::testDefaultConstructor()
+TestHttpRequestMethod::testDefaultConstructor()
{
HttpRequestMethod lhs;
HttpRequestMethod rhs(Http::METHOD_NONE);
* 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));
* 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;
* 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));
* 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));
* 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;
* 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 );
#include <cppunit/TestAssert.h>
-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);
}
void
-testIcmp::testHops()
+TestIcmp::testHops()
{
#if USE_ICMP
- stubIcmp icmp;
+ IcmpStub icmp;
/* test invalid -(under values) */
// negative : n > 33
#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 {};
/**
* 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();
#include <netdb.h>
#endif
-CPPUNIT_TEST_SUITE_REGISTRATION( testIpAddress );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestIpAddress );
void
-testIpAddress::testDefaults()
+TestIpAddress::testDefaults()
{
Ip::Address anIPA;
}
void
-testIpAddress::testInAddrConstructor()
+TestIpAddress::testInAddrConstructor()
{
struct in_addr inval;
struct in_addr outval;
}
void
-testIpAddress::testInAddr6Constructor()
+TestIpAddress::testInAddr6Constructor()
{
struct in6_addr inval;
struct in6_addr outval = IN6ADDR_ANY_INIT;
}
void
-testIpAddress::testSockAddrConstructor()
+TestIpAddress::testSockAddrConstructor()
{
struct sockaddr_in insock;
struct sockaddr_in outsock;
}
void
-testIpAddress::testSockAddr6Constructor()
+TestIpAddress::testSockAddr6Constructor()
{
struct sockaddr_in6 insock;
struct sockaddr_in6 outsock;
}
void
-testIpAddress::testCopyConstructor()
+TestIpAddress::testCopyConstructor()
{
struct sockaddr_in insock;
struct sockaddr_in outsock;
}
void
-testIpAddress::testHostentConstructor()
+TestIpAddress::testHostentConstructor()
{
struct hostent *hp = nullptr;
struct in_addr outval;
}
void
-testIpAddress::testStringConstructor()
+TestIpAddress::testStringConstructor()
{
struct in_addr outval;
struct in_addr expectval;
}
void
-testIpAddress::testsetEmpty()
+TestIpAddress::testsetEmpty()
{
Ip::Address anIPA;
struct in_addr inval;
}
void
-testIpAddress::testBooleans()
+TestIpAddress::testBooleans()
{
Ip::Address lhsIPA;
Ip::Address rhsIPA;
}
void
-testIpAddress::testtoStr()
+TestIpAddress::testtoStr()
{
struct in_addr inval;
char buf[MAX_IPSTRLEN];
}
void
-testIpAddress::testtoUrl_fromInAddr()
+TestIpAddress::testtoUrl_fromInAddr()
{
char buf[MAX_IPSTRLEN];
buf[0] = '\0';
}
void
-testIpAddress::testtoUrl_fromSockAddr()
+TestIpAddress::testtoUrl_fromSockAddr()
{
struct sockaddr_in sock;
sock.sin_addr.s_addr = htonl(0xC0A8640C);
}
void
-testIpAddress::testgetReverseString()
+TestIpAddress::testgetReverseString()
{
char buf[MAX_IPSTRLEN];
}
void
-testIpAddress::testMasking()
+TestIpAddress::testMasking()
{
char buf[MAX_IPSTRLEN];
Ip::Address anIPA;
}
void
-testIpAddress::testAddrInfo()
+TestIpAddress::testAddrInfo()
{
struct addrinfo *expect;
struct addrinfo *ipval = nullptr;
}
void
-testIpAddress::testBugNullingDisplay()
+TestIpAddress::testBugNullingDisplay()
{
// Weird Bug: address set to empty during string conversion somewhere.
// initial string gets created and returned OK.
* 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 );
#include "testLookupTable.h"
#include "unitTestMain.h"
-CPPUNIT_TEST_SUITE_REGISTRATION( testLookupTable );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestLookupTable );
enum EnumData {
ENUM_1,
};
void
-testLookupTable::testLookupTableLookup()
+TestLookupTable::testLookupTableLookup()
{
LookupTable<EnumData> lt(ENUM_INVALID, tableData);
// element found
#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:
#include <iostream>
#include <stdexcept>
-CPPUNIT_TEST_SUITE_REGISTRATION( testMem );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestMem );
class SomethingToAlloc
{
};
void
-testMem::testMemPool()
+TestMem::testMemPool()
{
const auto Pool = memPoolCreate("Test Pool", sizeof(SomethingToAlloc));
CPPUNIT_ASSERT(Pool);
}
void
-testMem::testMemProxy()
+TestMem::testMemProxy()
{
auto *something = new MoreToAlloc;
CPPUNIT_ASSERT(something);
#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 );
#include <stdexcept>
-CPPUNIT_TEST_SUITE_REGISTRATION( testNetDb );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestNetDb );
void
-testNetDb::testConstruct()
+TestNetDb::testConstruct()
{
// default construct and destruct
{
#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();
#include <iomanip>
#include <cppunit/TestAssert.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( testPackableStream );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestPackableStream );
/* init memory pools */
-void testPackableStream::setUp()
+void TestPackableStream::setUp()
{
Mem::Init();
}
// 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();
* 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();
#include <cassert>
-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";
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";
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";
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";
* 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 );
#include "testRefCount.h"
#include "unitTestMain.h"
-CPPUNIT_TEST_SUITE_REGISTRATION( testRefCount );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestRefCount );
class _ToRefCount : public RefCountable
{
};
void
-testRefCount::testCountability()
+TestRefCount::testCountability()
{
{
CPPUNIT_ASSERT_EQUAL(0, _ToRefCount::Instances);
}
void
-testRefCount::testObjectToRefCounted()
+TestRefCount::testObjectToRefCounted()
{
/* Test creating an object, using it , and then making available as a
* refcounted one:
}
void
-testRefCount::testStandalonePointer()
+TestRefCount::testStandalonePointer()
{
/* standalone pointers should be usable */
ToRefCount anObject;
}
void
-testRefCount::testCheckPointers()
+TestRefCount::testCheckPointers()
{
/* Can we check pointers for equality */
ToRefCount anObject;
}
void
-testRefCount::testPointerConst()
+TestRefCount::testPointerConst()
{
/* Can we get the pointer for a const object */
CPPUNIT_ASSERT_EQUAL(0, _ToRefCount::Instances);
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);
}
void
-testRefCount::testPointerFromRefCounter()
+TestRefCount::testPointerFromRefCounter()
{
/* Can we get a pointer to nonconst from a nonconst refcounter */
CPPUNIT_ASSERT_EQUAL(0, _ToRefCount::Instances);
}
void
-testRefCount::testDoubleInheritToSingleInherit()
+TestRefCount::testDoubleInheritToSingleInherit()
{
CPPUNIT_ASSERT_EQUAL(0, _ToRefCount::Instances);
#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 );
#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();
}
void
-testRock::setUp()
+TestRock::setUp()
{
CPPUNIT_NS::TestFixture::setUp();
}
void
-testRock::tearDown()
+TestRock::tearDown()
{
CPPUNIT_NS::TestFixture::tearDown();
}
void
-testRock::commonInit()
+TestRock::commonInit()
{
static bool inited = false;
}
void
-testRock::storeInit()
+TestRock::storeInit()
{
/* ok, ready to use */
Store::Root().init();
}
StoreEntry *
-testRock::createEntry(const int i)
+TestRock::createEntry(const int i)
{
RequestFlags flags;
flags.cachable.support();
}
StoreEntry *
-testRock::addEntry(const int i)
+TestRock::addEntry(const int i)
{
StoreEntry *const pe = createEntry(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;
}
void
-testRock::testRockSwapOut()
+TestRock::testRockSwapOut()
{
storeInit();
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());
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);
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
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
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());
* 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;
#include <stdexcept>
#include <unordered_map>
-CPPUNIT_TEST_SUITE_REGISTRATION( testSBuf );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestSBuf );
/* let this test link sanely */
#include "event.h"
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
}
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
}
void
-testSBuf::testAppendSBuf()
+TestSBuf::testAppendSBuf()
{
const SBuf appendix(fox1);
const char * const rawAppendix = appendix.rawContent();
}
void
-testSBuf::testPrintf()
+TestSBuf::testPrintf()
{
SBuf s1,s2;
s1.Printf("%s:%d:%03.3f","fox",10,12345.67);
}
void
-testSBuf::testAppendCString()
+TestSBuf::testAppendCString()
{
SBuf s1(fox1);
s1.append(fox2);
}
void
-testSBuf::testAppendStdString()
+TestSBuf::testAppendStdString()
{
const char *alphabet="abcdefghijklmnopqrstuvwxyz";
{
}
void
-testSBuf::testAppendf()
+TestSBuf::testAppendf()
{
SBuf s1,s2;
s1.appendf("%s:%d:%03.2f",fox,1234,1234.56);
}
void
-testSBuf::testDumpStats()
+TestSBuf::testDumpStats()
{
SBuf::GetStats().dump(std::cout);
MemBlob::GetStats().dump(std::cout);
}
void
-testSBuf::testSubscriptOp()
+TestSBuf::testSubscriptOp()
{
SBuf chg(literal);
CPPUNIT_ASSERT_EQUAL(chg[5],'u');
// 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
}
void
-testSBuf::testComparisons()
+TestSBuf::testComparisons()
{
//same length
SBuf s1("foo"),s2("foe");
}
void
-testSBuf::testConsume()
+TestSBuf::testConsume()
{
SBuf s1(literal),s2,s3;
s2=s1.consume(4);
}
void
-testSBuf::testRawContent()
+TestSBuf::testRawContent()
{
SBuf s1(literal);
SBuf s2(s1);
}
void
-testSBuf::testRawSpace()
+TestSBuf::testRawSpace()
{
SBuf s1(literal);
SBuf s2(fox1);
}
void
-testSBuf::testChop()
+TestSBuf::testChop()
{
SBuf s1(literal),s2;
s1.chop(4,5);
}
void
-testSBuf::testChomp()
+TestSBuf::testChomp()
{
SBuf s1("complete string");
SBuf s2(s1);
};
void
-testSBuf::testSubstr()
+TestSBuf::testSubstr()
{
SBuf s1(literal),s2,s3;
s2=s1.substr(4,5);
}
void
-testSBuf::testFindChar()
+TestSBuf::testFindChar()
{
const char *alphabet="abcdefghijklmnopqrstuvwxyz";
SBuf s1(alphabet);
}
void
-testSBuf::testFindSBuf()
+TestSBuf::testFindSBuf()
{
const char *alphabet="abcdefghijklmnopqrstuvwxyz";
SBuf haystack(alphabet);
}
void
-testSBuf::testRFindChar()
+TestSBuf::testRFindChar()
{
SBuf s1(literal);
SBuf::size_type idx;
}
void
-testSBuf::testRFindSBuf()
+TestSBuf::testRFindSBuf()
{
SBuf haystack(literal),afox("fox");
SBuf goobar("goobar");
}
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;
}
void
-testSBuf::testStringOps()
+TestSBuf::testStringOps()
{
SBuf sng(ToLower(literal)),
ref("the quick brown fox jumped over the lazy dog");
}
void
-testSBuf::testGrow()
+TestSBuf::testGrow()
{
SBuf t;
t.assign("foo");
}
void
-testSBuf::testReserve()
+TestSBuf::testReserve()
{
SBufReservationRequirements requirements;
// use unusual numbers to ensure we do not hit a lucky boundary situation
}
void
-testSBuf::testStartsWith()
+TestSBuf::testStartsWith()
{
static SBuf casebuf("THE QUICK");
CPPUNIT_ASSERT(literal.startsWith(SBuf(fox1)));
}
void
-testSBuf::testSBufStream()
+TestSBuf::testSBufStream()
{
SBuf b("const.string, int 10 and a float 10.5");
SBufStream ss;
}
void
-testSBuf::testFindFirstOf()
+TestSBuf::testFindFirstOf()
{
SBuf haystack(literal);
SBuf::size_type idx;
}
void
-testSBuf::testFindFirstNotOf()
+TestSBuf::testFindFirstNotOf()
{
SBuf haystack(literal);
SBuf::size_type idx;
}
void
-testSBuf::testAutoFind()
+TestSBuf::testAutoFind()
{
SBufFindTest test;
test.run();
}
void
-testSBuf::testStdStringOps()
+TestSBuf::testStdStringOps()
{
const char *alphabet="abcdefghijklmnopqrstuvwxyz";
std::string astr(alphabet);
}
void
-testSBuf::testIterators()
+TestSBuf::testIterators()
{
SBuf text("foo"), text2("foo");
CPPUNIT_ASSERT(text.begin() == text.begin());
}
void
-testSBuf::testSBufHash()
+TestSBuf::testSBufHash()
{
// same SBuf must have same hash
auto hasher=std::hash<SBuf>();
* 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 );
#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;
};
void
-testSBufList::testSBufListMembership()
+TestSBufList::testSBufListMembership()
{
SBufList foo;
for (int j=0; j<sbuf_tokens_number; ++j)
}
void
-testSBufList::testSBufListJoin()
+TestSBufList::testSBufListJoin()
{
SBufList foo;
CPPUNIT_ASSERT_EQUAL(SBuf(""),JoinContainerToSBuf(foo.begin(), foo.end(),SBuf()));
#include "compat/cppunit.h"
-class testSBufList : public CPPUNIT_NS::TestFixture
+class TestSBufList: public CPPUNIT_NS::TestFixture
{
- CPPUNIT_TEST_SUITE( testSBufList );
+ CPPUNIT_TEST_SUITE( TestSBufList );
CPPUNIT_TEST( testSBufListMembership );
CPPUNIT_TEST( testSBufListJoin );
CPPUNIT_TEST_SUITE_END();
#include "testStatHist.h"
#include "unitTestMain.h"
-CPPUNIT_TEST_SUITE_REGISTRATION(testStatHist);
+CPPUNIT_TEST_SUITE_REGISTRATION( TestStatHist );
typedef enum {
ZERO, ONE, TWO, THREE, FOUR, FIVE
}
void
-testStatHist::testStatHistBaseEquality()
+TestStatHist::testStatHistBaseEquality()
{
InspectingStatHist raw, test;
raw.enumInit(FIVE);
}
void
-testStatHist::testStatHistBaseAssignment()
+TestStatHist::testStatHistBaseAssignment()
{
InspectingStatHist raw, test;
raw.enumInit(FIVE);
}
void
-testStatHist::testStatHistLog()
+TestStatHist::testStatHistLog()
{
const double min=0.0, max=10000.0;
const int capacity=10;
}
void
-testStatHist::testStatHistSum()
+TestStatHist::testStatHistSum()
{
InspectingStatHist s1, s2;
s1.logInit(30,1.0,100.0);
#include "compat/cppunit.h"
-class testStatHist : public CPPUNIT_NS::TestFixture
+class TestStatHist: public CPPUNIT_NS::TestFixture
{
- CPPUNIT_TEST_SUITE( testStatHist );
+ CPPUNIT_TEST_SUITE( TestStatHist );
CPPUNIT_TEST( testStatHistBaseEquality );
CPPUNIT_TEST( testStatHistBaseAssignment );
CPPUNIT_TEST( testStatHistLog );
#include <limits>
-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<TestStore *>(this)->statsCalled = true;
+ const_cast<StoreControllerStub *>(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);
}
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);
}
void
-testStore::testStats()
+TestStore::testStats()
{
- TestStore *aStore(new TestStore);
+ StoreControllerStub *aStore(new StoreControllerStub);
Store::Init(aStore);
CPPUNIT_ASSERT_EQUAL(false, aStore->statsCalled);
StoreEntry entry;
}
void
-testStore::testMaxSize()
+TestStore::testMaxSize()
{
- Store::Controller *aStore(new TestStore);
+ Store::Controller *aStore(new StoreControllerStub);
Store::Init(aStore);
CPPUNIT_ASSERT_EQUAL(static_cast<uint64_t>(3), aStore->maxSize());
Store::FreeMemory();
} // namespace Store
void
-testStore::testSwapMetaTypeClassification()
+TestStore::testSwapMetaTypeClassification()
{
using limits = std::numeric_limits<Store::RawSwapMetaType>;
for (auto rawType = limits::min(); true; ++rawType) {
* 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 );
};
/// 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;
virtual StoreSearch *search();
};
-typedef RefCount<TestStore> TestStorePointer;
+typedef RefCount<StoreControllerStub> StoreControllerStubPointer;
#endif
#include "testStoreController.h"
#include "TestSwapDir.h"
-CPPUNIT_TEST_SUITE_REGISTRATION( testStoreController );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestStoreController );
static void
addSwapDir(TestSwapDirPointer aStore)
}
void
-testStoreController::testStats()
+TestStoreController::testStats()
{
Store::Init();
StoreEntry *logEntry = new StoreEntry;
}
void
-testStoreController::testMaxSize()
+TestStoreController::testMaxSize()
{
commonInit();
StoreEntry *logEntry = new StoreEntry;
}
void
-testStoreController::testSearch()
+TestStoreController::testSearch()
{
commonInit();
Store::Init();
* 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 );
#include "testStoreHashIndex.h"
#include "TestSwapDir.h"
-CPPUNIT_TEST_SUITE_REGISTRATION( testStoreHashIndex );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestStoreHashIndex );
static void
addSwapDir(TestSwapDirPointer aStore)
}
void
-testStoreHashIndex::testStats()
+TestStoreHashIndex::testStats()
{
StoreEntry *logEntry = new StoreEntry;
logEntry->createMemObject("dummy_storeId", nullptr, HttpRequestMethod());
}
void
-testStoreHashIndex::testMaxSize()
+TestStoreHashIndex::testMaxSize()
{
StoreEntry *logEntry = new StoreEntry;
logEntry->createMemObject("dummy_storeId", nullptr, HttpRequestMethod());
}
void
-testStoreHashIndex::testSearch()
+TestStoreHashIndex::testSearch()
{
commonInit();
Store::Init();
* 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 );
#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 */
}
void
-testString::testCmpEmptyString()
+TestString::testCmpEmptyString()
{
String left("");
String right;
}
void
-testString::testCmpNotEmptyDefault()
+TestString::testCmpNotEmptyDefault()
{
String left("foo");
String right;
CPPUNIT_ASSERT(right.cmp("foo", 1) < 0);
}
-void testString::testSubstr()
+void TestString::testSubstr()
{
String s("0123456789");
String check=s.substr(3,5);
* 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 );
#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"
const CharacterSet numbers("numbers","0123456789");
void
-testTokenizer::testTokenizerPrefix()
+TestTokenizer::testTokenizerPrefix()
{
const SBuf canary("This text should not be changed.");
}
void
-testTokenizer::testTokenizerSkip()
+TestTokenizer::testTokenizerSkip()
{
Parser::Tokenizer t(text);
SBuf s;
}
void
-testTokenizer::testTokenizerToken()
+TestTokenizer::testTokenizerToken()
{
Parser::Tokenizer t(text);
SBuf s;
}
void
-testTokenizer::testTokenizerSuffix()
+TestTokenizer::testTokenizerSuffix()
{
const SBuf canary("This text should not be changed.");
}
void
-testTokenizer::testCharacterSet()
+TestTokenizer::testCharacterSet()
{
}
void
-testTokenizer::testTokenizerInt64()
+TestTokenizer::testTokenizerInt64()
{
// successful parse in base 10
{
#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 );
#include <sstream>
-CPPUNIT_TEST_SUITE_REGISTRATION( testURL );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestUri );
/* init memory pools */
void
-testURL::setUp()
+TestUri::setUp()
{
Mem::Init();
AnyP::UriScheme::Init();
* This creates a URL for that scheme.
*/
void
-testURL::testConstructScheme()
+TestUri::testConstructScheme()
{
AnyP::UriScheme empty_scheme;
AnyP::Uri protoless_url(AnyP::PROTO_NONE);
* scheme instances.
*/
void
-testURL::testDefaultConstructor()
+TestUri::testDefaultConstructor()
{
AnyP::UriScheme aScheme;
AnyP::Uri aUrl;
#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();
#include <stdexcept>
-#define TESTDIR "testUfs_Store"
+#define TESTDIR "TestUfs_Store"
-CPPUNIT_TEST_SUITE_REGISTRATION( testUfs );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestUfs );
typedef RefCount<Fs::Ufs::UFSSwapDir> MySwapDirPointer;
extern REMOVALPOLICYCREATE createRemovalPolicy_lru; /* XXX fails with --enable-removal-policies=heap */
}
void
-testUfs::commonInit()
+TestUfs::commonInit()
{
static bool inited = false;
}
void
-testUfs::testUfsSearch()
+TestUfs::testUfsSearch()
{
/* test sequence
* make a valid working ufs swapdir
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);
* supplied on the configuration line.
*/
void
-testUfs::testUfsDefaultEngine()
+TestUfs::testUfsDefaultEngine()
{
/* boring common test boilerplate */
if (0 > system ("rm -rf " TESTDIR))
* 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();
#include <sstream>
-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;
* of migration
*/
void
-testUriScheme::testCastToprotocol_t()
+TestUriScheme::testCastToprotocol_t()
{
/* explicit cast */
AnyP::ProtocolType protocol = static_cast<AnyP::ProtocolType>(AnyP::UriScheme());
* a default constructed AnyP::UriScheme is == AnyP::PROTO_NONE
*/
void
-testUriScheme::testDefaultConstructor()
+TestUriScheme::testDefaultConstructor()
{
AnyP::UriScheme lhs;
AnyP::UriScheme rhs(AnyP::PROTO_NONE);
* 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);
* 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);
* 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));
* 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));
* 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);
}
void
-testUriScheme::setUp()
+TestUriScheme::setUp()
{
Mem::Init();
AnyP::UriScheme::Init();
* 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 );
#include <stdexcept>
-CPPUNIT_TEST_SUITE_REGISTRATION( testYesNoNone );
+CPPUNIT_TEST_SUITE_REGISTRATION( TestYesNoNone );
void
-testYesNoNone::testBasics()
+TestYesNoNone::testBasics()
{
// unconfigured, non-implicit
{
/*
* 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();