diff options
Diffstat (limited to '3rdParty/CppUnit/src/include')
31 files changed, 508 insertions, 421 deletions
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; |