CodingGuideLines.txt | 10 ---- NEWS | 12 ++++- configure.ac | 13 ----- examples/ClockerPlugIn/ClockerModel.h | 14 ++--- examples/DumperPlugIn/DumperListener.h | 4 - examples/cppunittest/TestAssertTest.cpp | 8 +++ examples/cppunittest/XmlOutputterTest.h | 4 - include/cppunit/Message.h | 8 --- include/cppunit/Portability.h | 14 ----- include/cppunit/TestAssert.h | 45 +++++++++++++------ include/cppunit/TestPath.h | 11 +--- include/cppunit/TestResult.h | 8 --- include/cppunit/TestResultCollector.h | 11 +--- include/cppunit/TestSuite.h | 6 +- include/cppunit/XmlOutputter.h | 8 +-- include/cppunit/config/config-evc4.h | 4 - include/cppunit/config/config-msvc6.h | 4 - include/cppunit/extensions/TestFactoryRegistry.h | 9 --- include/cppunit/extensions/TestSuiteBuilderContext.h | 4 - include/cppunit/plugin/PlugInManager.h | 2 include/cppunit/plugin/PlugInParameters.h | 2 include/cppunit/portability/CppUnitDeque.h | 25 ---------- include/cppunit/portability/CppUnitMap.h | 29 ------------ include/cppunit/portability/CppUnitSet.h | 28 ----------- include/cppunit/portability/CppUnitStack.h | 26 ---------- include/cppunit/portability/CppUnitVector.h | 25 ---------- include/cppunit/portability/Makefile.am | 5 -- include/cppunit/tools/StringTools.h | 4 - include/cppunit/tools/XmlElement.h | 6 +- include/cppunit/ui/mfc/MfcTestRunner.h | 8 +-- include/cppunit/ui/qt/QtTestRunner.h | 4 - src/DllPlugInTester/CommandLineParser.h | 6 +- src/cppunit/ProtectorChain.h | 6 +- src/cppunit/TestFactoryRegistry.cpp | 4 - src/cppunit/TestSuite.cpp | 2 src/cppunit/cppunit.dsp | 20 -------- src/cppunit/cppunit.vcproj | 20 -------- src/cppunit/cppunit.vcxproj | 7 -- src/cppunit/cppunit_dll.dsp | 20 -------- src/cppunit/cppunit_dll.vcproj | 20 -------- src/cppunit/cppunit_dll.vcxproj | 7 -- src/msvc6/testrunner/MfcTestRunner.cpp | 2 42 files changed, 109 insertions(+), 366 deletions(-)
New commits: commit 921cb4648308fc66f17fa99ec65d6d9c67be9093 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue Dec 13 11:02:11 2016 +0100 no need for optional features now that we require C++11 diff --git a/configure.ac b/configure.ac index 9dd6aca..14d8c01 100644 --- a/configure.ac +++ b/configure.ac @@ -73,18 +73,6 @@ AC_SUBST(LT_AGE) # Check for cflags # ================ -# ================================================================ -# Check if optional features should be enabled (requires c++11) -# ================================================================ - -AC_ARG_ENABLE(optional_features, - [AS_HELP_STRING([--enable-optional-features], [Build with some optional features requiring C++11 support.])], - [enable_optional="$enableval"], - [enable_optional=yes] -) - -AM_CONDITIONAL([WITH_OPTIONAL_FEATURES], [test "x$enable_optional" != "xno"]) - # ===== # Debug # ===== @@ -166,6 +154,5 @@ Build configuration: debug: ${enable_debug} docs: ${enable_doc} werror: ${enable_werror} - optional-features: ${enable_optional} ============================================================================== ]) commit abc8689a96db70297aeec7088eab7005dc1a907d Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue Dec 13 11:01:25 2016 +0100 update the NEWS file with C++11 and portability changes diff --git a/NEWS b/NEWS index 1ea436a..9044dbe 100644 --- a/NEWS +++ b/NEWS @@ -2,9 +2,17 @@ --------------------- * Portability: - - Always build with C++11 + - Always build with C++11. - - Always require RTTI support + - Always require RTTI support. + + - Removed support for compilers that don't support + default template arguments with standard containers. + + - Removed portability headers for wrapper around + standard containers. + + - Support C++11 enum class in asserter. * Test Plug-in Runner: - Fixed crash on Win64 in test runner (fdo#81433) commit 435dee2d69a47c8d46aa1aab3d2906bfc8eab74e Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue Dec 13 10:54:01 2016 +0100 add support for enum class to the asserter The asserter now has special handling to convert the enum class to a std::string. This does not work without some template magic as enum class has no implicit conversion to int. diff --git a/examples/cppunittest/TestAssertTest.cpp b/examples/cppunittest/TestAssertTest.cpp index 1516117..8a19957 100644 --- a/examples/cppunittest/TestAssertTest.cpp +++ b/examples/cppunittest/TestAssertTest.cpp @@ -13,6 +13,12 @@ an exception. */ +enum class EnumClass +{ + VALUE1, + VALUE2 +}; + CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( TestAssertTest, coreSuiteName() ); @@ -137,8 +143,10 @@ TestAssertTest::testAssertEqual() CPPUNIT_ASSERT_ASSERTION_PASS( CPPUNIT_ASSERT_EQUAL( 1, 1 ) ); CPPUNIT_ASSERT_ASSERTION_PASS( CPPUNIT_ASSERT_EQUAL( 1, foo() ) ); CPPUNIT_ASSERT_ASSERTION_PASS( CPPUNIT_ASSERT_EQUAL( 12345678, 12345678 ) ); + CPPUNIT_ASSERT_ASSERTION_PASS( CPPUNIT_ASSERT_EQUAL( EnumClass::VALUE1, EnumClass::VALUE1 ) ); CPPUNIT_ASSERT_ASSERTION_FAIL( CPPUNIT_ASSERT_EQUAL( 1, 2 ) ); + CPPUNIT_ASSERT_ASSERTION_FAIL( CPPUNIT_ASSERT_EQUAL( EnumClass::VALUE1, EnumClass::VALUE2 ) ); } diff --git a/include/cppunit/TestAssert.h b/include/cppunit/TestAssert.h index fa0bfa7..89f9209 100644 --- a/include/cppunit/TestAssert.h +++ b/include/cppunit/TestAssert.h @@ -5,8 +5,10 @@ #include <cppunit/Exception.h> #include <cppunit/Asserter.h> #include <cppunit/portability/Stream.h> +#include <type_traits> #include <stdio.h> #include <float.h> // For struct assertion_traits<double> +#include <type_traits> // Work around "passing 'T' chooses 'int' over 'unsigned int'" warnings when T // is an enum type: @@ -17,6 +19,35 @@ CPPUNIT_NS_BEGIN +namespace impl { + +// work around to handle C++11 enum class correctly. We need an own conversion to std::string +// as there is no implicit coversion to int for enum class. +template<typename T, typename Enable = void> +struct toString +{ + static std::string toStringImpl(const T& x) + { + OStringStream ost; + ost << x; + + return ost.str(); + } +}; + +template<typename T> +struct toString<T, typename std::enable_if<std::is_enum<T>::value >::type> +{ + static std::string toStringImpl(const T& x) + { + OStringStream ost; + ost << static_cast<typename std::underlying_type<T>::type>(x); + + return ost.str(); + } +}; + +} /*! \brief Traits used by CPPUNIT_ASSERT* macros. * @@ -71,22 +102,10 @@ struct assertion_traits static std::string toString( const T& x ) { - OStringStream ost; -// Work around "passing 'T' chooses 'int' over 'unsigned int'" warnings when T -// is an enum type: -#if defined __GNUC__ && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-promo" -#endif - ost << x; -#if defined __GNUC__ && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4) -#pragma GCC diagnostic pop -#endif - return ost.str(); + return impl::toString<T>::toStringImpl(x); } }; - /*! \brief Traits used by CPPUNIT_ASSERT_DOUBLES_EQUAL(). * * This specialisation from @c struct @c assertion_traits<> ensures that commit 98f0a738d2925c41b268388ce6defe86114f611a Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sun Dec 11 09:10:55 2016 +0100 update coding guidelines diff --git a/CodingGuideLines.txt b/CodingGuideLines.txt index ff3018c..d889fd0 100644 --- a/CodingGuideLines.txt +++ b/CodingGuideLines.txt @@ -13,9 +13,6 @@ CppUnit's coding guidelines for portability: - don't use the mutable keyword, instead do a const cast. -- don't use default template parameters. If needed, use STLPort wrapper - technic (see include/cppunit/portability/). - - don't use templatized member functions (template method declared inside a class), instead declares them as simple template functions (even mainstream compiler such as VC++ 6 as trouble with them). @@ -23,14 +20,8 @@ CppUnit's coding guidelines for portability: - don't use default parameter value in template function. Not supported by all compiler (on OS/390 for instance). -- dereferencing containers must be done by (*ref_ptr).data instead of - ref_ptr->data. - -- don't use C++11/C++14 features in non-optional code - In brief, it should be possible to compile CppUnit on a C++ compiler that do not have the following features: -- template default parameters - templatized member functions (that is a template function declared within a class). @@ -47,4 +38,3 @@ CppUnit's version control system management - new features and patches without bug report only in master and not in stable branches - commit 2b9f4b072bfb4129ee8eaaa86b3f068bdd2d581d Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sun Dec 11 08:44:46 2016 +0100 remove support for old broken C++ compilers diff --git a/examples/ClockerPlugIn/ClockerModel.h b/examples/ClockerPlugIn/ClockerModel.h index 46f7ff1..9c48948 100644 --- a/examples/ClockerPlugIn/ClockerModel.h +++ b/examples/ClockerPlugIn/ClockerModel.h @@ -7,9 +7,9 @@ #define CLOCKERMODEL_H #include <cppunit/TestPath.h> -#include <cppunit/portability/CppUnitVector.h> -#include <cppunit/portability/CppUnitMap.h> -#include <cppunit/portability/CppUnitStack.h> +#include <vector> +#include <map> +#include <stack> #include <string> #ifdef CLOCKER_USE_WINNTTIMER @@ -67,7 +67,7 @@ private: CPPUNIT_NS::TestPath m_path; Timer m_timer; bool m_isSuite; - CppUnitVector<int> m_childIndexes; + std::vector<int> m_childIndexes; }; /// Prevents the use of the copy constructor. @@ -82,11 +82,11 @@ private: int m_testCaseCount; double m_totalTestCaseTime; - typedef CppUnitMap<CPPUNIT_NS::Test *, int> TestToIndexes; + typedef std::map<CPPUNIT_NS::Test *, int> TestToIndexes; TestToIndexes m_testToIndexes; - CppUnitStack<int> m_testIndexes; - CppUnitVector<TestInfo> m_tests; + std::stack<int> m_testIndexes; + std::vector<TestInfo> m_tests; }; diff --git a/examples/DumperPlugIn/DumperListener.h b/examples/DumperPlugIn/DumperListener.h index 0e24f34..4020d16 100644 --- a/examples/DumperPlugIn/DumperListener.h +++ b/examples/DumperPlugIn/DumperListener.h @@ -6,7 +6,7 @@ #ifndef DUMPERLISTENER_H #define DUMPERLISTENER_H -#include <cppunit/portability/CppUnitStack.h> +#include <stack> #include <cppunit/TestListener.h> #include <cppunit/TestPath.h> @@ -54,7 +54,7 @@ private: int m_testCount; int m_suiteWithTestCount; - CppUnitStack<bool> m_suiteHasTest; + std::stack<bool> m_suiteHasTest; }; diff --git a/examples/cppunittest/XmlOutputterTest.h b/examples/cppunittest/XmlOutputterTest.h index 697a452..b74226f 100644 --- a/examples/cppunittest/XmlOutputterTest.h +++ b/examples/cppunittest/XmlOutputterTest.h @@ -2,7 +2,7 @@ #define CPPUNITEST_XMLTESTRESULTOUTPUTTERTEST_H #include <cppunit/extensions/HelperMacros.h> -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> #include <cppunit/Test.h> #include <cppunit/TestFailure.h> #include <cppunit/TestResultCollector.h> @@ -70,7 +70,7 @@ private: private: CPPUNIT_NS::TestResultCollector *m_result; - CppUnitDeque<CPPUNIT_NS::Test *> m_dummyTests; + std::deque<CPPUNIT_NS::Test *> m_dummyTests; }; diff --git a/include/cppunit/Message.h b/include/cppunit/Message.h index 5b5e4ec..c3d8d92 100644 --- a/include/cppunit/Message.h +++ b/include/cppunit/Message.h @@ -8,17 +8,13 @@ #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z #endif -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> #include <string> CPPUNIT_NS_BEGIN -#if CPPUNIT_NEED_DLL_DECL -// template class CPPUNIT_API std::deque<std::string>; -#endif - /*! \brief Message associated to an Exception. * \ingroup CreatingNewAssertions * A message is composed of two items: @@ -143,7 +139,7 @@ public: private: std::string m_shortDescription; - typedef CppUnitDeque<std::string> Details; + typedef std::deque<std::string> Details; Details m_details; }; diff --git a/include/cppunit/Portability.h b/include/cppunit/Portability.h index fa7df25..d7c4c11 100644 --- a/include/cppunit/Portability.h +++ b/include/cppunit/Portability.h @@ -61,20 +61,6 @@ # endif // !defined(CPPUNIT_NO_STD_NAMESPACE) #endif // !defined(CPPUNIT_HAVE_NAMESPACES) -/* Define CPPUNIT_STD_NEED_ALLOCATOR to 1 if you need to specify - * the allocator you used when instantiating STL container. Typically - * used for compilers that do not support template default parameter. - * CPPUNIT_STD_ALLOCATOR will be used as the allocator. Default is - * std::allocator. On some compilers, you may need to change this to - * std::allocator<T>. - */ -#if CPPUNIT_STD_NEED_ALLOCATOR -# if !defined(CPPUNIT_STD_ALLOCATOR) -# define CPPUNIT_STD_ALLOCATOR std::allocator -# endif // !defined(CPPUNIT_STD_ALLOCATOR) -#endif // defined(CPPUNIT_STD_NEED_ALLOCATOR) - - // Compiler error location format for CompilerOutputter // If not define, assumes that it's gcc // See class CompilerOutputter for format. diff --git a/include/cppunit/TestPath.h b/include/cppunit/TestPath.h index c3c851c..8934479 100644 --- a/include/cppunit/TestPath.h +++ b/include/cppunit/TestPath.h @@ -8,7 +8,7 @@ #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z #endif -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> #include <string> CPPUNIT_NS_BEGIN @@ -16,11 +16,6 @@ CPPUNIT_NS_BEGIN class Test; -#if CPPUNIT_NEED_DLL_DECL -// template class CPPUNIT_API std::deque<Test *>; -#endif - - /*! \brief A List of Test representing a path to access a Test. * \ingroup ExecutingTest * @@ -174,7 +169,7 @@ protected: void checkIndexValid( int index ) const; /// A list of test names. - typedef CppUnitDeque<std::string> PathTestNames; + typedef std::deque<std::string> PathTestNames; /*! \brief Splits a path string into its test name components. * \param pathAsString Path string created with toString(). @@ -199,7 +194,7 @@ protected: PathTestNames &testNames ); protected: - typedef CppUnitDeque<Test *> Tests; + typedef std::deque<Test *> Tests; Tests m_tests; }; diff --git a/include/cppunit/TestResult.h b/include/cppunit/TestResult.h index e7e1050..aabd80b 100644 --- a/include/cppunit/TestResult.h +++ b/include/cppunit/TestResult.h @@ -9,7 +9,7 @@ #endif #include <cppunit/SynchronizedObject.h> -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> #include <string> CPPUNIT_NS_BEGIN @@ -24,10 +24,6 @@ class TestFailure; class TestListener; -#if CPPUNIT_NEED_DLL_DECL -// template class CPPUNIT_API std::deque<TestListener *>; -#endif - /*! \brief Manages TestListener. * \ingroup TrackingTestExecution * @@ -133,7 +129,7 @@ protected: virtual void endTestRun( Test *test ); protected: - typedef CppUnitDeque<TestListener *> TestListeners; + typedef std::deque<TestListener *> TestListeners; TestListeners m_listeners; ProtectorChain *m_protectorChain; bool m_stop; diff --git a/include/cppunit/TestResultCollector.h b/include/cppunit/TestResultCollector.h index 01b0a54..b78c978 100644 --- a/include/cppunit/TestResultCollector.h +++ b/include/cppunit/TestResultCollector.h @@ -9,16 +9,11 @@ #endif #include <cppunit/TestSuccessListener.h> -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> CPPUNIT_NS_BEGIN -#if CPPUNIT_NEED_DLL_DECL -// template class CPPUNIT_API std::deque<TestFailure *>; -// template class CPPUNIT_API std::deque<Test *>; -#endif - /*! \brief Collects test result. * \ingroup WritingTestResult @@ -36,8 +31,8 @@ CPPUNIT_NS_BEGIN class CPPUNIT_API TestResultCollector : public TestSuccessListener { public: - typedef CppUnitDeque<TestFailure *> TestFailures; - typedef CppUnitDeque<Test *> Tests; + typedef std::deque<TestFailure *> TestFailures; + typedef std::deque<Test *> Tests; /*! Constructs a TestResultCollector object. diff --git a/include/cppunit/TestSuite.h b/include/cppunit/TestSuite.h index 2b9cd8d..63c0a6b 100644 --- a/include/cppunit/TestSuite.h +++ b/include/cppunit/TestSuite.h @@ -9,7 +9,7 @@ #endif #include <cppunit/TestComposite.h> -#include <cppunit/portability/CppUnitVector.h> +#include <vector> CPPUNIT_NS_BEGIN @@ -56,7 +56,7 @@ public: * TestComposite interface instead. * \return Reference on a vector that contains the tests of the suite. */ - const CppUnitVector<Test *> &getTests() const; + const std::vector<Test *> &getTests() const; /*! Destroys all the tests of the suite. */ @@ -67,7 +67,7 @@ public: Test *doGetChildTestAt( int index ) const; private: - CppUnitVector<Test *> m_tests; + std::vector<Test *> m_tests; }; diff --git a/include/cppunit/XmlOutputter.h b/include/cppunit/XmlOutputter.h index da8164a..2bf9411 100644 --- a/include/cppunit/XmlOutputter.h +++ b/include/cppunit/XmlOutputter.h @@ -9,8 +9,8 @@ #endif #include <cppunit/Outputter.h> -#include <cppunit/portability/CppUnitDeque.h> -#include <cppunit/portability/CppUnitMap.h> +#include <deque> +#include <map> #include <cppunit/portability/Stream.h> @@ -85,7 +85,7 @@ public: */ virtual void setStandalone( bool standalone ); - typedef CppUnitMap<Test *,TestFailure*, std::less<Test*> > FailedTests; + typedef std::map<Test *,TestFailure*, std::less<Test*> > FailedTests; /*! \brief Sets the root element and adds its children. * @@ -137,7 +137,7 @@ protected: virtual void fillFailedTestsMap( FailedTests &failedTests ); protected: - typedef CppUnitDeque<XmlOutputterHook *> Hooks; + typedef std::deque<XmlOutputterHook *> Hooks; TestResultCollector *m_result; OStream &m_stream; diff --git a/include/cppunit/config/config-evc4.h b/include/cppunit/config/config-evc4.h index ae93ff3..dd1aeec 100644 --- a/include/cppunit/config/config-evc4.h +++ b/include/cppunit/config/config-evc4.h @@ -58,9 +58,7 @@ // Uncomment to turn on STL wrapping => use this to test compilation. // This will make CppUnit subclass std::vector & co to provide default // parameter. -/*#define CPPUNIT_STD_NEED_ALLOCATOR 1 -#define CPPUNIT_STD_ALLOCATOR std::allocator<T> -//#define CPPUNIT_NO_NAMESPACE 1 +/* #define CPPUNIT_NO_NAMESPACE 1 */ diff --git a/include/cppunit/config/config-msvc6.h b/include/cppunit/config/config-msvc6.h index 2607a46..0edc059 100644 --- a/include/cppunit/config/config-msvc6.h +++ b/include/cppunit/config/config-msvc6.h @@ -59,9 +59,7 @@ // Uncomment to turn on STL wrapping => use this to test compilation. // This will make CppUnit subclass std::vector & co to provide default // parameter. -/*#define CPPUNIT_STD_NEED_ALLOCATOR 1 -#define CPPUNIT_STD_ALLOCATOR std::allocator<T> -//#define CPPUNIT_NO_NAMESPACE 1 +/*#define CPPUNIT_NO_NAMESPACE 1 */ #if _MSC_VER >= 1300 // VS 7.0 diff --git a/include/cppunit/extensions/TestFactoryRegistry.h b/include/cppunit/extensions/TestFactoryRegistry.h index fc8723e..9d10c94 100644 --- a/include/cppunit/extensions/TestFactoryRegistry.h +++ b/include/cppunit/extensions/TestFactoryRegistry.h @@ -8,7 +8,7 @@ #pragma warning( disable: 4251) // X needs to have dll-interface to be used by clients of class Z #endif -#include <cppunit/portability/CppUnitSet.h> +#include <set> #include <cppunit/extensions/TestFactory.h> #include <string> @@ -17,11 +17,6 @@ CPPUNIT_NS_BEGIN class TestSuite; -#if CPPUNIT_NEED_DLL_DECL -// template class CPPUNIT_API std::set<TestFactory *>; -#endif - - /*! \brief Registry for TestFactory. * \ingroup CreatingTestSuite * @@ -165,7 +160,7 @@ private: void operator =( const TestFactoryRegistry © ); private: - typedef CppUnitSet<TestFactory *, std::less<TestFactory*> > Factories; + typedef std::set<TestFactory *, std::less<TestFactory*> > Factories; Factories m_factories; std::string m_name; diff --git a/include/cppunit/extensions/TestSuiteBuilderContext.h b/include/cppunit/extensions/TestSuiteBuilderContext.h index db26926..b62eeb8 100644 --- a/include/cppunit/extensions/TestSuiteBuilderContext.h +++ b/include/cppunit/extensions/TestSuiteBuilderContext.h @@ -2,7 +2,7 @@ #define CPPUNIT_HELPER_TESTSUITEBUILDERCONTEXT_H #include <cppunit/Portability.h> -#include <cppunit/portability/CppUnitMap.h> +#include <map> #include <string> #if CPPUNIT_NEED_DLL_DECL @@ -81,7 +81,7 @@ protected: // shared std::map in dll bug in VC6. // See http://www.dinkumware.com/vc_fixes.html for detail. typedef std::pair<std::string,std::string> Property; - typedef CppUnitVector<Property> Properties; + typedef std::vector<Property> Properties; TestSuite &m_suite; const TestNamer &m_namer; diff --git a/include/cppunit/plugin/PlugInManager.h b/include/cppunit/plugin/PlugInManager.h index 6ecedc8..c9d72d8 100644 --- a/include/cppunit/plugin/PlugInManager.h +++ b/include/cppunit/plugin/PlugInManager.h @@ -96,7 +96,7 @@ private: void operator =( const PlugInManager © ); private: - typedef CppUnitDeque<PlugInInfo> PlugIns; + typedef std::deque<PlugInInfo> PlugIns; PlugIns m_plugIns; }; diff --git a/include/cppunit/plugin/PlugInParameters.h b/include/cppunit/plugin/PlugInParameters.h index c67d0f1..ca08943 100644 --- a/include/cppunit/plugin/PlugInParameters.h +++ b/include/cppunit/plugin/PlugInParameters.h @@ -5,7 +5,7 @@ #if !defined(CPPUNIT_NO_TESTPLUGIN) -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> #include <string> CPPUNIT_NS_BEGIN diff --git a/include/cppunit/portability/CppUnitDeque.h b/include/cppunit/portability/CppUnitDeque.h deleted file mode 100644 index bbab21f..0000000 --- a/include/cppunit/portability/CppUnitDeque.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef CPPUNIT_PORTABILITY_CPPUNITDEQUE_H -#define CPPUNIT_PORTABILITY_CPPUNITDEQUE_H - -// The technic used is similar to the wrapper of STLPort. - -#include <cppunit/Portability.h> -#include <deque> - - -#if CPPUNIT_STD_NEED_ALLOCATOR - -template<class T> -class CppUnitDeque : public std::deque<T,CPPUNIT_STD_ALLOCATOR> -{ -public: -}; - -#else // CPPUNIT_STD_NEED_ALLOCATOR - -#define CppUnitDeque std::deque - -#endif - -#endif // CPPUNIT_PORTABILITY_CPPUNITDEQUE_H - diff --git a/include/cppunit/portability/CppUnitMap.h b/include/cppunit/portability/CppUnitMap.h deleted file mode 100644 index 0cdc723..0000000 --- a/include/cppunit/portability/CppUnitMap.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef CPPUNIT_PORTABILITY_CPPUNITMAP_H -#define CPPUNIT_PORTABILITY_CPPUNITMAP_H - -// The technic used is similar to the wrapper of STLPort. - -#include <cppunit/Portability.h> -#include <functional> -#include <map> - - -#if CPPUNIT_STD_NEED_ALLOCATOR - -template<class Key, class T> -class CppUnitMap : public std::map<Key - ,T - ,std::less<Key> - ,CPPUNIT_STD_ALLOCATOR> -{ -public: -}; - -#else // CPPUNIT_STD_NEED_ALLOCATOR - -#define CppUnitMap std::map - -#endif - -#endif // CPPUNIT_PORTABILITY_CPPUNITMAP_H - diff --git a/include/cppunit/portability/CppUnitSet.h b/include/cppunit/portability/CppUnitSet.h deleted file mode 100644 index 18b8662..0000000 --- a/include/cppunit/portability/CppUnitSet.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef CPPUNIT_PORTABILITY_CPPUNITSET_H -#define CPPUNIT_PORTABILITY_CPPUNITSET_H - -// The technic used is similar to the wrapper of STLPort. - -#include <cppunit/Portability.h> -#include <functional> -#include <set> - - -#if CPPUNIT_STD_NEED_ALLOCATOR - -template<class T> -class CppUnitSet : public std::set<T - ,std::less<T> - ,CPPUNIT_STD_ALLOCATOR> -{ -public: -}; - -#else // CPPUNIT_STD_NEED_ALLOCATOR - -#define CppUnitSet std::set - -#endif - -#endif // CPPUNIT_PORTABILITY_CPPUNITSET_H - diff --git a/include/cppunit/portability/CppUnitStack.h b/include/cppunit/portability/CppUnitStack.h deleted file mode 100644 index bc7785b..0000000 --- a/include/cppunit/portability/CppUnitStack.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef CPPUNIT_PORTABILITY_CPPUNITSTACK_H -#define CPPUNIT_PORTABILITY_CPPUNITSTACK_H - -// The technic used is similar to the wrapper of STLPort. - -#include <cppunit/Portability.h> -#include <deque> -#include <stack> - - -#if CPPUNIT_STD_NEED_ALLOCATOR - -template<class T> -class CppUnitStack : public std::stack<T - ,std::deque<T,CPPUNIT_STD_ALLOCATOR> > -{ -public: -}; - -#else // CPPUNIT_STD_NEED_ALLOCATOR - -#define CppUnitStack std::stack - -#endif - -#endif // CPPUNIT_PORTABILITY_CPPUNITSTACK_H \ No newline at end of file diff --git a/include/cppunit/portability/CppUnitVector.h b/include/cppunit/portability/CppUnitVector.h deleted file mode 100644 index 6666a63..0000000 --- a/include/cppunit/portability/CppUnitVector.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef CPPUNIT_PORTABILITY_CPPUNITVECTOR_H -#define CPPUNIT_PORTABILITY_CPPUNITVECTOR_H - -// The technic used is similar to the wrapper of STLPort. - -#include <cppunit/Portability.h> -#include <vector> - - -#if CPPUNIT_STD_NEED_ALLOCATOR - -template<class T> -class CppUnitVector : public std::vector<T,CPPUNIT_STD_ALLOCATOR> -{ -public: -}; - -#else // CPPUNIT_STD_NEED_ALLOCATOR - -#define CppUnitVector std::vector - -#endif - -#endif // CPPUNIT_PORTABILITY_CPPUNITVECTOR_H - diff --git a/include/cppunit/portability/Makefile.am b/include/cppunit/portability/Makefile.am index 8311d00..ce85cd6 100644 --- a/include/cppunit/portability/Makefile.am +++ b/include/cppunit/portability/Makefile.am @@ -1,11 +1,6 @@ libcppunitincludedir = $(includedir)/cppunit/portability libcppunitinclude_HEADERS = \ - CppUnitDeque.h \ - CppUnitMap.h \ - CppUnitSet.h \ - CppUnitStack.h \ - CppUnitVector.h \ FloatingPoint.h \ Stream.h \ SmartPtr.h diff --git a/include/cppunit/tools/StringTools.h b/include/cppunit/tools/StringTools.h index 7a6b6d7..d08c6e0 100644 --- a/include/cppunit/tools/StringTools.h +++ b/include/cppunit/tools/StringTools.h @@ -3,7 +3,7 @@ #include <cppunit/Portability.h> #include <string> -#include <cppunit/portability/CppUnitVector.h> +#include <vector> CPPUNIT_NS_BEGIN @@ -14,7 +14,7 @@ CPPUNIT_NS_BEGIN struct StringTools { - typedef CppUnitVector<std::string> Strings; + typedef std::vector<std::string> Strings; static std::string CPPUNIT_API toString( int value ); diff --git a/include/cppunit/tools/XmlElement.h b/include/cppunit/tools/XmlElement.h index 0b36bd2..70e21f8 100644 --- a/include/cppunit/tools/XmlElement.h +++ b/include/cppunit/tools/XmlElement.h @@ -8,7 +8,7 @@ #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z #endif -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> #include <string> @@ -131,10 +131,10 @@ private: std::string m_name; std::string m_content; - typedef CppUnitDeque<Attribute> Attributes; + typedef std::deque<Attribute> Attributes; Attributes m_attributes; - typedef CppUnitDeque<XmlElement *> Elements; + typedef std::deque<XmlElement *> Elements; Elements m_elements; }; diff --git a/include/cppunit/ui/mfc/MfcTestRunner.h b/include/cppunit/ui/mfc/MfcTestRunner.h index 6a5f7b7..b2a7ed7 100644 --- a/include/cppunit/ui/mfc/MfcTestRunner.h +++ b/include/cppunit/ui/mfc/MfcTestRunner.h @@ -6,7 +6,7 @@ #endif // _MSC_VER >= 1000 #include <cppunit/Portability.h> -#include <cppunit/portability/CppUnitVector.h> +#include <vector> /* Refer to MSDN documentation to know how to write and use MFC extension DLL: mk:@MSITStore:h:\DevStudio\MSDN\98VSa\1036\vcmfc.chm::/html/_mfcnotes_tn033.htm#_mfcnotes_how_to_write_an_mfc_extension_dll @@ -59,18 +59,18 @@ public: void addTest( Test *test ); - void addTests( const CppUnitVector<Test *> &tests ); + void addTests( const std::vector<Test *> &tests ); protected: Test *getRootTest(); TestSuite *m_suite; - typedef CppUnitVector<Test *> Tests; + typedef std::vector<Test *> Tests; Tests m_tests; }; CPPUNIT_NS_END -#endif // CPPUNITUI_MFC_MFCTESTRUNNER_H \ No newline at end of file +#endif // CPPUNITUI_MFC_MFCTESTRUNNER_H diff --git a/include/cppunit/ui/qt/QtTestRunner.h b/include/cppunit/ui/qt/QtTestRunner.h index 4b6ab4e..3ae602f 100644 --- a/include/cppunit/ui/qt/QtTestRunner.h +++ b/include/cppunit/ui/qt/QtTestRunner.h @@ -6,7 +6,7 @@ #ifndef CPPUNIT_QTUI_QTTESTRUNNER_H #define CPPUNIT_QTUI_QTTESTRUNNER_H -#include <cppunit/portability/CppUnitVector.h> +#include <vector> #include "Config.h" CPPUNIT_NS_BEGIN @@ -62,7 +62,7 @@ private: Test *getRootTest(); private: - typedef CppUnitVector<Test *> Tests; + typedef std::vector<Test *> Tests; Tests *_tests; TestSuite *_suite; diff --git a/src/DllPlugInTester/CommandLineParser.h b/src/DllPlugInTester/CommandLineParser.h index 3cbcb5a..1863eb9 100644 --- a/src/DllPlugInTester/CommandLineParser.h +++ b/src/DllPlugInTester/CommandLineParser.h @@ -2,7 +2,7 @@ #define CPPUNIT_HELPER_COMMANDLINEPARSER_H #include <cppunit/Portability.h> -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> #include <cppunit/plugin/PlugInParameters.h> #include <string> #include <stdexcept> @@ -113,10 +113,10 @@ protected: bool m_waitBeforeExit; std::string m_testPath; - typedef CppUnitDeque<CommandLinePlugInInfo> PlugIns; + typedef std::deque<CommandLinePlugInInfo> PlugIns; PlugIns m_plugIns; - typedef CppUnitDeque<std::string> Arguments; + typedef std::deque<std::string> Arguments; Arguments m_arguments; unsigned int m_currentArgument; diff --git a/src/cppunit/ProtectorChain.h b/src/cppunit/ProtectorChain.h index 1941131..9123782 100644 --- a/src/cppunit/ProtectorChain.h +++ b/src/cppunit/ProtectorChain.h @@ -2,7 +2,7 @@ #define CPPUNIT_PROTECTORCHAIN_H #include <cppunit/Protector.h> -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> #if CPPUNIT_NEED_DLL_DECL #pragma warning( push ) @@ -36,10 +36,10 @@ private: class ProtectFunctor; private: - typedef CppUnitDeque<Protector *> Protectors; + typedef std::deque<Protector *> Protectors; Protectors m_protectors; - typedef CppUnitDeque<Functor *> Functors; + typedef std::deque<Functor *> Functors; }; diff --git a/src/cppunit/TestFactoryRegistry.cpp b/src/cppunit/TestFactoryRegistry.cpp index 4f76f66..f1623cc 100644 --- a/src/cppunit/TestFactoryRegistry.cpp +++ b/src/cppunit/TestFactoryRegistry.cpp @@ -1,6 +1,6 @@ #include <cppunit/config/SourcePrefix.h> #include <cppunit/extensions/TestFactoryRegistry.h> -#include <cppunit/portability/CppUnitMap.h> +#include <map> #include <cppunit/TestSuite.h> #include <assert.h> @@ -12,7 +12,7 @@ CPPUNIT_NS_BEGIN class TestFactoryRegistryList { private: - typedef CppUnitMap<std::string, TestFactoryRegistry *, std::less<std::string> > Registries; + typedef std::map<std::string, TestFactoryRegistry *, std::less<std::string> > Registries; Registries m_registries; enum State { diff --git a/src/cppunit/TestSuite.cpp b/src/cppunit/TestSuite.cpp index 14cfcd2..b5d6db3 100644 --- a/src/cppunit/TestSuite.cpp +++ b/src/cppunit/TestSuite.cpp @@ -40,7 +40,7 @@ TestSuite::addTest( Test *test ) } -const CppUnitVector<Test *> & +const std::vector<Test *> & TestSuite::getTests() const { return m_tests; diff --git a/src/cppunit/cppunit.dsp b/src/cppunit/cppunit.dsp index 55f4769..4691351 100644 --- a/src/cppunit/cppunit.dsp +++ b/src/cppunit/cppunit.dsp @@ -227,26 +227,6 @@ SOURCE=..\..\include\cppunit\config\CppUnitApi.h # End Source File # Begin Source File -SOURCE=..\..\include\cppunit\portability\CppUnitDeque.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\cppunit\portability\CppUnitMap.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\cppunit\portability\CppUnitSet.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\cppunit\portability\CppUnitStack.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\cppunit\portability\CppUnitVector.h -# End Source File -# Begin Source File - SOURCE=..\..\include\cppunit\portability\FloatingPoint.h # End Source File # Begin Source File diff --git a/src/cppunit/cppunit.vcproj b/src/cppunit/cppunit.vcproj index 2c6c82b..fba7d6f 100644 --- a/src/cppunit/cppunit.vcproj +++ b/src/cppunit/cppunit.vcproj @@ -415,26 +415,6 @@ > </File> <File - RelativePath="..\..\include\cppunit\portability\CppUnitDeque.h" - > - </File> - <File - RelativePath="..\..\include\cppunit\portability\CppUnitMap.h" - > - </File> - <File - RelativePath="..\..\include\cppunit\portability\CppUnitSet.h" - > - </File> - <File - RelativePath="..\..\include\cppunit\portability\CppUnitStack.h" - > - </File> - <File - RelativePath="..\..\include\cppunit\portability\CppUnitVector.h" - > - </File> - <File RelativePath="..\..\include\cppunit\portability\FloatingPoint.h" > </File> diff --git a/src/cppunit/cppunit.vcxproj b/src/cppunit/cppunit.vcxproj index 0367d20..7b7b270 100644 --- a/src/cppunit/cppunit.vcxproj +++ b/src/cppunit/cppunit.vcxproj @@ -328,11 +328,6 @@ <ClInclude Include="..\..\include\cppunit\config\config-mac.h" /> <ClInclude Include="..\..\include\cppunit\config\config-msvc6.h" /> <ClInclude Include="..\..\include\cppunit\config\CppUnitApi.h" /> - <ClInclude Include="..\..\include\cppunit\portability\CppUnitDeque.h" /> - <ClInclude Include="..\..\include\cppunit\portability\CppUnitMap.h" /> - <ClInclude Include="..\..\include\cppunit\portability\CppUnitSet.h" /> - <ClInclude Include="..\..\include\cppunit\portability\CppUnitStack.h" /> - <ClInclude Include="..\..\include\cppunit\portability\CppUnitVector.h" /> <ClInclude Include="..\..\include\cppunit\portability\FloatingPoint.h" /> <ClInclude Include="..\..\include\cppunit\Portability.h" /> <ClInclude Include="..\..\include\cppunit\config\SelectDllLoader.h" /> @@ -396,4 +391,4 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> -</Project> \ No newline at end of file +</Project> diff --git a/src/cppunit/cppunit_dll.dsp b/src/cppunit/cppunit_dll.dsp index a7a73c7..9b3a0dd 100644 --- a/src/cppunit/cppunit_dll.dsp +++ b/src/cppunit/cppunit_dll.dsp @@ -431,26 +431,6 @@ SOURCE=..\..\include\cppunit\config\CppUnitApi.h # End Source File # Begin Source File -SOURCE=..\..\include\cppunit\portability\CppUnitDeque.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\cppunit\portability\CppUnitMap.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\cppunit\portability\CppUnitSet.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\cppunit\portability\CppUnitStack.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\cppunit\portability\CppUnitVector.h -# End Source File -# Begin Source File - SOURCE=..\..\include\cppunit\Portability.h # End Source File # Begin Source File diff --git a/src/cppunit/cppunit_dll.vcproj b/src/cppunit/cppunit_dll.vcproj index 57c0390..bdfdbca 100644 --- a/src/cppunit/cppunit_dll.vcproj +++ b/src/cppunit/cppunit_dll.vcproj @@ -1076,26 +1076,6 @@ > </File> <File - RelativePath="..\..\include\cppunit\portability\CppUnitDeque.h" - > - </File> - <File - RelativePath="..\..\include\cppunit\portability\CppUnitMap.h" - > - </File> - <File - RelativePath="..\..\include\cppunit\portability\CppUnitSet.h" - > - </File> - <File - RelativePath="..\..\include\cppunit\portability\CppUnitStack.h" - > - </File> - <File - RelativePath="..\..\include\cppunit\portability\CppUnitVector.h" - > - </File> - <File RelativePath="..\..\include\cppunit\Portability.h" > </File> diff --git a/src/cppunit/cppunit_dll.vcxproj b/src/cppunit/cppunit_dll.vcxproj index 292e62f..71ef783 100644 --- a/src/cppunit/cppunit_dll.vcxproj +++ b/src/cppunit/cppunit_dll.vcxproj @@ -370,11 +370,6 @@ copy "$(TargetDir)$(TargetName).lib" ..\..\lib\$(TargetName).lib</Command> <ClInclude Include="..\..\include\cppunit\config\config-mac.h" /> <ClInclude Include="..\..\include\cppunit\config\config-msvc6.h" /> <ClInclude Include="..\..\include\cppunit\config\CppUnitApi.h" /> - <ClInclude Include="..\..\include\cppunit\portability\CppUnitDeque.h" /> - <ClInclude Include="..\..\include\cppunit\portability\CppUnitMap.h" /> - <ClInclude Include="..\..\include\cppunit\portability\CppUnitSet.h" /> - <ClInclude Include="..\..\include\cppunit\portability\CppUnitStack.h" /> - <ClInclude Include="..\..\include\cppunit\portability\CppUnitVector.h" /> <ClInclude Include="..\..\include\cppunit\Portability.h" /> <ClInclude Include="..\..\include\cppunit\config\SelectDllLoader.h" /> <ClInclude Include="..\..\include\cppunit\config\SourcePrefix.h" /> @@ -429,4 +424,4 @@ copy "$(TargetDir)$(TargetName).lib" ..\..\lib\$(TargetName).lib</Command> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> -</Project> \ No newline at end of file +</Project> diff --git a/src/msvc6/testrunner/MfcTestRunner.cpp b/src/msvc6/testrunner/MfcTestRunner.cpp index 0d383a1..55344ac 100644 --- a/src/msvc6/testrunner/MfcTestRunner.cpp +++ b/src/msvc6/testrunner/MfcTestRunner.cpp @@ -52,7 +52,7 @@ MfcTestRunner::addTest( CPPUNIT_NS::Test *test ) void -MfcTestRunner::addTests( const CppUnitVector<CPPUNIT_NS::Test *> &tests ) +MfcTestRunner::addTests( const std::vector<CPPUNIT_NS::Test *> &tests ) { for ( Tests::const_iterator it=tests.begin(); it != tests.end(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits