Made BufferedFile ctor take const char* args

This commit is contained in:
Tatsuhiro Tsujikawa 2012-09-25 23:44:41 +09:00
parent c63af24c63
commit f133091a9e
18 changed files with 39 additions and 35 deletions

View file

@ -24,16 +24,16 @@ void BufferedFileTest::testOpen()
{
File f(A2_TEST_OUT_DIR"/aria2_BufferedFileTest_testOpen");
f.remove();
BufferedFile fail(f.getPath(), BufferedFile::READ);
BufferedFile fail(f.getPath().c_str(), BufferedFile::READ);
CPPUNIT_ASSERT(!fail);
BufferedFile wr(f.getPath(), BufferedFile::WRITE);
BufferedFile wr(f.getPath().c_str(), BufferedFile::WRITE);
CPPUNIT_ASSERT(wr);
std::string msg = "aria2 rules\nalpha\nbravo\ncharlie";
wr.write(msg.data(), msg.size());
wr.close();
BufferedFile rd(f.getPath(), BufferedFile::READ);
BufferedFile rd(f.getPath().c_str(), BufferedFile::READ);
char buf[256];
size_t len = rd.read(buf, 11);
CPPUNIT_ASSERT_EQUAL((size_t)11, len);