diff options
| author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-10-15 17:09:59 +0200 |
|---|---|---|
| committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-10-15 17:31:58 +0200 |
| commit | c314941600c5bd601831e6204b04b06a223064e7 (patch) | |
| tree | 2a88ed0966c93ad66360addc29e4c758da982f88 /include/cppunit/extensions | |
| parent | 29ae31614fb70e192f63fdab1c65105493319edc (diff) | |
| download | cppunit-c314941600c5bd601831e6204b04b06a223064e7.tar.gz | |
replace with std::unique_ptr
Diffstat (limited to 'include/cppunit/extensions')
| -rw-r--r-- | include/cppunit/extensions/HelperMacros.h | 15 |
1 files 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<CPPUNIT_NS::TestSuite> guard( \ + new CPPUNIT_NS::TestSuite( namer.getFixtureName() )); \ CPPUNIT_NS::ConcretTestFixtureFactory<TestFixtureType> factory; \ - CPPUNIT_NS::TestSuiteBuilderContextBase context( *guard.suite, \ + CPPUNIT_NS::TestSuiteBuilderContextBase context( *guard.get(), \ namer, \ factory ); \ TestFixtureType::addTestsToSuite( context ); \ |
