summaryrefslogtreecommitdiff
path: root/test/AuthConfigFactoryTest.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-03-23 01:34:37 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-03-23 01:34:37 +0900
commiteed804baaa02b4f81a27ba2844868b19992a90a1 (patch)
treef6c5741443a979593fe080422ac78ef1b0f699d2 /test/AuthConfigFactoryTest.cc
parent4acc0f88317287b86c6b89ba5e5262d3ebd30cc9 (diff)
Use std::set instead of std::deque if the elements are sorted and
insertions and deletions are frequent.
Diffstat (limited to 'test/AuthConfigFactoryTest.cc')
-rw-r--r--test/AuthConfigFactoryTest.cc25
1 files changed, 20 insertions, 5 deletions
diff --git a/test/AuthConfigFactoryTest.cc b/test/AuthConfigFactoryTest.cc
index ed698f6b..e660bdfc 100644
--- a/test/AuthConfigFactoryTest.cc
+++ b/test/AuthConfigFactoryTest.cc
@@ -195,6 +195,21 @@ void AuthConfigFactoryTest::testCreateAuthConfig_ftp()
factory.createAuthConfig(req, &option)->getAuthText());
}
+namespace {
+SharedHandle<AuthConfigFactory::BasicCred>
+createBasicCred(const std::string& user,
+ const std::string& password,
+ const std::string& host, uint16_t port,
+ const std::string& path,
+ bool activated = false)
+{
+ SharedHandle<AuthConfigFactory::BasicCred> bc
+ (new AuthConfigFactory::BasicCred(user, password, host, port, path,
+ activated));
+ return bc;
+}
+} // namespace
+
void AuthConfigFactoryTest::testUpdateBasicCred()
{
Option option;
@@ -204,15 +219,15 @@ void AuthConfigFactoryTest::testUpdateBasicCred()
AuthConfigFactory factory;
factory.updateBasicCred
- (AuthConfigFactory::BasicCred("myname", "mypass", "localhost", 80, "/", true));
+ (createBasicCred("myname", "mypass", "localhost", 80, "/", true));
factory.updateBasicCred
- (AuthConfigFactory::BasicCred("price", "j38jdc", "localhost", 80, "/download", true));
+ (createBasicCred("price", "j38jdc", "localhost", 80, "/download", true));
factory.updateBasicCred
- (AuthConfigFactory::BasicCred("soap", "planB", "localhost", 80, "/download/beta", true));
+ (createBasicCred("soap", "planB", "localhost", 80, "/download/beta", true));
factory.updateBasicCred
- (AuthConfigFactory::BasicCred("alice", "ium8", "localhost", 80, "/documents", true));
+ (createBasicCred("alice", "ium8", "localhost", 80, "/documents", true));
factory.updateBasicCred
- (AuthConfigFactory::BasicCred("jack", "jackx", "mirror", 80, "/doc", true));
+ (createBasicCred("jack", "jackx", "mirror", 80, "/doc", true));
SharedHandle<Request> req(new Request());
req->setUri("http://localhost/download/v2.6/Changelog");