[Libreoffice-commits] cppunit.git: Branch 'feature/c++11' - include/cppunit

Markus Mohrhard markus.mohrhard at googlemail.com
Sat Oct 15 15:10:35 UTC 2016


 include/cppunit/extensions/HelperMacros.h |   15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

New commits:
commit 840675f45d1245732b0f3ae5c1a5b4fc5fffec7b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Oct 15 17:09:59 2016 +0200

    replace with std::unique_ptr

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 );                             \


More information about the Libreoffice-commits mailing list