diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-02-08 15:53:45 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-02-08 15:53:45 +0000 |
| commit | 1b7c1982896dba1d38e1fe84ba9660996607f5f9 (patch) | |
| tree | d12047cb37ded1e18d4d5b97844412538beb19ff /test/BencodeVisitorTest.cc | |
| parent | d82e183d346375ac8a58a298a58728be615f947e (diff) | |
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.
Diffstat (limited to 'test/BencodeVisitorTest.cc')
| -rw-r--r-- | test/BencodeVisitorTest.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/test/BencodeVisitorTest.cc b/test/BencodeVisitorTest.cc index 3af7e0b4..0e780378 100644 --- a/test/BencodeVisitorTest.cc +++ b/test/BencodeVisitorTest.cc @@ -4,6 +4,8 @@ #include "Dictionary.h" #include <cppunit/extensions/HelperMacros.h> +namespace aria2 { + class BencodeVisitorTest:public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(BencodeVisitorTest); @@ -29,17 +31,17 @@ void BencodeVisitorTest::testVisit_data() { { BencodeVisitor v; - string str = "apple"; + std::string str = "apple"; MetaEntryHandle m = new Data(str.c_str(), str.size()); m->accept(&v); - CPPUNIT_ASSERT_EQUAL(string("5:apple"), v.getBencodedData()); + CPPUNIT_ASSERT_EQUAL(std::string("5:apple"), v.getBencodedData()); } { BencodeVisitor v; - string str = "123"; + std::string str = "123"; MetaEntryHandle m = new Data(str.c_str(), str.size(), true); m->accept(&v); - CPPUNIT_ASSERT_EQUAL(string("i123e"), v.getBencodedData()); + CPPUNIT_ASSERT_EQUAL(std::string("i123e"), v.getBencodedData()); } } @@ -47,24 +49,26 @@ void BencodeVisitorTest::testVisit_list() { BencodeVisitor v; List l; - string s1 = "alpha"; + std::string s1 = "alpha"; l.add(new Data(s1.c_str(), s1.size())); - string s2 = "bravo"; + std::string s2 = "bravo"; l.add(new Data(s2.c_str(), s2.size())); - string s3 = "123"; + std::string s3 = "123"; l.add(new Data(s3.c_str(), s3.size(), true)); l.accept(&v); - CPPUNIT_ASSERT_EQUAL(string("l5:alpha5:bravoi123ee"), v.getBencodedData()); + CPPUNIT_ASSERT_EQUAL(std::string("l5:alpha5:bravoi123ee"), v.getBencodedData()); } void BencodeVisitorTest::testVisit_dictionary() { BencodeVisitor v; Dictionary d; - string s1 = "alpha"; + std::string s1 = "alpha"; d.put("team", new Data(s1.c_str(), s1.size())); - string s2 = "123"; + std::string s2 = "123"; d.put("score", new Data(s2.c_str(), s2.size(), true)); d.accept(&v); - CPPUNIT_ASSERT_EQUAL(string("d4:team5:alpha5:scorei123ee"), v.getBencodedData()); + CPPUNIT_ASSERT_EQUAL(std::string("d4:team5:alpha5:scorei123ee"), v.getBencodedData()); } + +} // namespace aria2 |
