From 840675f45d1245732b0f3ae5c1a5b4fc5fffec7b Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Sat, 15 Oct 2016 17:09:59 +0200 Subject: replace with std::unique_ptr --- include/cppunit/extensions/HelperMacros.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/include/cppunit/extensions/HelperMacros.h b/include/cppunit/extensions/HelperMacros.h index e883960..3dfab2d 100644 --- a/include/cppunit/extensions/HelperMacros.h +++ b/include/cppunit/extensions/HelperMacros.h @@ -165,24 +165,15 @@ */ #define CPPUNIT_TEST_SUITE_END() \ } \ - \ - struct CppUnitExDeleter { /* avoid deprecated auto_ptr warnings */ \ - CPPUNIT_NS::TestSuite *suite; \ - CppUnitExDeleter() : suite (nullptr) {} \ - ~CppUnitExDeleter() { delete suite; } \ - CPPUNIT_NS::TestSuite *release() { \ - CPPUNIT_NS::TestSuite *tmp = suite; suite = nullptr; return tmp; \ - } \ - }; \ \ public: \ static CPPUNIT_NS::TestSuite *suite() \ { \ const CPPUNIT_NS::TestNamer &namer = getTestNamer__(); \ - CppUnitExDeleter guard; \ - guard.suite = new CPPUNIT_NS::TestSuite( namer.getFixtureName() ); \ + std::unique_ptr guard( \ + new CPPUNIT_NS::TestSuite( namer.getFixtureName() )); \ CPPUNIT_NS::ConcretTestFixtureFactory factory; \ - CPPUNIT_NS::TestSuiteBuilderContextBase context( *guard.suite, \ + CPPUNIT_NS::TestSuiteBuilderContextBase context( *guard.get(), \ namer, \ factory ); \ TestFixtureType::addTestsToSuite( context ); \ -- cgit v1.2.1