2007-10-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented BitTorrent/http/ftp integrated download. I've rewritten lots of files and now some headers have forward class declarations to reduce compile time. The implementation is extremely alpha stage, I recommend to use this for testing purpose only.
This commit is contained in:
@@ -27,10 +27,10 @@ void ByteArrayDiskWriterTest::testWriteAndRead() {
|
||||
ByteArrayDiskWriter bw;
|
||||
|
||||
string msg1 = "Hello world!";
|
||||
bw.writeData(msg1.c_str(), msg1.size(), 0);
|
||||
bw.writeData((const unsigned char*)msg1.c_str(), msg1.size(), 0);
|
||||
|
||||
char buf[100];
|
||||
int32_t c = bw.readData(buf, sizeof(buf), 0);
|
||||
int32_t c = bw.readData((unsigned char*)buf, sizeof(buf), 0);
|
||||
buf[c] = '\0';
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(msg1, string(buf));
|
||||
@@ -38,7 +38,7 @@ void ByteArrayDiskWriterTest::testWriteAndRead() {
|
||||
// second call
|
||||
memset(buf, '\0', sizeof(buf));
|
||||
|
||||
c = bw.readData(buf, sizeof(buf), 0);
|
||||
c = bw.readData((unsigned char*)buf, sizeof(buf), 0);
|
||||
buf[c] = '\0';
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(msg1, string(buf));
|
||||
@@ -48,10 +48,10 @@ void ByteArrayDiskWriterTest::testWriteAndRead2() {
|
||||
ByteArrayDiskWriter bw;
|
||||
|
||||
string msg1 = "Hello world!";
|
||||
bw.writeData(msg1.c_str(), msg1.size(), 16);
|
||||
bw.writeData((const unsigned char*)msg1.c_str(), msg1.size(), 16);
|
||||
|
||||
char buf[100];
|
||||
int32_t c = bw.readData(buf, sizeof(buf), 16);
|
||||
int32_t c = bw.readData((unsigned char*)buf, sizeof(buf), 16);
|
||||
buf[c] = '\0';
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(msg1, string(buf));
|
||||
@@ -59,7 +59,7 @@ void ByteArrayDiskWriterTest::testWriteAndRead2() {
|
||||
// second call
|
||||
memset(buf, '\0', sizeof(buf));
|
||||
|
||||
c = bw.readData(buf, sizeof(buf), 16);
|
||||
c = bw.readData((unsigned char*)buf, sizeof(buf), 16);
|
||||
buf[c] = '\0';
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(msg1, string(buf));
|
||||
|
||||
Reference in New Issue
Block a user