summaryrefslogtreecommitdiff
path: root/test/ByteArrayDiskWriterTest.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-02-08 15:53:45 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-02-08 15:53:45 +0000
commit1b7c1982896dba1d38e1fe84ba9660996607f5f9 (patch)
treed12047cb37ded1e18d4d5b97844412538beb19ff /test/ByteArrayDiskWriterTest.cc
parentd82e183d346375ac8a58a298a58728be615f947e (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/ByteArrayDiskWriterTest.cc')
-rw-r--r--test/ByteArrayDiskWriterTest.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/test/ByteArrayDiskWriterTest.cc b/test/ByteArrayDiskWriterTest.cc
index 6e12417e..2e6c52bd 100644
--- a/test/ByteArrayDiskWriterTest.cc
+++ b/test/ByteArrayDiskWriterTest.cc
@@ -2,7 +2,7 @@
#include <string>
#include <cppunit/extensions/HelperMacros.h>
-using namespace std;
+namespace aria2 {
class ByteArrayDiskWriterTest:public CppUnit::TestFixture {
@@ -26,36 +26,38 @@ CPPUNIT_TEST_SUITE_REGISTRATION( ByteArrayDiskWriterTest );
void ByteArrayDiskWriterTest::testWriteAndRead() {
ByteArrayDiskWriter bw;
- string msg1 = "Hello";
+ std::string msg1 = "Hello";
bw.writeData((const unsigned char*)msg1.c_str(), msg1.size(), 0);
// write at the end of stream
- string msg2 = " World";
+ std::string msg2 = " World";
bw.writeData((const unsigned char*)msg2.c_str(), msg2.size(), 5);
// write at the end of stream +1
- string msg3 = "!!";
+ std::string msg3 = "!!";
bw.writeData((const unsigned char*)msg3.c_str(), msg3.size(), 12);
// write space at the 'hole'
- string msg4 = " ";
+ std::string msg4 = " ";
bw.writeData((const unsigned char*)msg4.c_str(), msg4.size(), 11);
char buf[100];
int32_t c = bw.readData((unsigned char*)buf, sizeof(buf), 1);
buf[c] = '\0';
- CPPUNIT_ASSERT_EQUAL(string("ello World !!"), string(buf));
+ CPPUNIT_ASSERT_EQUAL(std::string("ello World !!"), std::string(buf));
}
void ByteArrayDiskWriterTest::testWriteAndRead2() {
ByteArrayDiskWriter bw;
- string msg1 = "Hello World";
+ std::string msg1 = "Hello World";
bw.writeData((const unsigned char*)msg1.c_str(), msg1.size(), 0);
- string msg2 = "From Mars";
+ std::string msg2 = "From Mars";
bw.writeData((const unsigned char*)msg2.c_str(), msg2.size(), 6);
char buf[100];
int32_t c = bw.readData((unsigned char*)buf, sizeof(buf), 0);
buf[c] = '\0';
- CPPUNIT_ASSERT_EQUAL(string("Hello From Mars"), string(buf));
+ CPPUNIT_ASSERT_EQUAL(std::string("Hello From Mars"), std::string(buf));
}
+
+} // namespace aria2