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 @@ -4,3 +4,3 @@ 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 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 @@ -44,2 +44,9 @@ class Message; */ + +#if defined __GNUC__ +# define NORETURN __attribute__((noreturn)) +#else +# define NORETURN +#endif + struct Asserter @@ -48,3 +55,3 @@ struct Asserter */ - static void CPPUNIT_API fail( const Message &message, + NORETURN static void CPPUNIT_API fail( const Message &message, const SourceLine &sourceLine = SourceLine() ); @@ -54,3 +61,3 @@ struct Asserter */ - static void CPPUNIT_API fail( std::string message, + NORETURN static void CPPUNIT_API fail( std::string message, const SourceLine &sourceLine = SourceLine() ); @@ -78,3 +85,3 @@ struct Asserter - /*! \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 @@ -85,2 +92,3 @@ struct Asserter * \return \a expectedValue prefixed with "Expected: ". + * \deprecated Use makeExpectedEqual instead * \see makeActual(). @@ -88,2 +96,40 @@ struct Asserter 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 ); @@ -100,2 +146,5 @@ struct Asserter + /*! + * \deprecated Use makeMessage instead + */ static Message CPPUNIT_API makeNotEqualMessage( const std::string &expectedValue, @@ -105,2 +154,7 @@ struct Asserter + 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. @@ -113,3 +167,3 @@ struct Asserter */ - static void CPPUNIT_API failNotEqual( std::string expected, + NORETURN static void CPPUNIT_API failNotEqual( std::string expected, std::string actual, @@ -120,2 +174,57 @@ struct Asserter /*! \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 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 @@ -10,3 +10,3 @@ -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> #include <string> @@ -17,6 +17,2 @@ CPPUNIT_NS_BEGIN -#if CPPUNIT_NEED_DLL_DECL -// template class CPPUNIT_API std::deque<std::string>; -#endif - /*! \brief Message associated to an Exception. @@ -40,3 +36,3 @@ class CPPUNIT_API Message public: - Message(); + Message() {}; @@ -59,2 +55,4 @@ public: + virtual ~Message(); + Message &operator =( const Message &other ); @@ -143,3 +141,3 @@ private: - typedef CppUnitDeque<std::string> Details; + typedef std::deque<std::string> Details; Details m_details; 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 @@ -22,3 +22,3 @@ #ifndef CPPUNIT_VERSION -#define CPPUNIT_VERSION "1.12.0" +#define CPPUNIT_VERSION "1.14.0" #endif @@ -63,16 +63,2 @@ -/* 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 @@ -164,2 +150,8 @@ +/// \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. @@ -168,3 +160,3 @@ */ -#define CPPUNIT_MAKE_UNIQUE_NAME( prefix ) CPPUNIT_JOIN( prefix, __LINE__ ) +#define CPPUNIT_MAKE_UNIQUE_NAME( prefix ) CPPUNIT_JOIN( prefix, CPPUNIT_UNIQUE_COUNTER ) 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 @@ -86,2 +86,4 @@ public: private: + ProtectorGuard( const ProtectorGuard& ); /* not copyable */ + ProtectorGuard& operator=( const ProtectorGuard& ); /* not assignable */ TestResult *m_result; 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 @@ -52,5 +52,5 @@ protected: ExclusiveZone( SynchronizationObject *syncObject ) - : m_syncObject( syncObject ) + : m_syncObject( syncObject ) { - m_syncObject->lock(); + m_syncObject->lock(); } @@ -59,4 +59,10 @@ protected: { - 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& ); }; 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 @@ -7,2 +7,3 @@ #include <cppunit/portability/Stream.h> +#include <cppunit/tools/StringHelper.h> #include <stdio.h> @@ -10,7 +11,12 @@ +// 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. * @@ -26,3 +32,13 @@ CPPUNIT_NS_BEGIN * } - * + * + * 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 ) @@ -45,7 +61,15 @@ struct assertion_traits + 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); } @@ -53,3 +77,2 @@ struct assertion_traits - /*! \brief Traits used by CPPUNIT_ASSERT_DOUBLES_EQUAL(). @@ -70,2 +93,12 @@ struct assertion_traits<double> + 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 ) @@ -120,2 +153,78 @@ void CPPUNIT_API assertDoubleEquals( double expected, +/*! \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 @@ -219,2 +328,105 @@ void CPPUNIT_API assertDoubleEquals( double expected, +/** 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. @@ -265,3 +477,3 @@ void CPPUNIT_API assertDoubleEquals( double expected, // implementation detail -#if CPPUNIT_USE_TYPEINFO_NAME +#if defined(CPPUNIT_USE_TYPEINFO_NAME) #define CPPUNIT_EXTRACT_EXCEPTION_TYPE_( exception, no_rtti_message ) \ 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 @@ -6,4 +6,6 @@ +#include <functional> -#if CPPUNIT_USE_TYPEINFO_NAME + +#if defined(CPPUNIT_USE_TYPEINFO_NAME) # include <cppunit/extensions/TypeInfoHelper.h> @@ -35,3 +37,3 @@ struct ExpectedExceptionTraits { -#if CPPUNIT_USE_TYPEINFO_NAME +#if defined(CPPUNIT_USE_TYPEINFO_NAME) throw Exception( Message( @@ -118,3 +120,3 @@ public: m_fixture( new Fixture() ), - m_test( test ) + m_test_function( std::bind(test, m_fixture) ) { @@ -135,3 +137,3 @@ public: m_fixture( &fixture ), - m_test( test ) + m_test_function( std::bind(test, &fixture) ) { @@ -152,5 +154,13 @@ public: 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) + { + } @@ -164,10 +174,3 @@ public: { -// try { - (m_fixture->*m_test)(); -// } -// catch ( ExpectedException & ) { -// return; -// } - -// ExpectedExceptionTraits<ExpectedException>::expectedException(); + m_test_function(); } @@ -196,3 +199,3 @@ private: Fixture *m_fixture; - TestMethod m_test; + std::function<void()> m_test_function; }; 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 @@ -10,3 +10,3 @@ -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> #include <string> @@ -18,7 +18,2 @@ 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. @@ -176,3 +171,3 @@ protected: /// A list of test names. - typedef CppUnitDeque<std::string> PathTestNames; + typedef std::deque<std::string> PathTestNames; @@ -201,3 +196,3 @@ protected: protected: - typedef CppUnitDeque<Test *> Tests; + typedef std::deque<Test *> Tests; Tests m_tests; 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 @@ -11,3 +11,3 @@ #include <cppunit/SynchronizedObject.h> -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> #include <string> @@ -26,6 +26,2 @@ class TestListener; -#if CPPUNIT_NEED_DLL_DECL -// template class CPPUNIT_API std::deque<TestListener *>; -#endif - /*! \brief Manages TestListener. @@ -135,3 +131,3 @@ protected: protected: - typedef CppUnitDeque<TestListener *> TestListeners; + typedef std::deque<TestListener *> TestListeners; TestListeners m_listeners; 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 @@ -11,3 +11,3 @@ #include <cppunit/TestSuccessListener.h> -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> @@ -16,7 +16,2 @@ CPPUNIT_NS_BEGIN -#if CPPUNIT_NEED_DLL_DECL -// template class CPPUNIT_API std::deque<TestFailure *>; -// template class CPPUNIT_API std::deque<Test *>; -#endif - @@ -38,4 +33,4 @@ 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; 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 @@ -11,3 +11,3 @@ #include <cppunit/TestComposite.h> -#include <cppunit/portability/CppUnitVector.h> +#include <vector> @@ -58,3 +58,3 @@ public: */ - const CppUnitVector<Test *> &getTests() const; + const std::vector<Test *> &getTests() const; @@ -69,3 +69,3 @@ public: private: - CppUnitVector<Test *> m_tests; + std::vector<Test *> m_tests; }; 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 @@ -28,2 +28,4 @@ public: virtual void print( OStream &stream ); + + using TestResult::addFailure; }; 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 @@ -11,4 +11,4 @@ #include <cppunit/Outputter.h> -#include <cppunit/portability/CppUnitDeque.h> -#include <cppunit/portability/CppUnitMap.h> +#include <deque> +#include <map> #include <cppunit/portability/Stream.h> @@ -48,3 +48,3 @@ public: OStream &stream, - std::string encoding = std::string("ISO-8859-1") ); + const std::string& encoding = std::string("ISO-8859-1") ); @@ -87,3 +87,3 @@ public: - typedef CppUnitMap<Test *,TestFailure*, std::less<Test*> > FailedTests; + typedef std::map<Test *,TestFailure*, std::less<Test*> > FailedTests; @@ -139,3 +139,3 @@ protected: protected: - typedef CppUnitDeque<XmlOutputterHook *> Hooks; + typedef std::deque<XmlOutputterHook *> Hooks; 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 @@ -17,5 +17,2 @@ * - * CPPUNIT_HAVE_BEOS_DLL_LOADER - * If defined, BeOs implementation of DynamicLibraryManager will be used. - * * CPPUNIT_HAVE_UNIX_DLL_LOADER @@ -52,6 +49,2 @@ -// Is BeOS platform ? -#elif defined(__BEOS__) -#define CPPUNIT_HAVE_BEOS_DLL_LOADER 1 - // Is Unix platform and have shl_load() (hp-ux) 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 @@ -32,16 +32,2 @@ -/* 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 @@ -75,7 +61,8 @@ // 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 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 @@ -78,3 +78,3 @@ public: // expected exception type is Exception (expecting assertion failure). -#if CPPUNIT_USE_TYPEINFO_NAME +#if defined(CPPUNIT_USE_TYPEINFO_NAME) throw Exception( Message( @@ -94,3 +94,3 @@ private: */ - virtual void checkException( ExpectedExceptionType &e ) + virtual void checkException( ExpectedExceptionType & ) { 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 @@ -168,2 +168,3 @@ \ +public: \ static CPPUNIT_NS::TestSuite *suite() \ @@ -171,6 +172,6 @@ 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, \ @@ -178,3 +179,3 @@ TestFixtureType::addTestsToSuite( context ); \ - return suite.release(); \ + return guard.release(); \ } \ @@ -302,2 +303,13 @@ +#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. @@ -310,3 +322,3 @@ * CPPUNIT_TEST_SUITE( MyTest ); - * CPPUNIT_TEST_EXCEPTION( testVectorAtThrow, std::invalid_argument ); + * CPPUNIT_TEST_EXCEPTION( testVectorAtThrow, std::out_of_range ); * CPPUNIT_TEST_SUITE_END(); @@ -316,3 +328,3 @@ * std::vector<int> v; - * v.at( 1 ); // must throw exception std::invalid_argument + * v.at( 1 ); // must throw exception std::out_of_range * } 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 @@ -15,3 +15,3 @@ CPPUNIT_NS_BEGIN * - * Does not assume ownership of the test it decorates + * Assumes ownership of the test it decorates */ @@ -33,2 +33,9 @@ protected: TestCase *m_test; + +private: + + //prevent the creation of copy c'tor and operator= + TestCaseDecorator( const TestCaseDecorator& ); + TestCaseDecorator& operator=( const TestCaseDecorator& ); + }; 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 @@ -10,3 +10,3 @@ -#include <cppunit/portability/CppUnitSet.h> +#include <set> #include <cppunit/extensions/TestFactory.h> @@ -19,7 +19,2 @@ class TestSuite; -#if CPPUNIT_NEED_DLL_DECL -// template class CPPUNIT_API std::set<TestFactory *>; -#endif - - /*! \brief Registry for TestFactory. @@ -167,3 +162,3 @@ private: private: - typedef CppUnitSet<TestFactory *, std::less<TestFactory*> > Factories; + typedef std::set<TestFactory *, std::less<TestFactory*> > Factories; Factories m_factories; 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 @@ -5,6 +5,5 @@ #include <string> +#include <cppunit/tools/StringHelper.h> -#if CPPUNIT_HAVE_RTTI -# include <typeinfo> -#endif +#include <typeinfo> @@ -15,6 +14,3 @@ * - * 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 * @@ -31,11 +27,4 @@ */ -#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 - - @@ -43,3 +32,2 @@ CPPUNIT_NS_BEGIN - /*! \brief Names a test or a fixture suite. @@ -52,3 +40,2 @@ class CPPUNIT_API TestNamer public: -#if CPPUNIT_HAVE_RTTI /*! \brief Constructs a namer using the fixture's type-info. @@ -57,3 +44,2 @@ public: TestNamer( const std::type_info &typeInfo ); -#endif @@ -80,2 +66,8 @@ public: + 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: @@ -84,3 +76,2 @@ protected: - CPPUNIT_NS_END 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 @@ -4,3 +4,3 @@ #include <cppunit/Portability.h> -#include <cppunit/portability/CppUnitMap.h> +#include <map> #include <string> @@ -64,2 +64,17 @@ public: + /*! \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. @@ -83,3 +98,3 @@ protected: typedef std::pair<std::string,std::string> Property; - typedef CppUnitVector<Property> Properties; + typedef std::vector<Property> Properties; 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 @@ -5,4 +5,2 @@ -#if CPPUNIT_HAVE_RTTI - #include <typeinfo> @@ -12,3 +10,2 @@ CPPUNIT_NS_BEGIN - /**! \brief Helper to use type_info. @@ -27,7 +24,4 @@ CPPUNIT_NS_BEGIN - 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 @@ -5,3 +5,3 @@ #include <string> -#include <cppunit/portability/CppUnitVector.h> +#include <vector> @@ -16,3 +16,3 @@ struct StringTools - typedef CppUnitVector<std::string> Strings; + typedef std::vector<std::string> Strings; 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 @@ -10,3 +10,3 @@ -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> #include <string> @@ -133,6 +133,6 @@ private: - 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/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 @@ -88,2 +88,8 @@ protected: +private: + // prohibit copying + TextTestRunner( const TextTestRunner& ); + // prohibit copying + TextTestRunner& operator=( const TextTestRunner& ); + TestResultCollector *m_result; 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 @@ -8,2 +8,3 @@ CPPUNIT_NS_BEGIN +// coverity[+kill] void @@ -15,3 +16,3 @@ Asserter::fail( std::string message, - +// coverity[+kill] void @@ -42,3 +43,2 @@ Asserter::failIf( bool shouldFail, - std::string @@ -49,2 +49,31 @@ Asserter::makeExpected( const std::string &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; +} @@ -57,2 +86,17 @@ Asserter::makeActual( const std::string &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 @@ -63,8 +107,3 @@ Asserter::makeNotEqualMessage( const std::string &expectedValue, { - Message message( shortDescription, - makeExpected( expectedValue ), - makeActual( actualValue ) ); - message.addDetail( additionalMessage ); - - return message; + return makeMessage(makeExpectedEqual(expectedValue), makeActual(actualValue), shortDescription, additionalMessage); } @@ -79,6 +118,21 @@ Asserter::failNotEqual( std::string expected, { - 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 ); @@ -88,2 +142,43 @@ Asserter::failNotEqual( std::string expected, 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, 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 @@ -39,3 +39,3 @@ BriefTestProgressListener::addFailure( const TestFailure &failure ) void -BriefTestProgressListener::endTest( Test *) +BriefTestProgressListener::endTest( Test * ) { 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 @@ -23,3 +23,3 @@ DefaultProtector::protect( const Functor &functor, std::string shortDescription( "uncaught exception of type " ); -#if CPPUNIT_USE_TYPEINFO_NAME +#if defined(CPPUNIT_USE_TYPEINFO_NAME) shortDescription += TypeInfoHelper::getClassName( typeid(e) ); 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 @@ -21,8 +21,8 @@ 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, @@ -31,2 +31,3 @@ Exception::Exception( const Message &message, , m_sourceLine( sourceLine ) + , m_whatMessage() { @@ -34,3 +35,2 @@ Exception::Exception( const Message &message, - #ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED 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 @@ -6,8 +6,5 @@ CPPUNIT_NS_BEGIN - -Message::Message() -{ -} - Message::Message( const Message &other ) + : m_shortDescription() + , m_details() { @@ -16,5 +13,5 @@ Message::Message( const Message &other ) - Message::Message( const std::string &shortDescription ) : m_shortDescription( shortDescription ) + , m_details() { @@ -26,2 +23,3 @@ Message::Message( const std::string &shortDescription, : m_shortDescription( shortDescription ) + , m_details() { @@ -35,2 +33,3 @@ Message::Message( const std::string &shortDescription, : m_shortDescription( shortDescription ) + , m_details() { @@ -45,2 +44,3 @@ Message::Message( const std::string &shortDescription, : m_shortDescription( shortDescription ) + , m_details() { @@ -49,2 +49,6 @@ Message::Message( const std::string &shortDescription, +Message::~Message() +{ +} + Message & 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 @@ -23,3 +23,3 @@ Protector::reportError( const ProtectorContext &context, { - std::auto_ptr<Exception> actualError( error.clone() ); + std::unique_ptr<Exception> actualError( error.clone() ); actualError->setMessage( actualMessage( actualError->message(), context ) ); @@ -44,3 +44,3 @@ Protector::reportFailure( const ProtectorContext &context, { - std::auto_ptr<Exception> actualFailure( failure.clone() ); + std::unique_ptr<Exception> actualFailure( failure.clone() ); actualFailure->setMessage( actualMessage( actualFailure->message(), context ) ); 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 @@ -23,2 +23,7 @@ public: private: + // disable copying + ProtectFunctor( const ProtectFunctor& ); + // disable copying + ProtectFunctor& operator=( const ProtectFunctor& ); + Protector *m_protector; @@ -28,2 +33,6 @@ private: +ProtectorChain::ProtectorChain() + : m_protectors(0) +{ +} 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 @@ -4,3 +4,3 @@ #include <cppunit/Protector.h> -#include <cppunit/portability/CppUnitDeque.h> +#include <deque> @@ -21,2 +21,4 @@ class CPPUNIT_API ProtectorChain : public Protector public: + ProtectorChain(); + ~ProtectorChain(); @@ -36,6 +38,6 @@ private: 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/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 @@ -28,2 +28,9 @@ public: +private: + /// disable copy construction + ProtectorContext( const ProtectorContext& ); + /// disable assignment + ProtectorContext& operator=(const ProtectorContext&); + +public: Test *m_test; 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 @@ -7,2 +7,3 @@ CPPUNIT_NS_BEGIN SourceLine::SourceLine() : + m_fileName(), m_lineNumber( -1 ) 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 @@ -7,3 +7,3 @@ -#if CPPUNIT_USE_TYPEINFO_NAME +#if defined(CPPUNIT_USE_TYPEINFO_NAME) # include <typeinfo> 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 @@ -2,3 +2,3 @@ #include <cppunit/extensions/TestFactoryRegistry.h> -#include <cppunit/portability/CppUnitMap.h> +#include <map> #include <cppunit/TestSuite.h> @@ -14,3 +14,3 @@ 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; @@ -52,2 +52,3 @@ public: TestFactoryRegistryList() + : m_registries() { @@ -85,2 +86,3 @@ public: TestFactoryRegistry::TestFactoryRegistry( std::string name ) : + m_factories(), m_name( name ) 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 @@ -2,15 +2,11 @@ #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 - @@ -21,3 +17,2 @@ TestNamer::TestNamer( const std::string &fixtureName ) - TestNamer::~TestNamer() @@ -26,3 +21,2 @@ TestNamer::~TestNamer() - std::string @@ -33,3 +27,2 @@ TestNamer::getFixtureName() const - std::string @@ -40,5 +33,2 @@ TestNamer::getTestNameFor( const std::string &testMethodName ) const - - - 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 @@ -10,2 +10,3 @@ CPPUNIT_NS_BEGIN TestPath::TestPath() + : m_tests() { @@ -15,2 +16,3 @@ TestPath::TestPath() TestPath::TestPath( Test *root ) + : m_tests() { @@ -23,2 +25,3 @@ TestPath::TestPath( const TestPath &other, int count ) + : m_tests() { @@ -44,2 +47,3 @@ TestPath::TestPath( Test *searchRoot, const std::string &pathAsString ) + : m_tests() { 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 @@ -5,2 +5,3 @@ #include <cppunit/tools/Algorithm.h> +#include <cppunit/portability/Stream.h> #include <algorithm> @@ -15,3 +16,4 @@ TestResult::TestResult( SynchronizationObject *syncObject ) : SynchronizedObject( syncObject ) - , m_protectorChain( new ProtectorChain() ) + , m_listeners() + , m_protectorChain( new ProtectorChain ) , m_stop( false ) @@ -24,2 +26,4 @@ TestResult::~TestResult() { + stdCOut().flush(); + stdCErr().flush(); delete m_protectorChain; 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 @@ -9,2 +9,5 @@ TestResultCollector::TestResultCollector( SynchronizationObject *syncObject ) : TestSuccessListener( syncObject ) + , m_tests() + , m_failures() + , m_testErrors(0) { 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 @@ -10,2 +10,3 @@ TestSuite::TestSuite( std::string name ) : TestComposite( name ) + , m_tests() { @@ -41,3 +42,3 @@ TestSuite::addTest( Test *test ) -const CppUnitVector<Test *> & +const std::vector<Test *> & TestSuite::getTests() const 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 @@ -15,2 +15,3 @@ TestSuiteBuilderContextBase::TestSuiteBuilderContextBase( , m_factory( factory ) + , m_properties() { 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 @@ -22,2 +22,3 @@ TextTestProgressListener::startTest( Test * ) stdCOut() << "."; + stdCOut().flush(); } @@ -29,2 +30,3 @@ TextTestProgressListener::addFailure( const TestFailure &failure ) stdCOut() << ( failure.isError() ? "E" : "F" ); + stdCOut().flush(); } 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 @@ -2,5 +2,2 @@ #include <cppunit/extensions/TypeInfoHelper.h> -#include <stdlib.h> - -#if CPPUNIT_HAVE_RTTI @@ -9,2 +6,3 @@ #if CPPUNIT_HAVE_GCC_ABI_DEMANGLE +#include <cstdlib> #include <cxxabi.h> @@ -15,3 +13,2 @@ CPPUNIT_NS_BEGIN - std::string @@ -24,6 +21,17 @@ TypeInfoHelper::getClassName( const std::type_info &info ) - 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 ); + } @@ -50,5 +58,2 @@ TypeInfoHelper::getClassName( const std::type_info &info ) - 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 @@ -7,3 +7,2 @@ CPPUNIT_NS_BEGIN - XmlDocument::XmlDocument( const std::string &encoding, @@ -17,3 +16,2 @@ XmlDocument::XmlDocument( const std::string &encoding, - XmlDocument::~XmlDocument() 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 @@ -12,2 +12,4 @@ XmlElement::XmlElement( std::string elementName, , m_content( content ) + , m_attributes() + , m_elements() { @@ -19,2 +21,5 @@ XmlElement::XmlElement( std::string elementName, : m_name( elementName ) + , m_content() + , m_attributes() + , m_elements() { 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 @@ -17,6 +17,9 @@ 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() { |