From 3505201f3333c937b5b870d70019d400c722a69f Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 20 Apr 2008 00:50:22 +0000 Subject: 2008-04-20 Tatsuhiro Tsujikawa Rewritten SharedHandle. Now copy constructor taking raw pointer has keyword explicit and SharedHandle's default constructor initializes its internal obj to null, old implementation initializes it using obj's default constructor. To assign null, write SharedHandle x(...); x.reset(); TODO: test/SharedHandleTest.cc needs more tests. * src/SharedHandle.h --- test/BencodeVisitorTest.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/BencodeVisitorTest.cc') diff --git a/test/BencodeVisitorTest.cc b/test/BencodeVisitorTest.cc index 0e780378..7b6af005 100644 --- a/test/BencodeVisitorTest.cc +++ b/test/BencodeVisitorTest.cc @@ -32,14 +32,14 @@ void BencodeVisitorTest::testVisit_data() { BencodeVisitor v; std::string str = "apple"; - MetaEntryHandle m = new Data(str.c_str(), str.size()); + MetaEntryHandle m(new Data(str.c_str(), str.size())); m->accept(&v); CPPUNIT_ASSERT_EQUAL(std::string("5:apple"), v.getBencodedData()); } { BencodeVisitor v; std::string str = "123"; - MetaEntryHandle m = new Data(str.c_str(), str.size(), true); + MetaEntryHandle m(new Data(str.c_str(), str.size(), true)); m->accept(&v); CPPUNIT_ASSERT_EQUAL(std::string("i123e"), v.getBencodedData()); } -- cgit