2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed "using namespace std;" from all sources. Appended std:: prefix to c++ standard classes. Included string.h where mem* function are used.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
#include "Option.h"
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
|
||||
using namespace std;
|
||||
namespace aria2 {
|
||||
|
||||
class RequestGroupTest : public CppUnit::TestFixture {
|
||||
|
||||
@@ -26,10 +26,10 @@ CPPUNIT_TEST_SUITE_REGISTRATION( RequestGroupTest );
|
||||
void RequestGroupTest::testRegisterSearchRemove()
|
||||
{
|
||||
Option op;
|
||||
RequestGroup rg(&op, Strings());
|
||||
ServerHostHandle sv1 = new ServerHost(1, "localhost1");
|
||||
ServerHostHandle sv2 = new ServerHost(2, "localhost2");
|
||||
ServerHostHandle sv3 = new ServerHost(3, "localhost3");
|
||||
RequestGroup rg(&op, std::deque<std::string>());
|
||||
SharedHandle<ServerHost> sv1 = new ServerHost(1, "localhost1");
|
||||
SharedHandle<ServerHost> sv2 = new ServerHost(2, "localhost2");
|
||||
SharedHandle<ServerHost> sv3 = new ServerHost(3, "localhost3");
|
||||
|
||||
rg.registerServerHost(sv3);
|
||||
rg.registerServerHost(sv1);
|
||||
@@ -38,21 +38,21 @@ void RequestGroupTest::testRegisterSearchRemove()
|
||||
CPPUNIT_ASSERT(rg.searchServerHost(0).isNull());
|
||||
|
||||
{
|
||||
ServerHostHandle sv = rg.searchServerHost(1);
|
||||
SharedHandle<ServerHost> sv = rg.searchServerHost(1);
|
||||
CPPUNIT_ASSERT(!sv.isNull());
|
||||
CPPUNIT_ASSERT_EQUAL(string("localhost1"), sv->getHostname());
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("localhost1"), sv->getHostname());
|
||||
}
|
||||
|
||||
rg.removeServerHost(1);
|
||||
|
||||
{
|
||||
ServerHostHandle sv = rg.searchServerHost(1);
|
||||
SharedHandle<ServerHost> sv = rg.searchServerHost(1);
|
||||
CPPUNIT_ASSERT(sv.isNull());
|
||||
}
|
||||
{
|
||||
ServerHostHandle sv = rg.searchServerHost(2);
|
||||
SharedHandle<ServerHost> sv = rg.searchServerHost(2);
|
||||
CPPUNIT_ASSERT(!sv.isNull());
|
||||
CPPUNIT_ASSERT_EQUAL(string("localhost2"), sv->getHostname());
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("localhost2"), sv->getHostname());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,9 +62,11 @@ void RequestGroupTest::testRemoveURIWhoseHostnameIs()
|
||||
"ftp://localhost/aria2.zip",
|
||||
"http://mirror/aria2.zip" };
|
||||
Option op;
|
||||
RequestGroup rg(&op, Strings(&uris[0], &uris[3]));
|
||||
RequestGroup rg(&op, std::deque<std::string>(&uris[0], &uris[3]));
|
||||
rg.removeURIWhoseHostnameIs("localhost");
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)1, rg.getRemainingUris().size());
|
||||
CPPUNIT_ASSERT_EQUAL(string("http://mirror/aria2.zip"),
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("http://mirror/aria2.zip"),
|
||||
rg.getRemainingUris()[0]);
|
||||
}
|
||||
|
||||
} // namespace aria2
|
||||
|
||||
Reference in New Issue
Block a user