diff options
| author | Tobias Markmann <tobias.markmann@isode.com> | 2019-11-14 21:08:53 (GMT) |
|---|---|---|
| committer | Tobias Markmann <tobias.markmann@isode.com> | 2019-11-15 11:58:11 (GMT) |
| commit | 8230b23238b4d0ef0fcde01a799758558d502fa1 (patch) | |
| tree | 849251b42e457357b86a2ba91e9b78f635cc55a3 /3rdParty/CppUnit/src | |
| parent | caca46ceedddd43c707e7eda9b4c765d61730ccb (diff) | |
| download | swift-8230b23238b4d0ef0fcde01a799758558d502fa1.zip swift-8230b23238b4d0ef0fcde01a799758558d502fa1.tar.bz2 | |
Update 3rdParty/CppUnit to version 1.14.0
This gets rid of std::auto_ptr usage and its deprecation
warnings.
Test-Information:
Builds and tests pass on macOS.
Change-Id: I299a0a8d9aa2ead15c933e83a2e3e53f84a4f5b7
Diffstat (limited to '3rdParty/CppUnit/src')
55 files changed, 705 insertions, 482 deletions
diff --git a/3rdParty/CppUnit/src/COPYING b/3rdParty/CppUnit/src/COPYING index b1e3f5a..0a41847 100644 --- a/3rdParty/CppUnit/src/COPYING +++ b/3rdParty/CppUnit/src/COPYING @@ -1,11 +1,11 @@ GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] diff --git a/3rdParty/CppUnit/src/include/cppunit/Asserter.h b/3rdParty/CppUnit/src/include/cppunit/Asserter.h index 94dadaa..3321b87 100644 --- a/3rdParty/CppUnit/src/include/cppunit/Asserter.h +++ b/3rdParty/CppUnit/src/include/cppunit/Asserter.h @@ -39,23 +39,30 @@ class Message; * /// Asserts that two XML strings are equivalent. * #define CPPUNITTEST_ASSERT_XML_EQUAL( expected, actual ) \ * checkXmlEqual( expected, actual, \ * CPPUNIT_SOURCELINE() ) * \endcode */ + +#if defined __GNUC__ +# define NORETURN __attribute__((noreturn)) +#else +# define NORETURN +#endif + struct Asserter { /*! \brief Throws a Exception with the specified message and location. */ - static void CPPUNIT_API fail( const Message &message, + NORETURN static void CPPUNIT_API fail( const Message &message, const SourceLine &sourceLine = SourceLine() ); /*! \brief Throws a Exception with the specified message and location. * \deprecated Use fail( Message, SourceLine ) instead. */ - static void CPPUNIT_API fail( std::string message, + NORETURN static void CPPUNIT_API fail( std::string message, const SourceLine &sourceLine = SourceLine() ); /*! \brief Throws a Exception with the specified message and location. * \param shouldFail if \c true then the exception is thrown. Otherwise * nothing happen. * \param message Message explaining the assertion failiure. @@ -73,54 +80,156 @@ struct Asserter * \param sourceLine Location of the assertion. */ static void CPPUNIT_API failIf( bool shouldFail, std::string message, const SourceLine &sourceLine = SourceLine() ); - /*! \brief Returns a expected value string for a message. + /*! \brief Returns a expected value string for a message, case equal than * Typically used to create 'not equal' message, or to check that a message * contains the expected content when writing unit tests for your custom * assertions. * * \param expectedValue String that represents the expected value. * \return \a expectedValue prefixed with "Expected: ". + * \deprecated Use makeExpectedEqual instead * \see makeActual(). */ static std::string CPPUNIT_API makeExpected( const std::string &expectedValue ); + /*! \brief Returns a expected value string for a message, case equal than + * Typically used to create 'not equal' message, or to check that a message + * contains the expected content when writing unit tests for your custom + * assertions. + * + * \param expectedValue String that represents the expected value. + * \return \a expectedValue prefixed with "Expected: ". + * \see makeActual(). + */ + static std::string CPPUNIT_API makeExpectedEqual( const std::string &expectedValue ); + /*! \brief Returns a expected value string for a message, case less than. + * + * \param expectedValue String that represents the expected value. + * \return \a expectedValue prefixed with "Expected less than: ". + * \see makeExpectedEqual(). + */ + static std::string CPPUNIT_API makeExpectedLess( const std::string &expectedValue ); + /*! \brief Returns a expected value string for a message, case less or equal than. + * + * \param expectedValue String that represents the expected value. + * \return \a expectedValue prefixed with "Expected: ". + * \see makeExpectedEqual(). + */ + static std::string CPPUNIT_API makeExpectedLessEqual( const std::string &expectedValue ); + /*! \brief Returns a expected value string for a message, case greater than. + * + * \param expectedValue String that represents the expected value. + * \return \a expectedValue prefixed with "Expected: ". + * \see makeExpectedEqual(). + */ + static std::string CPPUNIT_API makeExpectedGreater( const std::string &expectedValue ); + /*! \brief Returns a expected value string for a message, greater or equal than. + * + * \param expectedValue String that represents the expected value. + * \return \a expectedValue prefixed with "Expected: ". + * \see makeExpectedEqual(). + */ + static std::string CPPUNIT_API makeExpectedGreaterEqual( const std::string &expectedValue ); /*! \brief Returns an actual value string for a message. * Typically used to create 'not equal' message, or to check that a message * contains the expected content when writing unit tests for your custom * assertions. * * \param actualValue String that represents the actual value. * \return \a actualValue prefixed with "Actual : ". * \see makeExpected(). */ static std::string CPPUNIT_API makeActual( const std::string &actualValue ); + /*! + * \deprecated Use makeMessage instead + */ static Message CPPUNIT_API makeNotEqualMessage( const std::string &expectedValue, const std::string &actualValue, const AdditionalMessage &additionalMessage = AdditionalMessage(), const std::string &shortDescription = "equality assertion failed"); + static Message CPPUNIT_API makeMessage( const std::string &expectedValue, + const std::string &actualValue, + const std::string &shortDescription, + const AdditionalMessage &additionalMessage = AdditionalMessage()); + /*! \brief Throws an Exception with the specified message and location. * \param expected Text describing the expected value. * \param actual Text describing the actual value. * \param sourceLine Location of the assertion. * \param additionalMessage Additional message. Usually used to report * what are the differences between the expected and actual value. * \param shortDescription Short description for the failure message. */ - static void CPPUNIT_API failNotEqual( std::string expected, + NORETURN static void CPPUNIT_API failNotEqual( std::string expected, std::string actual, const SourceLine &sourceLine, const AdditionalMessage &additionalMessage = AdditionalMessage(), std::string shortDescription = "equality assertion failed" ); /*! \brief Throws an Exception with the specified message and location. + * \param expected Text describing the expected value. + * \param actual Text describing the actual value. + * \param sourceLine Location of the assertion. + * \param additionalMessage Additional message. Usually used to report + * what are the differences between the expected and actual value. + * \param shortDescription Short description for the failure message. + */ + static void CPPUNIT_API failNotLess( std::string expected, + std::string actual, + const SourceLine &sourceLine, + const AdditionalMessage &additionalMessage = AdditionalMessage(), + std::string shortDescription = "less assertion failed" ); + + /*! \brief Throws an Exception with the specified message and location. + * \param expected Text describing the expected value. + * \param actual Text describing the actual value. + * \param sourceLine Location of the assertion. + * \param additionalMessage Additional message. Usually used to report + * what are the differences between the expected and actual value. + * \param shortDescription Short description for the failure message. + */ + static void CPPUNIT_API failNotGreater( std::string expected, + std::string actual, + const SourceLine &sourceLine, + const AdditionalMessage &additionalMessage = AdditionalMessage(), + std::string shortDescription = "greater assertion failed" ); + + /*! \brief Throws an Exception with the specified message and location. + * \param expected Text describing the expected value. + * \param actual Text describing the actual value. + * \param sourceLine Location of the assertion. + * \param additionalMessage Additional message. Usually used to report + * what are the differences between the expected and actual value. + * \param shortDescription Short description for the failure message. + */ + static void CPPUNIT_API failNotLessEqual( std::string expected, + std::string actual, + const SourceLine &sourceLine, + const AdditionalMessage &additionalMessage = AdditionalMessage(), + std::string shortDescription = "less equal assertion failed" ); + + /*! \brief Throws an Exception with the specified message and location. + * \param expected Text describing the expected value. + * \param actual Text describing the actual value. + * \param sourceLine Location of the assertion. + * \param additionalMessage Additional message. Usually used to report + * what are the differences between the expected and actual value. + * \param shortDescription Short description for the failure message. + */ + static void CPPUNIT_API failNotGreaterEqual( std::string expected, + std::string actual, + const SourceLine &sourceLine, + const AdditionalMessage &additionalMessage = AdditionalMessage(), + std::string shortDescription = "greater equal assertion failed" ); /*! \brief Throws an Exception with the specified message and location. + * \param shouldFail if \c true then the exception is thrown. Otherwise * nothing happen. * \param expected Text describing the expected value. * \param actual Text describing the actual value. * \param sourceLine Location of the assertion. * \param additionalMessage Additional message. Usually used to report diff --git a/3rdParty/CppUnit/src/include/cppunit/Message.h b/3rdParty/CppUnit/src/include/cppunit/Message.h index 1ae51cc..c3d8d92 100644 --- a/3rdParty/CppUnit/src/include/cppunit/Message.h +++ b/3rdParty/CppUnit/src/include/cppunit/Message.h @@ -5,23 +5,19 @@ #if CPPUNIT_NEED_DLL_DECL #pragma warning( push ) #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: * - a short description (~20/30 characters) * - a list of detail strings * @@ -35,13 +31,13 @@ CPPUNIT_NS_BEGIN * equality assertion, some addional messages... Detail strings can contains * new line characters (\n). */ class CPPUNIT_API Message { public: - Message(); + Message() {}; // Ensure thread-safe copy by detaching the string. Message( const Message &other ); explicit Message( const std::string &shortDescription ); @@ -54,12 +50,14 @@ public: Message( const std::string &shortDescription, const std::string &detail1, const std::string &detail2, const std::string &detail3 ); + virtual ~Message(); + Message &operator =( const Message &other ); /*! \brief Returns the short description. * \return Short description. */ const std::string &shortDescription() const; @@ -138,13 +136,13 @@ public: */ bool operator !=( const Message &other ) const; private: std::string m_shortDescription; - typedef CppUnitDeque<std::string> Details; + typedef std::deque<std::string> Details; Details m_details; }; CPPUNIT_NS_END diff --git a/3rdParty/CppUnit/src/include/cppunit/Portability.h b/3rdParty/CppUnit/src/include/cppunit/Portability.h index ddf0316..d7c4c11 100644 --- a/3rdParty/CppUnit/src/include/cppunit/Portability.h +++ b/3rdParty/CppUnit/src/include/cppunit/Portability.h @@ -17,13 +17,13 @@ #else # include <cppunit/config-auto.h> #endif // Version number of package #ifndef CPPUNIT_VERSION -#define CPPUNIT_VERSION "1.12.0" +#define CPPUNIT_VERSION "1.14.0" #endif #include <cppunit/config/CppUnitApi.h> // define CPPUNIT_API & CPPUNIT_NEED_DLL_DECL #include <cppunit/config/SelectDllLoader.h> @@ -58,26 +58,12 @@ # endif // !defined(CPPUNIT_NO_NAMESPACE) # if !defined(CPPUNIT_NO_STD_NAMESPACE) # define CPPUNIT_NO_STD_NAMESPACE 1 # 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. #if !defined(CPPUNIT_COMPILER_LOCATION_FORMAT) #if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) ) // gcc/Xcode integration on Mac OS X @@ -159,17 +145,23 @@ /// \internal #define _CPPUNIT_DO_JOIN( symbol1, symbol2 ) _CPPUNIT_DO_JOIN2( symbol1, symbol2 ) /// \internal #define _CPPUNIT_DO_JOIN2( symbol1, symbol2 ) symbol1##symbol2 +/// \internal Unique suffix for variable name. Can be overridden in platform specific +/// config-*.h. Default to line number. +#ifndef CPPUNIT_UNIQUE_COUNTER +# define CPPUNIT_UNIQUE_COUNTER __LINE__ +#endif + /*! Adds the line number to the specified string to create a unique identifier. * \param prefix Prefix added to the line number to create a unique identifier. * \see CPPUNIT_TEST_SUITE_REGISTRATION for an example of usage. */ -#define CPPUNIT_MAKE_UNIQUE_NAME( prefix ) CPPUNIT_JOIN( prefix, __LINE__ ) +#define CPPUNIT_MAKE_UNIQUE_NAME( prefix ) CPPUNIT_JOIN( prefix, CPPUNIT_UNIQUE_COUNTER ) /*! Defines wrap colunm for %CppUnit. Used by CompilerOuputter. */ #if !defined(CPPUNIT_WRAP_COLUMN) # define CPPUNIT_WRAP_COLUMN 79 #endif diff --git a/3rdParty/CppUnit/src/include/cppunit/Protector.h b/3rdParty/CppUnit/src/include/cppunit/Protector.h index d14e75f..c6d2e7c 100644 --- a/3rdParty/CppUnit/src/include/cppunit/Protector.h +++ b/3rdParty/CppUnit/src/include/cppunit/Protector.h @@ -81,12 +81,14 @@ public: Protector *protector ); /// Pops the protector. ~ProtectorGuard(); private: + ProtectorGuard( const ProtectorGuard& ); /* not copyable */ + ProtectorGuard& operator=( const ProtectorGuard& ); /* not assignable */ TestResult *m_result; }; CPPUNIT_NS_END diff --git a/3rdParty/CppUnit/src/include/cppunit/SynchronizedObject.h b/3rdParty/CppUnit/src/include/cppunit/SynchronizedObject.h index 0f7d094..59c3cbb 100644 --- a/3rdParty/CppUnit/src/include/cppunit/SynchronizedObject.h +++ b/3rdParty/CppUnit/src/include/cppunit/SynchronizedObject.h @@ -47,21 +47,27 @@ protected: class ExclusiveZone { SynchronizationObject *m_syncObject; public: ExclusiveZone( SynchronizationObject *syncObject ) - : m_syncObject( syncObject ) + : m_syncObject( syncObject ) { - m_syncObject->lock(); + m_syncObject->lock(); } ~ExclusiveZone() { - m_syncObject->unlock (); + m_syncObject->unlock (); } + private: + /// Prevents the use of the copy constructor. + ExclusiveZone( const ExclusiveZone& ); + + /// Prevents the use of the copy operator. + ExclusiveZone& operator=( const ExclusiveZone& ); }; virtual void setSynchronizationObject( SynchronizationObject *syncObject ); protected: SynchronizationObject *m_syncObject; diff --git a/3rdParty/CppUnit/src/include/cppunit/TestAssert.h b/3rdParty/CppUnit/src/include/cppunit/TestAssert.h index f74797b..bb29ac0 100644 --- a/3rdParty/CppUnit/src/include/cppunit/TestAssert.h +++ b/3rdParty/CppUnit/src/include/cppunit/TestAssert.h @@ -2,32 +2,48 @@ #define CPPUNIT_TESTASSERT_H #include <cppunit/Portability.h> #include <cppunit/Exception.h> #include <cppunit/Asserter.h> #include <cppunit/portability/Stream.h> +#include <cppunit/tools/StringHelper.h> #include <stdio.h> #include <float.h> // For struct assertion_traits<double> +// Work around "passing 'T' chooses 'int' over 'unsigned int'" warnings when T +// is an enum type: +#if defined __GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)) +#pragma GCC system_header +#endif -CPPUNIT_NS_BEGIN +CPPUNIT_NS_BEGIN -/*! \brief Traits used by CPPUNIT_ASSERT_EQUAL(). +/*! \brief Traits used by CPPUNIT_ASSERT* macros. * * Here is an example of specialising these traits: * * \code * template<> * struct assertion_traits<std::string> // specialization for the std::string type * { * static bool equal( const std::string& x, const std::string& y ) * { * return x == y; * } - * + * + * static bool less( const std::string& x, const std::string& y ) + * { + * return x < y; + * } + * + * static bool lessEqual( const std::string& x, const std::string& y ) + * { + * return x <= y; + * } + * * static std::string toString( const std::string& x ) * { * std::string text = '"' + x + '"'; // adds quote around the string to see whitespace * OStringStream ost; * ost << text; * return ost.str(); @@ -40,21 +56,28 @@ struct assertion_traits { static bool equal( const T& x, const T& y ) { return x == y; } + static bool less( const T& x, const T& y ) + { + return x < y; + } + + static bool lessEqual( const T& x, const T& y ) + { + return x <= y; + } + static std::string toString( const T& x ) { - OStringStream ost; - ost << x; - return ost.str(); + return CPPUNIT_NS::StringHelper::toString(x); } }; - /*! \brief Traits used by CPPUNIT_ASSERT_DOUBLES_EQUAL(). * * This specialisation from @c struct @c assertion_traits<> ensures that * doubles are converted in full, instead of being rounded to the default * 6 digits of precision. Use the system defined ISO C99 macro DBL_DIG * within float.h is available to define the maximum precision, otherwise @@ -65,12 +88,22 @@ struct assertion_traits<double> { static bool equal( double x, double y ) { return x == y; } + static bool less( double x, double y ) + { + return x < y; + } + + static bool lessEqual( double x, double y ) + { + return x <= y; + } + static std::string toString( double x ) { #ifdef DBL_DIG const int precision = DBL_DIG; #else const int precision = 15; @@ -115,12 +148,88 @@ void CPPUNIT_API assertDoubleEquals( double expected, double actual, double delta, SourceLine sourceLine, const std::string &message ); +/*! \brief (Implementation) Asserts that an object is less than another one of the same type + * Use CPPUNIT_ASSERT_LESS, CPPUNIT_ASSERT_GREATER instead of this function. + * \sa assertion_traits, Asserter::failNotLess(). + */ +template <class T> +void assertLess( const T& expected, + const T& actual, + SourceLine sourceLine, + const std::string& message ) +{ + if ( !assertion_traits<T>::less(actual,expected) ) + { + Asserter::failNotLess( assertion_traits<T>::toString(expected), + assertion_traits<T>::toString(actual), + sourceLine, + message ); + } +} + + +/*! \brief (Implementation) Asserts that an object is less than another one of the same type + * Use CPPUNIT_ASSERT_LESS, CPPUNIT_ASSERT_GREATER instead of this function. + * \sa assertion_traits, Asserter::failNotLess(). + */ +template <class T> +void assertGreater( const T& expected, + const T& actual, + SourceLine sourceLine, + const std::string& message ) +{ + if ( !assertion_traits<T>::less(expected,actual) ) + { + Asserter::failNotGreater( assertion_traits<T>::toString(expected), + assertion_traits<T>::toString(actual), + sourceLine, + message ); + } +} + +/*! \brief (Implementation) Asserts that two objects of the same type are equals. + * Use CPPUNIT_ASSERT_LESSEQUAL, CPPUNIT_ASSERT_GREATEREQUAL instead of this function. + * \sa assertion_traits, Asserter::failNotLessEqual(). + */ +template <class T> +void assertLessEqual( const T& expected, + const T& actual, + SourceLine sourceLine, + const std::string& message ) +{ + if ( !assertion_traits<T>::lessEqual(actual,expected) ) + { + Asserter::failNotLessEqual( assertion_traits<T>::toString(expected), + assertion_traits<T>::toString(actual), + sourceLine, + message ); + } +} + +/*! \brief (Implementation) Asserts that two objects of the same type are equals. + * Use CPPUNIT_ASSERT_LESSEQUAL, CPPUNIT_ASSERT_GREATEREQUAL instead of this function. + * \sa assertion_traits, Asserter::failNotLessEqual(). + */ +template <class T> +void assertGreaterEqual( const T& expected, + const T& actual, + SourceLine sourceLine, + const std::string& message ) +{ + if ( !assertion_traits<T>::lessEqual(expected,actual) ) + { + Asserter::failNotGreaterEqual( assertion_traits<T>::toString(expected), + assertion_traits<T>::toString(actual), + sourceLine, + message ); + } +} /* A set of macros which allow us to get the line number * and file name at the point of an error. * Just goes to show that preprocessors do have some * redeeming qualities. */ #if CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION @@ -214,12 +323,115 @@ void CPPUNIT_API assertDoubleEquals( double expected, ( CPPUNIT_NS::assertEquals( (expected), \ (actual), \ CPPUNIT_SOURCELINE(), \ (message) ) ) #endif +/** Asserts that actual is less than expected, provides additional message on failure. + * \ingroup Assertions + * + * Less and string representation can be defined with + * an appropriate assertion_traits class. + * + * A diagnostic is printed if actual is less than expected. + * The message is printed in addition to the expected and actual value + * to provide additional information. + * + * Requirement for \a expected and \a actual parameters: + * - They are exactly of the same type + * - They are serializable into a std::strstream using operator <<. + * - They can be compared using operator <. + * + * The last two requirements (serialization and comparison) can be + * removed by specializing the CppUnit::assertion_traits. + * + * \sa CPPUNIT_ASSERT_GREATER + */ +#define CPPUNIT_ASSERT_LESS(expected, actual) \ + ( CPPUNIT_NS::assertLess( (expected), \ + (actual), \ + CPPUNIT_SOURCELINE(), \ + "" ) ) + +/** Asserts that actual is greater than expected, provides additional message on failure. + * \ingroup Assertions + * + * String representation can be defined with + * an appropriate assertion_traits class. For comparison assertLess is used. + * + * A diagnostic is printed if actual is less than expected. + * The message is printed in addition to the expected and actual value + * to provide additional information. + * + * Requirement for \a expected and \a actual parameters: + * - They are exactly of the same type + * - They are serializable into a std::strstream using operator <<. + * - They can be compared using operator<. + * + * The last two requirements (serialization and comparison) can be + * removed by specializing the CppUnit::assertion_traits. + * + * \sa CPPUNIT_ASSERT_LESS + */ +#define CPPUNIT_ASSERT_GREATER(expected, actual) \ + ( CPPUNIT_NS::assertGreater( (expected), \ + (actual), \ + CPPUNIT_SOURCELINE(), \ + "" ) ) + +/** Asserts that actual is less or equal than expected, provides additional message on failure. + * \ingroup Assertions + * + * LessEqual and string representation can be defined with + * an appropriate assertion_traits class. + * + * A diagnostic is printed if actual is greater than expected. + * The message is printed in addition to the expected and actual value + * to provide additional information. + * + * Requirement for \a expected and \a actual parameters: + * - They are exactly of the same type + * - They are serializable into a std::strstream using operator <<. + * - They can be compared using operator <=. + * + * The last two requirements (serialization and comparison) can be + * removed by specializing the CppUnit::assertion_traits. + * + * \sa CPPUNIT_ASSERT_GREATEREQUAL + */ +#define CPPUNIT_ASSERT_LESSEQUAL(expected, actual) \ + ( CPPUNIT_NS::assertLessEqual( (expected), \ + (actual), \ + CPPUNIT_SOURCELINE(), \ + "" ) ) + +/** Asserts that actual is greater than expected, provides additional message on failure. + * \ingroup Assertions + * + * String representation can be defined with + * an appropriate assertion_traits class. For comparison assertLess is used. + * + * A diagnostic is printed if actual is less than expected. + * The message is printed in addition to the expected and actual value + * to provide additional information. + * + * Requirement for \a expected and \a actual parameters: + * - They are exactly of the same type + * - They are serializable into a std::strstream using operator <<. + * - They can be compared using operator<=. + * + * The last two requirements (serialization and comparison) can be + * removed by specializing the CppUnit::assertion_traits. + * + * \sa CPPUNIT_ASSERT_LESSEQUAL + */ +#define CPPUNIT_ASSERT_GREATEREQUAL(expected, actual) \ + ( CPPUNIT_NS::assertGreaterEqual( (expected), \ + (actual), \ + CPPUNIT_SOURCELINE(), \ + "" ) ) /*! \brief Macro for primitive double value comparisons. * \ingroup Assertions * * The assertion pass if both expected and actual are finite and * \c fabs( \c expected - \c actual ) <= \c delta. * If either \c expected or actual are infinite (+/- inf), the @@ -260,13 +472,13 @@ void CPPUNIT_API assertDoubleEquals( double expected, CPPUNIT_ASSERT_THROW_MESSAGE( CPPUNIT_NS::AdditionalMessage(), \ expression, \ ExceptionType ) // implementation detail -#if CPPUNIT_USE_TYPEINFO_NAME +#if defined(CPPUNIT_USE_TYPEINFO_NAME) #define CPPUNIT_EXTRACT_EXCEPTION_TYPE_( exception, no_rtti_message ) \ CPPUNIT_NS::TypeInfoHelper::getClassName( typeid(exception) ) #else #define CPPUNIT_EXTRACT_EXCEPTION_TYPE_( exception, no_rtti_message ) \ std::string( no_rtti_message ) #endif // CPPUNIT_USE_TYPEINFO_NAME diff --git a/3rdParty/CppUnit/src/include/cppunit/TestCaller.h b/3rdParty/CppUnit/src/include/cppunit/TestCaller.h index dc4d82e..fbf3902 100644 --- a/3rdParty/CppUnit/src/include/cppunit/TestCaller.h +++ b/3rdParty/CppUnit/src/include/cppunit/TestCaller.h @@ -1,14 +1,16 @@ #ifndef CPPUNIT_TESTCALLER_H // -*- C++ -*- #define CPPUNIT_TESTCALLER_H #include <cppunit/Exception.h> #include <cppunit/TestCase.h> +#include <functional> -#if CPPUNIT_USE_TYPEINFO_NAME + +#if defined(CPPUNIT_USE_TYPEINFO_NAME) # include <cppunit/extensions/TypeInfoHelper.h> #endif CPPUNIT_NS_BEGIN @@ -30,13 +32,13 @@ private: */ template<class ExceptionType> struct ExpectedExceptionTraits { static void expectedException() { -#if CPPUNIT_USE_TYPEINFO_NAME +#if defined(CPPUNIT_USE_TYPEINFO_NAME) throw Exception( Message( "expected exception not thrown", "Expected exception type: " + TypeInfoHelper::getClassName( typeid( ExceptionType ) ) ) ); #else throw Exception( "expected exception not thrown" ); @@ -113,13 +115,13 @@ public: * \param test the method this TestCaller calls in runTest() */ TestCaller( std::string name, TestMethod test ) : TestCase( name ), m_ownFixture( true ), m_fixture( new Fixture() ), - m_test( test ) + m_test_function( std::bind(test, m_fixture) ) { } /*! * Constructor for TestCaller. * This constructor does not create a new Fixture instance but accepts @@ -130,13 +132,13 @@ public: * \param fixture the Fixture to invoke the test method on. */ TestCaller(std::string name, TestMethod test, Fixture& fixture) : TestCase( name ), m_ownFixture( false ), m_fixture( &fixture ), - m_test( test ) + m_test_function( std::bind(test, &fixture) ) { } /*! * Constructor for TestCaller. * This constructor does not create a new Fixture instance but accepts @@ -147,32 +149,33 @@ public: * \param fixture the Fixture to invoke the test method on. */ TestCaller(std::string name, TestMethod test, Fixture* fixture) : TestCase( name ), m_ownFixture( true ), m_fixture( fixture ), - m_test( test ) + m_test_function( std::bind(test, fixture) ) { } + + TestCaller(std::string name, std::function<void()> test_function, Fixture* fixture): + TestCase(name), + m_ownFixture(true), + m_fixture(fixture), + m_test_function(test_function) + { + } ~TestCaller() { if (m_ownFixture) delete m_fixture; } void runTest() { -// try { - (m_fixture->*m_test)(); -// } -// catch ( ExpectedException & ) { -// return; -// } - -// ExpectedExceptionTraits<ExpectedException>::expectedException(); + m_test_function(); } void setUp() { m_fixture->setUp (); } @@ -191,13 +194,13 @@ private: TestCaller( const TestCaller &other ); TestCaller &operator =( const TestCaller &other ); private: bool m_ownFixture; Fixture *m_fixture; - TestMethod m_test; + std::function<void()> m_test_function; }; CPPUNIT_NS_END diff --git a/3rdParty/CppUnit/src/include/cppunit/TestPath.h b/3rdParty/CppUnit/src/include/cppunit/TestPath.h index c3c851c..8934479 100644 --- a/3rdParty/CppUnit/src/include/cppunit/TestPath.h +++ b/3rdParty/CppUnit/src/include/cppunit/TestPath.h @@ -5,25 +5,20 @@ #if CPPUNIT_NEED_DLL_DECL #pragma warning( push ) #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 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 * * The path can be converted to a string and resolved from a string with toString() * and TestPath( Test *root, const std::string &pathAsString ). * @@ -171,13 +166,13 @@ protected: * \param index Zero based index to check. * \exception std::out_of_range is \a index < 0 or \a index >= getTestCount(). */ 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(). * \param testNames Test name components are added to that container. * \return \c true if the path is relative (does not begin with '/'), \c false * if it is absolute (begin with '/'). @@ -196,13 +191,13 @@ protected: */ Test *findActualRoot( Test *searchRoot, const std::string &pathAsString, PathTestNames &testNames ); protected: - typedef CppUnitDeque<Test *> Tests; + typedef std::deque<Test *> Tests; Tests m_tests; }; CPPUNIT_NS_END diff --git a/3rdParty/CppUnit/src/include/cppunit/TestResult.h b/3rdParty/CppUnit/src/include/cppunit/TestResult.h index e7e1050..aabd80b 100644 --- a/3rdParty/CppUnit/src/include/cppunit/TestResult.h +++ b/3rdParty/CppUnit/src/include/cppunit/TestResult.h @@ -6,13 +6,13 @@ #if CPPUNIT_NEED_DLL_DECL #pragma warning( push ) #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z #endif #include <cppunit/SynchronizedObject.h> -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> #include <string> CPPUNIT_NS_BEGIN class Exception; @@ -21,16 +21,12 @@ class Protector; class ProtectorChain; class Test; class TestFailure; class TestListener; -#if CPPUNIT_NEED_DLL_DECL -// template class CPPUNIT_API std::deque<TestListener *>; -#endif - /*! \brief Manages TestListener. * \ingroup TrackingTestExecution * * A single instance of this class is used when running the test. It is usually * created by the test runner (TestRunner). * @@ -130,13 +126,13 @@ protected: void addFailure( const TestFailure &failure ); virtual void startTestRun( Test *test ); virtual void endTestRun( Test *test ); protected: - typedef CppUnitDeque<TestListener *> TestListeners; + typedef std::deque<TestListener *> TestListeners; TestListeners m_listeners; ProtectorChain *m_protectorChain; bool m_stop; private: TestResult( const TestResult &other ); diff --git a/3rdParty/CppUnit/src/include/cppunit/TestResultCollector.h b/3rdParty/CppUnit/src/include/cppunit/TestResultCollector.h index 01b0a54..b78c978 100644 --- a/3rdParty/CppUnit/src/include/cppunit/TestResultCollector.h +++ b/3rdParty/CppUnit/src/include/cppunit/TestResultCollector.h @@ -6,22 +6,17 @@ #if CPPUNIT_NEED_DLL_DECL #pragma warning( push ) #pragma warning( disable: 4251 4660 ) // X needs to have dll-interface to be used by clients of class Z #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 * \ingroup BrowsingCollectedTestResult * * A TestResultCollector is a TestListener which collects the results of executing @@ -33,14 +28,14 @@ CPPUNIT_NS_BEGIN * by the framework. * \see TestListener, TestFailure. */ 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. */ TestResultCollector( SynchronizationObject *syncObject = 0 ); diff --git a/3rdParty/CppUnit/src/include/cppunit/TestSuite.h b/3rdParty/CppUnit/src/include/cppunit/TestSuite.h index 2b9cd8d..63c0a6b 100644 --- a/3rdParty/CppUnit/src/include/cppunit/TestSuite.h +++ b/3rdParty/CppUnit/src/include/cppunit/TestSuite.h @@ -6,13 +6,13 @@ #if CPPUNIT_NEED_DLL_DECL #pragma warning( push ) #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z #endif #include <cppunit/TestComposite.h> -#include <cppunit/portability/CppUnitVector.h> +#include <vector> CPPUNIT_NS_BEGIN #if CPPUNIT_NEED_DLL_DECL // template class CPPUNIT_API std::vector<Test *>; @@ -53,24 +53,24 @@ public: /*! Returns the list of the tests (DEPRECATED). * \deprecated Use getChildTestCount() & getChildTestAt() of the * 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. */ virtual void deleteContents(); int getChildTestCount() const; Test *doGetChildTestAt( int index ) const; private: - CppUnitVector<Test *> m_tests; + std::vector<Test *> m_tests; }; CPPUNIT_NS_END #if CPPUNIT_NEED_DLL_DECL diff --git a/3rdParty/CppUnit/src/include/cppunit/TextTestResult.h b/3rdParty/CppUnit/src/include/cppunit/TextTestResult.h index e7b1fa3..63937b0 100644 --- a/3rdParty/CppUnit/src/include/cppunit/TextTestResult.h +++ b/3rdParty/CppUnit/src/include/cppunit/TextTestResult.h @@ -23,12 +23,14 @@ class CPPUNIT_API TextTestResult : public TestResult, public: TextTestResult(); virtual void addFailure( const TestFailure &failure ); virtual void startTest( Test *test ); virtual void print( OStream &stream ); + + using TestResult::addFailure; }; /** insertion operator for easy output */ CPPUNIT_API OStream &operator <<( OStream &stream, TextTestResult &result ); diff --git a/3rdParty/CppUnit/src/include/cppunit/XmlOutputter.h b/3rdParty/CppUnit/src/include/cppunit/XmlOutputter.h index 0de9676..2bf9411 100644 --- a/3rdParty/CppUnit/src/include/cppunit/XmlOutputter.h +++ b/3rdParty/CppUnit/src/include/cppunit/XmlOutputter.h @@ -6,14 +6,14 @@ #if CPPUNIT_NEED_DLL_DECL #pragma warning( push ) #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z #endif #include <cppunit/Outputter.h> -#include <cppunit/portability/CppUnitDeque.h> -#include <cppunit/portability/CppUnitMap.h> +#include <deque> +#include <map> #include <cppunit/portability/Stream.h> CPPUNIT_NS_BEGIN @@ -43,13 +43,13 @@ public: * \param result Result of the test run. * \param stream Stream used to output the XML output. * \param encoding Encoding used in the XML file (default is Latin-1). */ XmlOutputter( TestResultCollector *result, OStream &stream, - std::string encoding = std::string("ISO-8859-1") ); + const std::string& encoding = std::string("ISO-8859-1") ); /// Destructor. virtual ~XmlOutputter(); /*! \brief Adds the specified hook to the outputter. * \param hook Hook to add. Must not be \c NULL. @@ -82,13 +82,13 @@ public: * * \param standalone if true, the output will be specified as standalone. * if false, it will be not. */ 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. * * Set the root element of the XML Document and add its child elements. * * For all hooks, call beginDocument() just after creating the root element (it @@ -134,13 +134,13 @@ public: int testNumber, XmlElement *testsNode ); protected: virtual void fillFailedTestsMap( FailedTests &failedTests ); protected: - typedef CppUnitDeque<XmlOutputterHook *> Hooks; + typedef std::deque<XmlOutputterHook *> Hooks; TestResultCollector *m_result; OStream &m_stream; std::string m_encoding; std::string m_styleSheet; XmlDocument *m_xml; diff --git a/3rdParty/CppUnit/src/include/cppunit/config-auto.h b/3rdParty/CppUnit/src/include/cppunit/config-auto.h deleted file mode 100644 index 58b3d6e..0000000 --- a/3rdParty/CppUnit/src/include/cppunit/config-auto.h +++ /dev/null @@ -1,161 +0,0 @@ -#ifndef _INCLUDE_CPPUNIT_CONFIG_AUTO_H -#define _INCLUDE_CPPUNIT_CONFIG_AUTO_H 1 - -/* include/cppunit/config-auto.h. Generated automatically at end of configure. */ -/* config/config.h. Generated by configure. */ -/* config/config.h.in. Generated from configure.in by autoheader. */ - -/* define if library uses std::string::compare(string,pos,n) */ -/* #undef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST */ - - -#define CPPUNIT_HAVE_CPP_CAST - -/* define if the library defines strstream */ -#ifndef CPPUNIT_HAVE_CLASS_STRSTREAM -#define CPPUNIT_HAVE_CLASS_STRSTREAM 1 -#endif - -/* Define to 1 if you have the <cmath> header file. */ -#ifndef CPPUNIT_HAVE_CMATH -#define CPPUNIT_HAVE_CMATH 1 -#endif - -/* Define if you have the GNU dld library. */ -/* #undef CPPUNIT_HAVE_DLD */ - -/* Define to 1 if you have the `dlerror' function. */ -#ifndef CPPUNIT_HAVE_DLERROR -#define CPPUNIT_HAVE_DLERROR 1 -#endif - -/* Define to 1 if you have the <dlfcn.h> header file. */ -#ifndef CPPUNIT_HAVE_DLFCN_H -#define CPPUNIT_HAVE_DLFCN_H 1 -#endif - -/* define if the compiler supports GCC C++ ABI name demangling */ -#ifndef CPPUNIT_HAVE_GCC_ABI_DEMANGLE -#define CPPUNIT_HAVE_GCC_ABI_DEMANGLE 1 -#endif - -/* Define to 1 if you have the <inttypes.h> header file. */ -#ifndef CPPUNIT_HAVE_INTTYPES_H -#define CPPUNIT_HAVE_INTTYPES_H 1 -#endif - -/* Define if you have the libdl library or equivalent. */ -#ifndef CPPUNIT_HAVE_LIBDL -#define CPPUNIT_HAVE_LIBDL 1 -#endif - -/* Define to 1 if you have the <memory.h> header file. */ -#ifndef CPPUNIT_HAVE_MEMORY_H -#define CPPUNIT_HAVE_MEMORY_H 1 -#endif - -/* define to 1 if the compiler implements namespaces */ -#ifndef CPPUNIT_HAVE_NAMESPACES -#define CPPUNIT_HAVE_NAMESPACES 1 -#endif - -/* define if the compiler supports Run-Time Type Identification */ -#ifndef CPPUNIT_HAVE_RTTI -#define CPPUNIT_HAVE_RTTI 1 -#endif - -/* Define if you have the shl_load function. */ -/* #undef CPPUNIT_HAVE_SHL_LOAD */ - -/* define if the compiler has stringstream */ -#ifndef CPPUNIT_HAVE_SSTREAM -#define CPPUNIT_HAVE_SSTREAM 1 -#endif - -/* Define to 1 if you have the <stdint.h> header file. */ -#ifndef CPPUNIT_HAVE_STDINT_H -#define CPPUNIT_HAVE_STDINT_H 1 -#endif - -/* Define to 1 if you have the <stdlib.h> header file. */ -#ifndef CPPUNIT_HAVE_STDLIB_H -#define CPPUNIT_HAVE_STDLIB_H 1 -#endif - -/* Define to 1 if you have the <strings.h> header file. */ -#ifndef CPPUNIT_HAVE_STRINGS_H -#define CPPUNIT_HAVE_STRINGS_H 1 -#endif - -/* Define to 1 if you have the <string.h> header file. */ -#ifndef CPPUNIT_HAVE_STRING_H -#define CPPUNIT_HAVE_STRING_H 1 -#endif - -/* Define to 1 if you have the <strstream> header file. */ -#ifndef CPPUNIT_HAVE_STRSTREAM -#define CPPUNIT_HAVE_STRSTREAM 1 -#endif - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#ifndef CPPUNIT_HAVE_SYS_STAT_H -#define CPPUNIT_HAVE_SYS_STAT_H 1 -#endif - -/* Define to 1 if you have the <sys/types.h> header file. */ -#ifndef CPPUNIT_HAVE_SYS_TYPES_H -#define CPPUNIT_HAVE_SYS_TYPES_H 1 -#endif - -/* Define to 1 if you have the <unistd.h> header file. */ -#ifndef CPPUNIT_HAVE_UNISTD_H -#define CPPUNIT_HAVE_UNISTD_H 1 -#endif - -/* Name of package */ -#ifndef CPPUNIT_PACKAGE -#define CPPUNIT_PACKAGE "cppunit" -#endif - -/* Define to the address where bug reports for this package should be sent. */ -#ifndef CPPUNIT_PACKAGE_BUGREPORT -#define CPPUNIT_PACKAGE_BUGREPORT "" -#endif - -/* Define to the full name of this package. */ -#ifndef CPPUNIT_PACKAGE_NAME -#define CPPUNIT_PACKAGE_NAME "" -#endif - -/* Define to the full name and version of this package. */ -#ifndef CPPUNIT_PACKAGE_STRING -#define CPPUNIT_PACKAGE_STRING "" -#endif - -/* Define to the one symbol short name of this package. */ -#ifndef CPPUNIT_PACKAGE_TARNAME -#define CPPUNIT_PACKAGE_TARNAME "" -#endif - -/* Define to the version of this package. */ -#ifndef CPPUNIT_PACKAGE_VERSION -#define CPPUNIT_PACKAGE_VERSION "" -#endif - -/* Define to 1 if you have the ANSI C header files. */ -#ifndef CPPUNIT_STDC_HEADERS -#define CPPUNIT_STDC_HEADERS 1 -#endif - -/* Define to 1 to use type_info::name() for class names */ -#ifndef CPPUNIT_USE_TYPEINFO_NAME -#define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI -#endif - -/* Version number of package */ -#ifndef CPPUNIT_VERSION -#define CPPUNIT_VERSION "1.12.0" -#endif - -/* _INCLUDE_CPPUNIT_CONFIG_AUTO_H */ -#endif diff --git a/3rdParty/CppUnit/src/include/cppunit/config/SelectDllLoader.h b/3rdParty/CppUnit/src/include/cppunit/config/SelectDllLoader.h index dc1c011..9f8c0d6 100644 --- a/3rdParty/CppUnit/src/include/cppunit/config/SelectDllLoader.h +++ b/3rdParty/CppUnit/src/include/cppunit/config/SelectDllLoader.h @@ -12,15 +12,12 @@ * \brief If defined, then plug-in related classes and functions will not be compiled. * * \internal * CPPUNIT_HAVE_WIN32_DLL_LOADER * If defined, Win32 implementation of DynamicLibraryManager will be used. * - * CPPUNIT_HAVE_BEOS_DLL_LOADER - * If defined, BeOs implementation of DynamicLibraryManager will be used. - * * CPPUNIT_HAVE_UNIX_DLL_LOADER * If defined, Unix implementation (dlfcn.h) of DynamicLibraryManager will be used. */ /*! * \def CPPUNIT_PLUGIN_EXPORT @@ -47,16 +44,12 @@ // Is WIN32 platform ? #if defined(WIN32) #define CPPUNIT_HAVE_WIN32_DLL_LOADER 1 #undef CPPUNIT_PLUGIN_EXPORT #define CPPUNIT_PLUGIN_EXPORT extern "C" __declspec(dllexport) -// Is BeOS platform ? -#elif defined(__BEOS__) -#define CPPUNIT_HAVE_BEOS_DLL_LOADER 1 - // Is Unix platform and have shl_load() (hp-ux) #elif defined(CPPUNIT_HAVE_SHL_LOAD) #define CPPUNIT_HAVE_UNIX_SHL_LOADER 1 // Is Unix platform and have include <dlfcn.h> #elif defined(CPPUNIT_HAVE_LIBDL) diff --git a/3rdParty/CppUnit/src/include/cppunit/config/config-msvc6.h b/3rdParty/CppUnit/src/include/cppunit/config/config-msvc6.h index d688171..0edc059 100644 --- a/3rdParty/CppUnit/src/include/cppunit/config/config-msvc6.h +++ b/3rdParty/CppUnit/src/include/cppunit/config/config-msvc6.h @@ -27,26 +27,12 @@ /* define to 1 if the compiler implements namespaces */ #ifndef CPPUNIT_HAVE_NAMESPACES #define CPPUNIT_HAVE_NAMESPACES 1 #endif -/* define if the compiler supports Run-Time Type Identification */ -#ifndef CPPUNIT_HAVE_RTTI -# ifdef _CPPRTTI // Defined by the compiler option /GR -# define CPPUNIT_HAVE_RTTI 1 -# else -# define CPPUNIT_HAVE_RTTI 0 -# endif -#endif - -/* Define to 1 to use type_info::name() for class names */ -#ifndef CPPUNIT_USE_TYPEINFO_NAME -#define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI -#endif - #define CPPUNIT_HAVE_SSTREAM 1 /* Name of package */ #ifndef CPPUNIT_PACKAGE #define CPPUNIT_PACKAGE "cppunit" #endif @@ -70,14 +56,15 @@ #endif // 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 +#define CPPUNIT_UNIQUE_COUNTER __COUNTER__ +#endif // if _MSC_VER >= 1300 // VS 7.0 /* _INCLUDE_CPPUNIT_CONFIG_MSVC6_H */ #endif diff --git a/3rdParty/CppUnit/src/include/cppunit/extensions/ExceptionTestCaseDecorator.h b/3rdParty/CppUnit/src/include/cppunit/extensions/ExceptionTestCaseDecorator.h index 9c816ad..a3f2b3e 100644 --- a/3rdParty/CppUnit/src/include/cppunit/extensions/ExceptionTestCaseDecorator.h +++ b/3rdParty/CppUnit/src/include/cppunit/extensions/ExceptionTestCaseDecorator.h @@ -73,13 +73,13 @@ public: checkException( e ); return; } // Moved outside the try{} statement to handle the case where the // expected exception type is Exception (expecting assertion failure). -#if CPPUNIT_USE_TYPEINFO_NAME +#if defined(CPPUNIT_USE_TYPEINFO_NAME) throw Exception( Message( "expected exception not thrown", "Expected exception type: " + TypeInfoHelper::getClassName( typeid( ExpectedExceptionType ) ) ) ); #else @@ -89,13 +89,13 @@ public: private: /*! \brief Called when the exception is caught. * * Should be overriden to check the exception. */ - virtual void checkException( ExpectedExceptionType &e ) + virtual void checkException( ExpectedExceptionType & ) { } }; CPPUNIT_NS_END diff --git a/3rdParty/CppUnit/src/include/cppunit/extensions/HelperMacros.h b/3rdParty/CppUnit/src/include/cppunit/extensions/HelperMacros.h index 12431e4..4c30319 100644 --- a/3rdParty/CppUnit/src/include/cppunit/extensions/HelperMacros.h +++ b/3rdParty/CppUnit/src/include/cppunit/extensions/HelperMacros.h @@ -163,23 +163,24 @@ * \see CPPUNIT_TEST_SUITE. * \see CPPUNIT_TEST_SUITE_REGISTRATION. */ #define CPPUNIT_TEST_SUITE_END() \ } \ \ +public: \ static CPPUNIT_NS::TestSuite *suite() \ { \ const CPPUNIT_NS::TestNamer &namer = getTestNamer__(); \ - std::auto_ptr<CPPUNIT_NS::TestSuite> 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( *suite.get(), \ + CPPUNIT_NS::TestSuiteBuilderContextBase context( *guard.get(), \ namer, \ factory ); \ TestFixtureType::addTestsToSuite( context ); \ - return suite.release(); \ + return guard.release(); \ } \ private: /* dummy typedef so that the macro can still end with ';'*/ \ typedef int CppUnitDummyTypedefForSemiColonEnding__ /*! \brief End declaration of an abstract test suite. * @@ -297,27 +298,38 @@ CPPUNIT_TEST_SUITE_ADD_TEST( \ ( new CPPUNIT_NS::TestCaller<TestFixtureType>( \ context.getTestNameFor( #testMethod), \ &TestFixtureType::testMethod, \ context.makeFixture() ) ) ) +#define CPPUNIT_TEST_PARAMETERIZED( testMethod, ... ) \ + for (auto& i : __VA_ARGS__) \ + { \ + TestFixtureType* fixture = context.makeFixture(); \ + CPPUNIT_TEST_SUITE_ADD_TEST( \ + ( new CPPUNIT_NS::TestCaller<TestFixtureType>( \ + context.getTestNameFor(#testMethod, i), \ + std::bind(&TestFixtureType::testMethod, fixture, i), \ + fixture))); \ + } + /*! \brief Add a test which fail if the specified exception is not caught. * * Example: * \code * #include <cppunit/extensions/HelperMacros.h> * #include <vector> * class MyTest : public CppUnit::TestFixture { * CPPUNIT_TEST_SUITE( MyTest ); - * CPPUNIT_TEST_EXCEPTION( testVectorAtThrow, std::invalid_argument ); + * CPPUNIT_TEST_EXCEPTION( testVectorAtThrow, std::out_of_range ); * CPPUNIT_TEST_SUITE_END(); * public: * void testVectorAtThrow() * { * std::vector<int> v; - * v.at( 1 ); // must throw exception std::invalid_argument + * v.at( 1 ); // must throw exception std::out_of_range * } * }; * \endcode * * \param testMethod Name of the method of the test case to add to the suite. * \param ExceptionType Type of the exception that must be thrown by the test diff --git a/3rdParty/CppUnit/src/include/cppunit/extensions/TestCaseDecorator.h b/3rdParty/CppUnit/src/include/cppunit/extensions/TestCaseDecorator.h index 3a15ba9..effde25 100644 --- a/3rdParty/CppUnit/src/include/cppunit/extensions/TestCaseDecorator.h +++ b/3rdParty/CppUnit/src/include/cppunit/extensions/TestCaseDecorator.h @@ -10,13 +10,13 @@ CPPUNIT_NS_BEGIN /*! \brief Decorator for Test cases. * * TestCaseDecorator provides an alternate means to extend functionality * of a test class without subclassing the test. Instead, one can * subclass the decorater and use it to wrap the test class. * - * Does not assume ownership of the test it decorates + * Assumes ownership of the test it decorates */ class CPPUNIT_API TestCaseDecorator : public TestCase { public: TestCaseDecorator( TestCase *test ); ~TestCaseDecorator(); @@ -28,12 +28,19 @@ public: void tearDown(); void runTest(); protected: TestCase *m_test; + +private: + + //prevent the creation of copy c'tor and operator= + TestCaseDecorator( const TestCaseDecorator& ); + TestCaseDecorator& operator=( const TestCaseDecorator& ); + }; CPPUNIT_NS_END #endif diff --git a/3rdParty/CppUnit/src/include/cppunit/extensions/TestFactoryRegistry.h b/3rdParty/CppUnit/src/include/cppunit/extensions/TestFactoryRegistry.h index fc8723e..9d10c94 100644 --- a/3rdParty/CppUnit/src/include/cppunit/extensions/TestFactoryRegistry.h +++ b/3rdParty/CppUnit/src/include/cppunit/extensions/TestFactoryRegistry.h @@ -5,26 +5,21 @@ #if CPPUNIT_NEED_DLL_DECL #pragma warning( push ) #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> CPPUNIT_NS_BEGIN class TestSuite; -#if CPPUNIT_NEED_DLL_DECL -// template class CPPUNIT_API std::set<TestFactory *>; -#endif - - /*! \brief Registry for TestFactory. * \ingroup CreatingTestSuite * * Notes that the registry \b DON'T assumes lifetime control for any registered tests * anymore. * @@ -162,13 +157,13 @@ public: private: TestFactoryRegistry( const TestFactoryRegistry © ); 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/3rdParty/CppUnit/src/include/cppunit/extensions/TestNamer.h b/3rdParty/CppUnit/src/include/cppunit/extensions/TestNamer.h index 5a6471c..0c8fb31 100644 --- a/3rdParty/CppUnit/src/include/cppunit/extensions/TestNamer.h +++ b/3rdParty/CppUnit/src/include/cppunit/extensions/TestNamer.h @@ -1,64 +1,50 @@ #ifndef CPPUNIT_EXTENSIONS_TESTNAMER_H #define CPPUNIT_EXTENSIONS_TESTNAMER_H #include <cppunit/Portability.h> #include <string> +#include <cppunit/tools/StringHelper.h> -#if CPPUNIT_HAVE_RTTI -# include <typeinfo> -#endif +#include <typeinfo> /*! \def CPPUNIT_TESTNAMER_DECL( variableName, FixtureType ) * \brief Declares a TestNamer. * - * Declares a TestNamer for the specified type, using RTTI if enabled, otherwise - * using macro string expansion. - * - * RTTI is used if CPPUNIT_USE_TYPEINFO_NAME is defined and not null. + * Declares a TestNamer for the specified type * * \code * void someMethod() * { * CPPUNIT_TESTNAMER_DECL( namer, AFixtureType ); * std::string fixtureName = namer.getFixtureName(); * ... * \endcode * * \relates TestNamer * \see TestNamer */ -#if CPPUNIT_USE_TYPEINFO_NAME # define CPPUNIT_TESTNAMER_DECL( variableName, FixtureType ) \ CPPUNIT_NS::TestNamer variableName( typeid(FixtureType) ) -#else -# define CPPUNIT_TESTNAMER_DECL( variableName, FixtureType ) \ - CPPUNIT_NS::TestNamer variableName( std::string(#FixtureType) ) -#endif - - CPPUNIT_NS_BEGIN - /*! \brief Names a test or a fixture suite. * * TestNamer is usually instantiated using CPPUNIT_TESTNAMER_DECL. * */ class CPPUNIT_API TestNamer { public: -#if CPPUNIT_HAVE_RTTI /*! \brief Constructs a namer using the fixture's type-info. * \param typeInfo Type-info of the fixture type. Use to name the fixture suite. */ TestNamer( const std::type_info &typeInfo ); -#endif /*! \brief Constructs a namer using the specified fixture name. * \param fixtureName Name of the fixture suite. Usually extracted using a macro. */ TestNamer( const std::string &fixtureName ); @@ -75,15 +61,20 @@ public: * (returned by getFixtureName()) and\a testMethodName, * separated using '::'. This provides a fairly unique name for a given * test. */ virtual std::string getTestNameFor( const std::string &testMethodName ) const; + template<typename E> + std::string getTestNameFor( const std::string& testMethodName, const E& val) const + { + return getTestNameFor(testMethodName) + " with parameter: " + CPPUNIT_NS::StringHelper::toString(val); + } + protected: std::string m_fixtureName; }; - CPPUNIT_NS_END #endif // CPPUNIT_EXTENSIONS_TESTNAMER_H diff --git a/3rdParty/CppUnit/src/include/cppunit/extensions/TestSuiteBuilderContext.h b/3rdParty/CppUnit/src/include/cppunit/extensions/TestSuiteBuilderContext.h index db26926..72bfa70 100644 --- a/3rdParty/CppUnit/src/include/cppunit/extensions/TestSuiteBuilderContext.h +++ b/3rdParty/CppUnit/src/include/cppunit/extensions/TestSuiteBuilderContext.h @@ -1,11 +1,11 @@ #ifndef CPPUNIT_HELPER_TESTSUITEBUILDERCONTEXT_H #define CPPUNIT_HELPER_TESTSUITEBUILDERCONTEXT_H #include <cppunit/Portability.h> -#include <cppunit/portability/CppUnitMap.h> +#include <map> #include <string> #if CPPUNIT_NEED_DLL_DECL #pragma warning( push ) #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z #endif @@ -59,12 +59,27 @@ public: * (returned by getFixtureName()) and\a testMethodName, * separated using '::'. This provides a fairly unique name for a given * test. */ std::string getTestNameFor( const std::string &testMethodName ) const; + /*! \brief Returns the name of the test for the specified method with the corresponding parameter. + * + * \param testMethodName Name (including a parameter) of the method that implements a test. + * \return A string that is the concatenation of the test fixture name + * (returned by getFixtureName()), \a testMethodName, + * separated using '::' and the parameter. This provides a fairly unique name for a given + * test. The parameter must be convertable to std::string through operator<< + * or a specialization of CPPUNIT_NS::StringHelper::toString needs to exist. + */ + template<typename T> + std::string getTestNameFor( const std::string &testMethodName, const T& value ) const + { + return m_namer.getTestNameFor(testMethodName, value); + } + /*! \brief Adds property pair. * \param key PropertyKey string to add. * \param value PropertyValue string to add. */ void addProperty( const std::string &key, const std::string &value ); @@ -78,13 +93,13 @@ protected: TestFixture *makeTestFixture() const; // Notes: we use a vector here instead of a map to work-around the // 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; TestFixtureFactory &m_factory; private: diff --git a/3rdParty/CppUnit/src/include/cppunit/extensions/TypeInfoHelper.h b/3rdParty/CppUnit/src/include/cppunit/extensions/TypeInfoHelper.h index c0ecdbc..1adec83 100644 --- a/3rdParty/CppUnit/src/include/cppunit/extensions/TypeInfoHelper.h +++ b/3rdParty/CppUnit/src/include/cppunit/extensions/TypeInfoHelper.h @@ -1,19 +1,16 @@ #ifndef CPPUNIT_TYPEINFOHELPER_H #define CPPUNIT_TYPEINFOHELPER_H #include <cppunit/Portability.h> -#if CPPUNIT_HAVE_RTTI - #include <typeinfo> #include <string> CPPUNIT_NS_BEGIN - /**! \brief Helper to use type_info. */ class CPPUNIT_API TypeInfoHelper { public: /*! \brief Get the class name of the specified type_info. @@ -22,12 +19,9 @@ CPPUNIT_NS_BEGIN * the "class" prefix. If the name is not prefixed * by "class", it is returned as this. */ static std::string getClassName( const std::type_info &info ); }; - CPPUNIT_NS_END -#endif // CPPUNIT_HAVE_RTTI - #endif // CPPUNIT_TYPEINFOHELPER_H diff --git a/3rdParty/CppUnit/src/include/cppunit/portability/CppUnitDeque.h b/3rdParty/CppUnit/src/include/cppunit/portability/CppUnitDeque.h deleted file mode 100644 index bbab21f..0000000 --- a/3rdParty/CppUnit/src/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/3rdParty/CppUnit/src/include/cppunit/portability/CppUnitMap.h b/3rdParty/CppUnit/src/include/cppunit/portability/CppUnitMap.h deleted file mode 100644 index 0cdc723..0000000 --- a/3rdParty/CppUnit/src/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/3rdParty/CppUnit/src/include/cppunit/portability/CppUnitSet.h b/3rdParty/CppUnit/src/include/cppunit/portability/CppUnitSet.h deleted file mode 100644 index 18b8662..0000000 --- a/3rdParty/CppUnit/src/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/3rdParty/CppUnit/src/include/cppunit/portability/CppUnitVector.h b/3rdParty/CppUnit/src/include/cppunit/portability/CppUnitVector.h deleted file mode 100644 index 6666a63..0000000 --- a/3rdParty/CppUnit/src/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/3rdParty/CppUnit/src/include/cppunit/tools/StringHelper.h b/3rdParty/CppUnit/src/include/cppunit/tools/StringHelper.h new file mode 100644 index 0000000..3301045 --- /dev/null +++ b/3rdParty/CppUnit/src/include/cppunit/tools/StringHelper.h @@ -0,0 +1,45 @@ +#ifndef CPPUNIT_TOOLS_STRINGHELPER_H +#define CPPUNIT_TOOLS_STRINGHELPER_H + +#include <cppunit/Portability.h> +#include <cppunit/portability/Stream.h> +#include <string> +#include <type_traits> + + +CPPUNIT_NS_BEGIN + + +/*! \brief Methods for converting values to strings. Replaces CPPUNIT_NS::StringTools::toString + */ +namespace StringHelper +{ + +// 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 std::enable_if<!std::is_enum<T>::value, std::string>::type toString(const T& x) +{ + OStringStream ost; + ost << x; + + return ost.str(); +} + +template<typename T> +typename std::enable_if<std::is_enum<T>::value, std::string>::type toString(const T& x) +{ + OStringStream ost; + ost << static_cast<typename std::underlying_type<T>::type>(x); + + return ost.str(); +} + +} + + +CPPUNIT_NS_END + +#endif // CPPUNIT_TOOLS_STRINGHELPER_H + diff --git a/3rdParty/CppUnit/src/include/cppunit/tools/StringTools.h b/3rdParty/CppUnit/src/include/cppunit/tools/StringTools.h index 7a6b6d7..d08c6e0 100644 --- a/3rdParty/CppUnit/src/include/cppunit/tools/StringTools.h +++ b/3rdParty/CppUnit/src/include/cppunit/tools/StringTools.h @@ -1,23 +1,23 @@ #ifndef CPPUNIT_TOOLS_STRINGTOOLS_H #define CPPUNIT_TOOLS_STRINGTOOLS_H #include <cppunit/Portability.h> #include <string> -#include <cppunit/portability/CppUnitVector.h> +#include <vector> CPPUNIT_NS_BEGIN /*! \brief Tool functions to manipulate string. */ struct StringTools { - typedef CppUnitVector<std::string> Strings; + typedef std::vector<std::string> Strings; static std::string CPPUNIT_API toString( int value ); static std::string CPPUNIT_API toString( double value ); static Strings CPPUNIT_API split( const std::string &text, diff --git a/3rdParty/CppUnit/src/include/cppunit/tools/XmlElement.h b/3rdParty/CppUnit/src/include/cppunit/tools/XmlElement.h index 0b36bd2..70e21f8 100644 --- a/3rdParty/CppUnit/src/include/cppunit/tools/XmlElement.h +++ b/3rdParty/CppUnit/src/include/cppunit/tools/XmlElement.h @@ -5,13 +5,13 @@ #if CPPUNIT_NEED_DLL_DECL #pragma warning( push ) #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 @@ -128,16 +128,16 @@ private: std::string escape( std::string value ) const; 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; }; CPPUNIT_NS_END diff --git a/3rdParty/CppUnit/src/include/cppunit/ui/text/TextTestRunner.h b/3rdParty/CppUnit/src/include/cppunit/ui/text/TextTestRunner.h index 86da4d4..6250166 100644 --- a/3rdParty/CppUnit/src/include/cppunit/ui/text/TextTestRunner.h +++ b/3rdParty/CppUnit/src/include/cppunit/ui/text/TextTestRunner.h @@ -83,12 +83,18 @@ public: // overridden from TestRunner (to avoid hidden virtual function warning) const std::string &testPath = "" ); protected: virtual void wait( bool doWait ); virtual void printResult( bool doPrintResult ); +private: + // prohibit copying + TextTestRunner( const TextTestRunner& ); + // prohibit copying + TextTestRunner& operator=( const TextTestRunner& ); + TestResultCollector *m_result; TestResult *m_eventManager; Outputter *m_outputter; }; diff --git a/3rdParty/CppUnit/src/src/cppunit/Asserter.cpp b/3rdParty/CppUnit/src/src/cppunit/Asserter.cpp index a9cf95c..79fcb2e 100644 --- a/3rdParty/CppUnit/src/src/cppunit/Asserter.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/Asserter.cpp @@ -3,20 +3,21 @@ #include <cppunit/Message.h> CPPUNIT_NS_BEGIN +// coverity[+kill] void Asserter::fail( std::string message, const SourceLine &sourceLine ) { fail( Message( "assertion failed", message ), sourceLine ); } - +// coverity[+kill] void Asserter::fail( const Message &message, const SourceLine &sourceLine ) { throw Exception( message, sourceLine ); } @@ -37,58 +38,152 @@ Asserter::failIf( bool shouldFail, std::string message, const SourceLine &sourceLine ) { failIf( shouldFail, Message( "assertion failed", message ), sourceLine ); } - std::string Asserter::makeExpected( const std::string &expectedValue ) { return "Expected: " + expectedValue; } +std::string +Asserter::makeExpectedEqual( const std::string &expectedValue ) +{ + return "Expected: " + expectedValue; +} + +std::string +Asserter::makeExpectedLess( const std::string& expectedValue ) +{ + return "Expected less than: " + expectedValue; +} + +std::string +Asserter::makeExpectedLessEqual( const std::string& expectedValue ) +{ + return "Expected less or equal than: " + expectedValue; +} + +std::string +Asserter::makeExpectedGreater( const std::string& expectedValue ) +{ + return "Expected greater than: " + expectedValue; +} + +std::string +Asserter::makeExpectedGreaterEqual( const std::string& expectedValue ) +{ + return "Expected greater or equal than: " + expectedValue; +} std::string Asserter::makeActual( const std::string &actualValue ) { return "Actual : " + actualValue; } +Message +Asserter::makeMessage( const std::string& expectedMessage, + const std::string& actualMessage, + const std::string& shortDescription, + const AdditionalMessage& additionalMessage) +{ + Message message( shortDescription, + expectedMessage, + actualMessage ); + message.addDetail( additionalMessage ); + + return message; +} + + Message Asserter::makeNotEqualMessage( const std::string &expectedValue, const std::string &actualValue, const AdditionalMessage &additionalMessage, const std::string &shortDescription ) { - Message message( shortDescription, - makeExpected( expectedValue ), - makeActual( actualValue ) ); - message.addDetail( additionalMessage ); - - return message; + return makeMessage(makeExpectedEqual(expectedValue), makeActual(actualValue), shortDescription, additionalMessage); } void Asserter::failNotEqual( std::string expected, std::string actual, const SourceLine &sourceLine, const AdditionalMessage &additionalMessage, std::string shortDescription ) { - fail( makeNotEqualMessage( expected, - actual, - additionalMessage, - shortDescription ), + fail( makeMessage( makeExpectedEqual(expected), + makeActual(actual), + shortDescription, + additionalMessage ), + sourceLine ); +} + + +void +Asserter::failNotLess( std::string expected, + std::string actual, + const SourceLine &sourceLine, + const AdditionalMessage &additionalMessage, + std::string shortDescription ) +{ + fail( makeMessage( makeExpectedLess(expected), + makeActual(actual), + shortDescription, + additionalMessage), sourceLine ); } void +Asserter::failNotGreater( std::string expected, + std::string actual, + const SourceLine &sourceLine, + const AdditionalMessage &additionalMessage, + std::string shortDescription ) +{ + fail( makeMessage( makeExpectedGreater(expected), + makeActual(actual), + shortDescription, + additionalMessage), + sourceLine ); +} + +void +Asserter::failNotLessEqual( std::string expected, + std::string actual, + const SourceLine &sourceLine, + const AdditionalMessage &additionalMessage, + std::string shortDescription ) +{ + fail( makeMessage( makeExpectedLessEqual(expected), + makeActual(actual), + shortDescription, + additionalMessage ), + sourceLine ); +} + +void +Asserter::failNotGreaterEqual( std::string expected, + std::string actual, + const SourceLine &sourceLine, + const AdditionalMessage &additionalMessage, + std::string shortDescription ) +{ + fail( makeMessage( makeExpectedGreaterEqual(expected), + makeActual(actual), + shortDescription, + additionalMessage ), + sourceLine ); +} +void Asserter::failNotEqualIf( bool shouldFail, std::string expected, std::string actual, const SourceLine &sourceLine, const AdditionalMessage &additionalMessage, std::string shortDescription ) diff --git a/3rdParty/CppUnit/src/src/cppunit/BriefTestProgressListener.cpp b/3rdParty/CppUnit/src/src/cppunit/BriefTestProgressListener.cpp index 120e6d5..4ea8d35 100644 --- a/3rdParty/CppUnit/src/src/cppunit/BriefTestProgressListener.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/BriefTestProgressListener.cpp @@ -34,13 +34,13 @@ BriefTestProgressListener::addFailure( const TestFailure &failure ) stdCOut() << " : " << (failure.isError() ? "error" : "assertion"); m_lastTestFailed = true; } void -BriefTestProgressListener::endTest( Test *) +BriefTestProgressListener::endTest( Test * ) { if ( !m_lastTestFailed ) stdCOut() << " : OK"; stdCOut() << "\n"; } diff --git a/3rdParty/CppUnit/src/src/cppunit/DefaultProtector.cpp b/3rdParty/CppUnit/src/src/cppunit/DefaultProtector.cpp index 6fb306b..fa6ac87 100644 --- a/3rdParty/CppUnit/src/src/cppunit/DefaultProtector.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/DefaultProtector.cpp @@ -18,13 +18,13 @@ DefaultProtector::protect( const Functor &functor, { reportFailure( context, failure ); } catch ( std::exception &e ) { std::string shortDescription( "uncaught exception of type " ); -#if CPPUNIT_USE_TYPEINFO_NAME +#if defined(CPPUNIT_USE_TYPEINFO_NAME) shortDescription += TypeInfoHelper::getClassName( typeid(e) ); #else shortDescription += "std::exception (or derived)."; #endif Message message( shortDescription, e.what() ); reportError( context, message ); diff --git a/3rdParty/CppUnit/src/src/cppunit/Exception.cpp b/3rdParty/CppUnit/src/src/cppunit/Exception.cpp index 3bbe24b..6685480 100644 --- a/3rdParty/CppUnit/src/src/cppunit/Exception.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/Exception.cpp @@ -16,26 +16,26 @@ const std::string Exception::UNKNOWNFILENAME = "<unknown>"; const long Exception::UNKNOWNLINENUMBER = -1; #endif Exception::Exception( const Exception &other ) : std::exception( other ) + , m_message(other.m_message) + , m_sourceLine(other.m_sourceLine) + , m_whatMessage(other.m_whatMessage) { - m_message = other.m_message; - m_sourceLine = other.m_sourceLine; } - Exception::Exception( const Message &message, const SourceLine &sourceLine ) : m_message( message ) , m_sourceLine( sourceLine ) + , m_whatMessage() { } - #ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED Exception::Exception( std::string message, long lineNumber, std::string fileName ) : m_message( message ) , m_sourceLine( fileName, lineNumber ) diff --git a/3rdParty/CppUnit/src/src/cppunit/Message.cpp b/3rdParty/CppUnit/src/src/cppunit/Message.cpp index 9d6a0e9..ad2efd9 100644 --- a/3rdParty/CppUnit/src/src/cppunit/Message.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/Message.cpp @@ -1,55 +1,59 @@ #include <cppunit/Message.h> #include <stdexcept> CPPUNIT_NS_BEGIN - -Message::Message() -{ -} - Message::Message( const Message &other ) + : m_shortDescription() + , m_details() { *this = other; } - Message::Message( const std::string &shortDescription ) : m_shortDescription( shortDescription ) + , m_details() { } Message::Message( const std::string &shortDescription, const std::string &detail1 ) : m_shortDescription( shortDescription ) + , m_details() { addDetail( detail1 ); } Message::Message( const std::string &shortDescription, const std::string &detail1, const std::string &detail2 ) : m_shortDescription( shortDescription ) + , m_details() { addDetail( detail1, detail2 ); } Message::Message( const std::string &shortDescription, const std::string &detail1, const std::string &detail2, const std::string &detail3 ) : m_shortDescription( shortDescription ) + , m_details() { addDetail( detail1, detail2, detail3 ); } +Message::~Message() +{ +} + Message & Message::operator =( const Message &other ) { if ( this != &other ) { m_shortDescription = other.m_shortDescription.c_str(); diff --git a/3rdParty/CppUnit/src/src/cppunit/Protector.cpp b/3rdParty/CppUnit/src/src/cppunit/Protector.cpp index 5c171ec..99188bb 100644 --- a/3rdParty/CppUnit/src/src/cppunit/Protector.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/Protector.cpp @@ -18,13 +18,13 @@ Protector::~Protector() void Protector::reportError( const ProtectorContext &context, const Exception &error ) const { - std::auto_ptr<Exception> actualError( error.clone() ); + std::unique_ptr<Exception> actualError( error.clone() ); actualError->setMessage( actualMessage( actualError->message(), context ) ); context.m_result->addError( context.m_test, actualError.release() ); } @@ -39,13 +39,13 @@ Protector::reportError( const ProtectorContext &context, void Protector::reportFailure( const ProtectorContext &context, const Exception &failure ) const { - std::auto_ptr<Exception> actualFailure( failure.clone() ); + std::unique_ptr<Exception> actualFailure( failure.clone() ); actualFailure->setMessage( actualMessage( actualFailure->message(), context ) ); context.m_result->addFailure( context.m_test, actualFailure.release() ); } diff --git a/3rdParty/CppUnit/src/src/cppunit/ProtectorChain.cpp b/3rdParty/CppUnit/src/src/cppunit/ProtectorChain.cpp index f528341..db7744a 100644 --- a/3rdParty/CppUnit/src/src/cppunit/ProtectorChain.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/ProtectorChain.cpp @@ -18,17 +18,26 @@ public: bool operator()() const { return m_protector->protect( m_functor, m_context ); } private: + // disable copying + ProtectFunctor( const ProtectFunctor& ); + // disable copying + ProtectFunctor& operator=( const ProtectFunctor& ); + Protector *m_protector; const Functor &m_functor; const ProtectorContext &m_context; }; +ProtectorChain::ProtectorChain() + : m_protectors(0) +{ +} ProtectorChain::~ProtectorChain() { while ( count() > 0 ) pop(); } diff --git a/3rdParty/CppUnit/src/src/cppunit/ProtectorChain.h b/3rdParty/CppUnit/src/src/cppunit/ProtectorChain.h index 711b56f..9123782 100644 --- a/3rdParty/CppUnit/src/src/cppunit/ProtectorChain.h +++ b/3rdParty/CppUnit/src/src/cppunit/ProtectorChain.h @@ -1,11 +1,11 @@ #ifndef CPPUNIT_PROTECTORCHAIN_H #define CPPUNIT_PROTECTORCHAIN_H #include <cppunit/Protector.h> -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> #if CPPUNIT_NEED_DLL_DECL #pragma warning( push ) #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z #endif @@ -16,12 +16,14 @@ CPPUNIT_NS_BEGIN * Implementation detail. * \internal Protector that protect a Functor using a chain of nested Protector. */ class CPPUNIT_API ProtectorChain : public Protector { public: + ProtectorChain(); + ~ProtectorChain(); void push( Protector *protector ); void pop(); @@ -31,16 +33,16 @@ public: const ProtectorContext &context ); 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; }; CPPUNIT_NS_END #if CPPUNIT_NEED_DLL_DECL diff --git a/3rdParty/CppUnit/src/src/cppunit/ProtectorContext.h b/3rdParty/CppUnit/src/src/cppunit/ProtectorContext.h index c3d496c..4957e05 100644 --- a/3rdParty/CppUnit/src/src/cppunit/ProtectorContext.h +++ b/3rdParty/CppUnit/src/src/cppunit/ProtectorContext.h @@ -23,12 +23,19 @@ public: : m_test( test ) , m_result( result ) , m_shortDescription( shortDescription ) { } +private: + /// disable copy construction + ProtectorContext( const ProtectorContext& ); + /// disable assignment + ProtectorContext& operator=(const ProtectorContext&); + +public: Test *m_test; TestResult *m_result; std::string m_shortDescription; }; diff --git a/3rdParty/CppUnit/src/src/cppunit/SourceLine.cpp b/3rdParty/CppUnit/src/src/cppunit/SourceLine.cpp index dfadae3..ecc9558 100644 --- a/3rdParty/CppUnit/src/src/cppunit/SourceLine.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/SourceLine.cpp @@ -2,12 +2,13 @@ CPPUNIT_NS_BEGIN SourceLine::SourceLine() : + m_fileName(), m_lineNumber( -1 ) { } SourceLine::SourceLine( const SourceLine &other ) diff --git a/3rdParty/CppUnit/src/src/cppunit/TestCase.cpp b/3rdParty/CppUnit/src/src/cppunit/TestCase.cpp index 13c0525..431a0c5 100644 --- a/3rdParty/CppUnit/src/src/cppunit/TestCase.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/TestCase.cpp @@ -2,13 +2,13 @@ #include <cppunit/Exception.h> #include <cppunit/Protector.h> #include <cppunit/TestCase.h> #include <cppunit/TestResult.h> #include <stdexcept> -#if CPPUNIT_USE_TYPEINFO_NAME +#if defined(CPPUNIT_USE_TYPEINFO_NAME) # include <typeinfo> #endif CPPUNIT_NS_BEGIN /*! \brief Functor to call test case method (Implementation). diff --git a/3rdParty/CppUnit/src/src/cppunit/TestFactoryRegistry.cpp b/3rdParty/CppUnit/src/src/cppunit/TestFactoryRegistry.cpp index 3457da3..f1623cc 100644 --- a/3rdParty/CppUnit/src/src/cppunit/TestFactoryRegistry.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/TestFactoryRegistry.cpp @@ -1,21 +1,21 @@ #include <cppunit/config/SourcePrefix.h> #include <cppunit/extensions/TestFactoryRegistry.h> -#include <cppunit/portability/CppUnitMap.h> +#include <map> #include <cppunit/TestSuite.h> #include <assert.h> CPPUNIT_NS_BEGIN /*! \brief (INTERNAL) List of all TestFactoryRegistry. */ 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 { doNotChange =0, notCreated, exist, @@ -47,12 +47,13 @@ private: } return (*foundIt).second; } public: TestFactoryRegistryList() + : m_registries() { stateFlag( exist ); } ~TestFactoryRegistryList() { @@ -80,12 +81,13 @@ public: } }; TestFactoryRegistry::TestFactoryRegistry( std::string name ) : + m_factories(), m_name( name ) { } TestFactoryRegistry::~TestFactoryRegistry() diff --git a/3rdParty/CppUnit/src/src/cppunit/TestNamer.cpp b/3rdParty/CppUnit/src/src/cppunit/TestNamer.cpp index eec9be9..1eb6c5f 100644 --- a/3rdParty/CppUnit/src/src/cppunit/TestNamer.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/TestNamer.cpp @@ -1,44 +1,34 @@ #include <cppunit/extensions/TestNamer.h> #include <cppunit/extensions/TypeInfoHelper.h> +#include <cppunit/tools/StringHelper.h> #include <string> - CPPUNIT_NS_BEGIN - -#if CPPUNIT_HAVE_RTTI TestNamer::TestNamer( const std::type_info &typeInfo ) + : m_fixtureName( TypeInfoHelper::getClassName( typeInfo ) ) { - m_fixtureName = TypeInfoHelper::getClassName( typeInfo ); } -#endif - TestNamer::TestNamer( const std::string &fixtureName ) : m_fixtureName( fixtureName ) { } - TestNamer::~TestNamer() { } - std::string TestNamer::getFixtureName() const { return m_fixtureName; } - std::string TestNamer::getTestNameFor( const std::string &testMethodName ) const { return getFixtureName() + "::" + testMethodName; } - - - CPPUNIT_NS_END diff --git a/3rdParty/CppUnit/src/src/cppunit/TestPath.cpp b/3rdParty/CppUnit/src/src/cppunit/TestPath.cpp index a2783a2..5affffb 100644 --- a/3rdParty/CppUnit/src/src/cppunit/TestPath.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/TestPath.cpp @@ -5,25 +5,28 @@ CPPUNIT_NS_BEGIN TestPath::TestPath() + : m_tests() { } TestPath::TestPath( Test *root ) + : m_tests() { add( root ); } TestPath::TestPath( const TestPath &other, int indexFirst, int count ) + : m_tests() { int countAdjustment = 0; if ( indexFirst < 0 ) { countAdjustment = indexFirst; indexFirst = 0; @@ -39,12 +42,13 @@ TestPath::TestPath( const TestPath &other, add( other.getTestAt( index++ ) ); } TestPath::TestPath( Test *searchRoot, const std::string &pathAsString ) + : m_tests() { PathTestNames testNames; Test *parentTest = findActualRoot( searchRoot, pathAsString, testNames ); add( parentTest ); diff --git a/3rdParty/CppUnit/src/src/cppunit/TestResult.cpp b/3rdParty/CppUnit/src/src/cppunit/TestResult.cpp index 6be19f1..ad880bc 100644 --- a/3rdParty/CppUnit/src/src/cppunit/TestResult.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/TestResult.cpp @@ -1,30 +1,34 @@ #include <cppunit/Test.h> #include <cppunit/TestFailure.h> #include <cppunit/TestListener.h> #include <cppunit/TestResult.h> #include <cppunit/tools/Algorithm.h> +#include <cppunit/portability/Stream.h> #include <algorithm> #include "DefaultProtector.h" #include "ProtectorChain.h" #include "ProtectorContext.h" CPPUNIT_NS_BEGIN TestResult::TestResult( SynchronizationObject *syncObject ) : SynchronizedObject( syncObject ) - , m_protectorChain( new ProtectorChain() ) + , m_listeners() + , m_protectorChain( new ProtectorChain ) , m_stop( false ) { m_protectorChain->push( new DefaultProtector() ); } TestResult::~TestResult() { + stdCOut().flush(); + stdCErr().flush(); delete m_protectorChain; } void TestResult::reset() diff --git a/3rdParty/CppUnit/src/src/cppunit/TestResultCollector.cpp b/3rdParty/CppUnit/src/src/cppunit/TestResultCollector.cpp index 4371c50..73f81da 100644 --- a/3rdParty/CppUnit/src/src/cppunit/TestResultCollector.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/TestResultCollector.cpp @@ -4,12 +4,15 @@ CPPUNIT_NS_BEGIN TestResultCollector::TestResultCollector( SynchronizationObject *syncObject ) : TestSuccessListener( syncObject ) + , m_tests() + , m_failures() + , m_testErrors(0) { reset(); } TestResultCollector::~TestResultCollector() diff --git a/3rdParty/CppUnit/src/src/cppunit/TestSuite.cpp b/3rdParty/CppUnit/src/src/cppunit/TestSuite.cpp index 8dd2ea6..b5d6db3 100644 --- a/3rdParty/CppUnit/src/src/cppunit/TestSuite.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/TestSuite.cpp @@ -5,12 +5,13 @@ CPPUNIT_NS_BEGIN /// Default constructor TestSuite::TestSuite( std::string name ) : TestComposite( name ) + , m_tests() { } /// Destructor TestSuite::~TestSuite() @@ -36,13 +37,13 @@ void TestSuite::addTest( Test *test ) { m_tests.push_back( test ); } -const CppUnitVector<Test *> & +const std::vector<Test *> & TestSuite::getTests() const { return m_tests; } diff --git a/3rdParty/CppUnit/src/src/cppunit/TestSuiteBuilderContext.cpp b/3rdParty/CppUnit/src/src/cppunit/TestSuiteBuilderContext.cpp index ff71b52..5e4347e 100644 --- a/3rdParty/CppUnit/src/src/cppunit/TestSuiteBuilderContext.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/TestSuiteBuilderContext.cpp @@ -10,12 +10,13 @@ TestSuiteBuilderContextBase::TestSuiteBuilderContextBase( TestSuite &suite, const TestNamer &namer, TestFixtureFactory &factory ) : m_suite( suite ) , m_namer( namer ) , m_factory( factory ) + , m_properties() { } TestSuiteBuilderContextBase::~TestSuiteBuilderContextBase() { diff --git a/3rdParty/CppUnit/src/src/cppunit/TextTestProgressListener.cpp b/3rdParty/CppUnit/src/src/cppunit/TextTestProgressListener.cpp index 5bbe768..ea4fb17 100644 --- a/3rdParty/CppUnit/src/src/cppunit/TextTestProgressListener.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/TextTestProgressListener.cpp @@ -17,19 +17,21 @@ TextTestProgressListener::~TextTestProgressListener() void TextTestProgressListener::startTest( Test * ) { stdCOut() << "."; + stdCOut().flush(); } void TextTestProgressListener::addFailure( const TestFailure &failure ) { stdCOut() << ( failure.isError() ? "E" : "F" ); + stdCOut().flush(); } void TextTestProgressListener::endTestRun( Test *, TestResult * ) diff --git a/3rdParty/CppUnit/src/src/cppunit/TypeInfoHelper.cpp b/3rdParty/CppUnit/src/src/cppunit/TypeInfoHelper.cpp index 2febac6..aa24a80 100644 --- a/3rdParty/CppUnit/src/src/cppunit/TypeInfoHelper.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/TypeInfoHelper.cpp @@ -1,34 +1,42 @@ #include <cppunit/Portability.h> #include <cppunit/extensions/TypeInfoHelper.h> -#include <stdlib.h> - -#if CPPUNIT_HAVE_RTTI #include <string> #if CPPUNIT_HAVE_GCC_ABI_DEMANGLE +#include <cstdlib> #include <cxxabi.h> #endif CPPUNIT_NS_BEGIN - std::string TypeInfoHelper::getClassName( const std::type_info &info ) { #if defined(CPPUNIT_HAVE_GCC_ABI_DEMANGLE) && CPPUNIT_HAVE_GCC_ABI_DEMANGLE int status = 0; char* c_name = 0; - c_name = abi::__cxa_demangle( info.name(), 0, 0, &status ); - - std::string name( c_name ); - free( c_name ); + const char* c_origName = info.name(); + if(c_origName[0] == '*') + ++c_origName; + c_name = abi::__cxa_demangle( c_origName, 0, 0, &status ); + + std::string name; + if(c_name) + { + name = std::string( c_name ); + free( c_name ); + } + else + { + name = std::string( c_origName ); + } #else // CPPUNIT_HAVE_GCC_ABI_DEMANGLE static std::string classPrefix( "class " ); std::string name( info.name() ); @@ -45,10 +53,7 @@ TypeInfoHelper::getClassName( const std::type_info &info ) #endif // CPPUNIT_HAVE_GCC_ABI_DEMANGLE return name; } - CPPUNIT_NS_END - -#endif // CPPUNIT_HAVE_RTTI diff --git a/3rdParty/CppUnit/src/src/cppunit/XmlDocument.cpp b/3rdParty/CppUnit/src/src/cppunit/XmlDocument.cpp index 31f9115..4b09769 100644 --- a/3rdParty/CppUnit/src/src/cppunit/XmlDocument.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/XmlDocument.cpp @@ -2,23 +2,21 @@ #include <cppunit/tools/XmlDocument.h> #include <cppunit/tools/XmlElement.h> CPPUNIT_NS_BEGIN - XmlDocument::XmlDocument( const std::string &encoding, const std::string &styleSheet ) : m_styleSheet( styleSheet ) , m_rootElement( new XmlElement( "DummyRoot" ) ) , m_standalone( true ) { setEncoding( encoding ); } - XmlDocument::~XmlDocument() { delete m_rootElement; } diff --git a/3rdParty/CppUnit/src/src/cppunit/XmlElement.cpp b/3rdParty/CppUnit/src/src/cppunit/XmlElement.cpp index f930ad4..b16d2fe 100644 --- a/3rdParty/CppUnit/src/src/cppunit/XmlElement.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/XmlElement.cpp @@ -7,19 +7,24 @@ CPPUNIT_NS_BEGIN XmlElement::XmlElement( std::string elementName, std::string content ) : m_name( elementName ) , m_content( content ) + , m_attributes() + , m_elements() { } XmlElement::XmlElement( std::string elementName, int numericContent ) : m_name( elementName ) + , m_content() + , m_attributes() + , m_elements() { setContent( numericContent ); } XmlElement::~XmlElement() diff --git a/3rdParty/CppUnit/src/src/cppunit/XmlOutputter.cpp b/3rdParty/CppUnit/src/src/cppunit/XmlOutputter.cpp index c605e33..e1cb690 100644 --- a/3rdParty/CppUnit/src/src/cppunit/XmlOutputter.cpp +++ b/3rdParty/CppUnit/src/src/cppunit/XmlOutputter.cpp @@ -12,16 +12,19 @@ CPPUNIT_NS_BEGIN XmlOutputter::XmlOutputter( TestResultCollector *result, OStream &stream, - std::string encoding ) + const std::string& encoding ) : m_result( result ) , m_stream( stream ) + , m_encoding( encoding ) + , m_styleSheet() , m_xml( new XmlDocument( encoding ) ) + , m_hooks() { } XmlOutputter::~XmlOutputter() { |
Swift