From b08ecaecc1e39b7b01e02b7b73559d8b34ff46a5 Mon Sep 17 00:00:00 2001 From: Bastiaan Bakker Date: Sun, 29 Apr 2001 13:09:16 +0000 Subject: Merged Baptiste Lepilleurs CppUnitW 1.2. Some differences: TypeInfo stuff (in TestSuite) compiled in only if USE_TYPEINFO is set. TestSuite.getTests now returns a const ref instead of taking a ref as param. Removed auto_ptr stuff from TestFactoryRegistry: auto_ptr cannot be used in containers. --- src/cppunit/TestRegistry.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/cppunit/TestRegistry.cpp') diff --git a/src/cppunit/TestRegistry.cpp b/src/cppunit/TestRegistry.cpp index f4eaf74..cb96eb0 100644 --- a/src/cppunit/TestRegistry.cpp +++ b/src/cppunit/TestRegistry.cpp @@ -1,18 +1,18 @@ +#if _MSC_VER > 1000 // VC++ +#pragma once +#pragma warning( disable : 4786 ) // disable warning debug symbol > 255... +#endif // _MSC_VER > 1000 + #include "cppunit/TestRegistry.h" #include "cppunit/Test.h" namespace CppUnit { -TestRegistry* -TestRegistry::s_registry = NULL; - TestRegistry& TestRegistry::getRegistry () { - if (NULL == s_registry) { - s_registry = new TestRegistry(); - } - return *s_registry; + static TestRegistry registry; // instantiated on first call of getRegistry(). + return registry; } void -- cgit v1.2.1