replaced std::auto_ptr by new std::unique_ptr

This commit is contained in:
Marc Wäckerlin
2015-07-13 11:55:17 +00:00
parent 2f73e3bdff
commit 7991de3432
5 changed files with 46 additions and 46 deletions

View File

@@ -22,7 +22,7 @@ class NodeTest: public CppUnit::TestFixture {
}
void clone() {
xml::Node t("test");
std::auto_ptr<xml::Node> p(t.clone());
std::unique_ptr<xml::Node> p(t.clone());
CPPUNIT_ASSERT_EQUAL(std::string("test"), p->name());
}
void shift() {
@@ -100,7 +100,7 @@ class StringTest: public CppUnit::TestFixture {
}
void clone() {
xml::String t("test");
std::auto_ptr<xml::Node> p(t.clone());
std::unique_ptr<xml::Node> p(t.clone());
CPPUNIT_ASSERT_EQUAL(std::string("test"), p->name());
}
void shift() {
@@ -181,7 +181,7 @@ class ComplexTest: public CppUnit::TestFixture {
<<"<child a=\"b\"/>"
<<"< otherchild >< / otherchild >< otherchild / >"<<std::endl
<<"</base>";
std::auto_ptr<xml::Node> node(factory.read(file1)); // should work
std::unique_ptr<xml::Node> node(factory.read(file1)); // should work
CPPUNIT_ASSERT_EQUAL((size_t)2, node->list("child").size());
CPPUNIT_ASSERT_EQUAL((size_t)3, (*node)[0].list("childofchild").size());
CPPUNIT_ASSERT_EQUAL((size_t)4, (*node)[0].list("number").size());
@@ -354,7 +354,7 @@ class FunTest: public CppUnit::TestFixture {
<<xml::String("h1").attr("class", xml::optional)
<<xml::String("h2")
<<xml::String("p")));
std::auto_ptr<xml::Node> read(factory.read(ss)); // read back the example
std::unique_ptr<xml::Node> read(factory.read(ss)); // read back the example
std::stringstream ss2;
read->out(ss2);
CPPUNIT_ASSERT_EQUAL(contents, ss2.str());