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/include/cppunit | |
| 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/include/cppunit')
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 | |||
| @@ -42,17 +42,24 @@ class Message; | |||
| 42 | * CPPUNIT_SOURCELINE() ) | 42 | * CPPUNIT_SOURCELINE() ) |
| 43 | * \endcode | 43 | * \endcode |
| 44 | */ | 44 | */ |
| 45 | |||
| 46 | #if defined __GNUC__ | ||
| 47 | # define NORETURN __attribute__((noreturn)) | ||
| 48 | #else | ||
| 49 | # define NORETURN | ||
| 50 | #endif | ||
| 51 | |||
| 45 | struct Asserter | 52 | struct Asserter |
| 46 | { | 53 | { |
| 47 | /*! \brief Throws a Exception with the specified message and location. | 54 | /*! \brief Throws a Exception with the specified message and location. |
| 48 | */ | 55 | */ |
| 49 | static void CPPUNIT_API fail( const Message &message, | 56 | NORETURN static void CPPUNIT_API fail( const Message &message, |
| 50 | const SourceLine &sourceLine = SourceLine() ); | 57 | const SourceLine &sourceLine = SourceLine() ); |
| 51 | 58 | ||
| 52 | /*! \brief Throws a Exception with the specified message and location. | 59 | /*! \brief Throws a Exception with the specified message and location. |
| 53 | * \deprecated Use fail( Message, SourceLine ) instead. | 60 | * \deprecated Use fail( Message, SourceLine ) instead. |
| 54 | */ | 61 | */ |
| 55 | static void CPPUNIT_API fail( std::string message, | 62 | NORETURN static void CPPUNIT_API fail( std::string message, |
| 56 | const SourceLine &sourceLine = SourceLine() ); | 63 | const SourceLine &sourceLine = SourceLine() ); |
| 57 | 64 | ||
| 58 | /*! \brief Throws a Exception with the specified message and location. | 65 | /*! \brief Throws a Exception with the specified message and location. |
| @@ -76,16 +83,55 @@ struct Asserter | |||
| 76 | std::string message, | 83 | std::string message, |
| 77 | const SourceLine &sourceLine = SourceLine() ); | 84 | const SourceLine &sourceLine = SourceLine() ); |
| 78 | 85 | ||
| 79 | /*! \brief Returns a expected value string for a message. | 86 | /*! \brief Returns a expected value string for a message, case equal than |
| 80 | * Typically used to create 'not equal' message, or to check that a message | 87 | * Typically used to create 'not equal' message, or to check that a message |
| 81 | * contains the expected content when writing unit tests for your custom | 88 | * contains the expected content when writing unit tests for your custom |
| 82 | * assertions. | 89 | * assertions. |
| 83 | * | 90 | * |
| 84 | * \param expectedValue String that represents the expected value. | 91 | * \param expectedValue String that represents the expected value. |
| 85 | * \return \a expectedValue prefixed with "Expected: ". | 92 | * \return \a expectedValue prefixed with "Expected: ". |
| 93 | * \deprecated Use makeExpectedEqual instead | ||
| 86 | * \see makeActual(). | 94 | * \see makeActual(). |
| 87 | */ | 95 | */ |
| 88 | static std::string CPPUNIT_API makeExpected( const std::string &expectedValue ); | 96 | static std::string CPPUNIT_API makeExpected( const std::string &expectedValue ); |
| 97 | /*! \brief Returns a expected value string for a message, case equal than | ||
| 98 | * Typically used to create 'not equal' message, or to check that a message | ||
| 99 | * contains the expected content when writing unit tests for your custom | ||
| 100 | * assertions. | ||
| 101 | * | ||
| 102 | * \param expectedValue String that represents the expected value. | ||
| 103 | * \return \a expectedValue prefixed with "Expected: ". | ||
| 104 | * \see makeActual(). | ||
| 105 | */ | ||
| 106 | static std::string CPPUNIT_API makeExpectedEqual( const std::string &expectedValue ); | ||
| 107 | /*! \brief Returns a expected value string for a message, case less than. | ||
| 108 | * | ||
| 109 | * \param expectedValue String that represents the expected value. | ||
| 110 | * \return \a expectedValue prefixed with "Expected less than: ". | ||
| 111 | * \see makeExpectedEqual(). | ||
| 112 | */ | ||
| 113 | static std::string CPPUNIT_API makeExpectedLess( const std::string &expectedValue ); | ||
| 114 | /*! \brief Returns a expected value string for a message, case less or equal than. | ||
| 115 | * | ||
| 116 | * \param expectedValue String that represents the expected value. | ||
| 117 | * \return \a expectedValue prefixed with "Expected: ". | ||
| 118 | * \see makeExpectedEqual(). | ||
| 119 | */ | ||
| 120 | static std::string CPPUNIT_API makeExpectedLessEqual( const std::string &expectedValue ); | ||
| 121 | /*! \brief Returns a expected value string for a message, case greater than. | ||
| 122 | * | ||
| 123 | * \param expectedValue String that represents the expected value. | ||
| 124 | * \return \a expectedValue prefixed with "Expected: ". | ||
| 125 | * \see makeExpectedEqual(). | ||
| 126 | */ | ||
| 127 | static std::string CPPUNIT_API makeExpectedGreater( const std::string &expectedValue ); | ||
| 128 | /*! \brief Returns a expected value string for a message, greater or equal than. | ||
| 129 | * | ||
| 130 | * \param expectedValue String that represents the expected value. | ||
| 131 | * \return \a expectedValue prefixed with "Expected: ". | ||
| 132 | * \see makeExpectedEqual(). | ||
| 133 | */ | ||
| 134 | static std::string CPPUNIT_API makeExpectedGreaterEqual( const std::string &expectedValue ); | ||
| 89 | 135 | ||
| 90 | /*! \brief Returns an actual value string for a message. | 136 | /*! \brief Returns an actual value string for a message. |
| 91 | * Typically used to create 'not equal' message, or to check that a message | 137 | * Typically used to create 'not equal' message, or to check that a message |
| @@ -98,11 +144,19 @@ struct Asserter | |||
| 98 | */ | 144 | */ |
| 99 | static std::string CPPUNIT_API makeActual( const std::string &actualValue ); | 145 | static std::string CPPUNIT_API makeActual( const std::string &actualValue ); |
| 100 | 146 | ||
| 147 | /*! | ||
| 148 | * \deprecated Use makeMessage instead | ||
| 149 | */ | ||
| 101 | static Message CPPUNIT_API makeNotEqualMessage( const std::string &expectedValue, | 150 | static Message CPPUNIT_API makeNotEqualMessage( const std::string &expectedValue, |
| 102 | const std::string &actualValue, | 151 | const std::string &actualValue, |
| 103 | const AdditionalMessage &additionalMessage = AdditionalMessage(), | 152 | const AdditionalMessage &additionalMessage = AdditionalMessage(), |
| 104 | const std::string &shortDescription = "equality assertion failed"); | 153 | const std::string &shortDescription = "equality assertion failed"); |
| 105 | 154 | ||
| 155 | static Message CPPUNIT_API makeMessage( const std::string &expectedValue, | ||
| 156 | const std::string &actualValue, | ||
| 157 | const std::string &shortDescription, | ||
| 158 | const AdditionalMessage &additionalMessage = AdditionalMessage()); | ||
| 159 | |||
| 106 | /*! \brief Throws an Exception with the specified message and location. | 160 | /*! \brief Throws an Exception with the specified message and location. |
| 107 | * \param expected Text describing the expected value. | 161 | * \param expected Text describing the expected value. |
| 108 | * \param actual Text describing the actual value. | 162 | * \param actual Text describing the actual value. |
| @@ -111,13 +165,68 @@ struct Asserter | |||
| 111 | * what are the differences between the expected and actual value. | 165 | * what are the differences between the expected and actual value. |
| 112 | * \param shortDescription Short description for the failure message. | 166 | * \param shortDescription Short description for the failure message. |
| 113 | */ | 167 | */ |
| 114 | static void CPPUNIT_API failNotEqual( std::string expected, | 168 | NORETURN static void CPPUNIT_API failNotEqual( std::string expected, |
| 115 | std::string actual, | 169 | std::string actual, |
| 116 | const SourceLine &sourceLine, | 170 | const SourceLine &sourceLine, |
| 117 | const AdditionalMessage &additionalMessage = AdditionalMessage(), | 171 | const AdditionalMessage &additionalMessage = AdditionalMessage(), |
| 118 | std::string shortDescription = "equality assertion failed" ); | 172 | std::string shortDescription = "equality assertion failed" ); |
| 119 | 173 | ||
| 120 | /*! \brief Throws an Exception with the specified message and location. | 174 | /*! \brief Throws an Exception with the specified message and location. |
| 175 | * \param expected Text describing the expected value. | ||
| 176 | * \param actual Text describing the actual value. | ||
| 177 | * \param sourceLine Location of the assertion. | ||
| 178 | * \param additionalMessage Additional message. Usually used to report | ||
| 179 | * what are the differences between the expected and actual value. | ||
| 180 | * \param shortDescription Short description for the failure message. | ||
| 181 | */ | ||
| 182 | static void CPPUNIT_API failNotLess( std::string expected, | ||
| 183 | std::string actual, | ||
| 184 | const SourceLine &sourceLine, | ||
| 185 | const AdditionalMessage &additionalMessage = AdditionalMessage(), | ||
| 186 | std::string shortDescription = "less assertion failed" ); | ||
| 187 | |||
| 188 | /*! \brief Throws an Exception with the specified message and location. | ||
| 189 | * \param expected Text describing the expected value. | ||
| 190 | * \param actual Text describing the actual value. | ||
| 191 | * \param sourceLine Location of the assertion. | ||
| 192 | * \param additionalMessage Additional message. Usually used to report | ||
| 193 | * what are the differences between the expected and actual value. | ||
| 194 | * \param shortDescription Short description for the failure message. | ||
| 195 | */ | ||
| 196 | static void CPPUNIT_API failNotGreater( std::string expected, | ||
| 197 | std::string actual, | ||
| 198 | const SourceLine &sourceLine, | ||
| 199 | const AdditionalMessage &additionalMessage = AdditionalMessage(), | ||
| 200 | std::string shortDescription = "greater assertion failed" ); | ||
| 201 | |||
| 202 | /*! \brief Throws an Exception with the specified message and location. | ||
| 203 | * \param expected Text describing the expected value. | ||
| 204 | * \param actual Text describing the actual value. | ||
| 205 | * \param sourceLine Location of the assertion. | ||
| 206 | * \param additionalMessage Additional message. Usually used to report | ||
| 207 | * what are the differences between the expected and actual value. | ||
| 208 | * \param shortDescription Short description for the failure message. | ||
| 209 | */ | ||
| 210 | static void CPPUNIT_API failNotLessEqual( std::string expected, | ||
| 211 | std::string actual, | ||
| 212 | const SourceLine &sourceLine, | ||
| 213 | const AdditionalMessage &additionalMessage = AdditionalMessage(), | ||
| 214 | std::string shortDescription = "less equal assertion failed" ); | ||
| 215 | |||
| 216 | /*! \brief Throws an Exception with the specified message and location. | ||
| 217 | * \param expected Text describing the expected value. | ||
| 218 | * \param actual Text describing the actual value. | ||
| 219 | * \param sourceLine Location of the assertion. | ||
| 220 | * \param additionalMessage Additional message. Usually used to report | ||
| 221 | * what are the differences between the expected and actual value. | ||
| 222 | * \param shortDescription Short description for the failure message. | ||
| 223 | */ | ||
| 224 | static void CPPUNIT_API failNotGreaterEqual( std::string expected, | ||
| 225 | std::string actual, | ||
| 226 | const SourceLine &sourceLine, | ||
| 227 | const AdditionalMessage &additionalMessage = AdditionalMessage(), | ||
| 228 | std::string shortDescription = "greater equal assertion failed" ); /*! \brief Throws an Exception with the specified message and location. | ||
| 229 | |||
| 121 | * \param shouldFail if \c true then the exception is thrown. Otherwise | 230 | * \param shouldFail if \c true then the exception is thrown. Otherwise |
| 122 | * nothing happen. | 231 | * nothing happen. |
| 123 | * \param expected Text describing the expected value. | 232 | * \param expected Text describing the expected value. |
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 | |||
| @@ -8,17 +8,13 @@ | |||
| 8 | #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z | 8 | #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z |
| 9 | #endif | 9 | #endif |
| 10 | 10 | ||
| 11 | #include <cppunit/portability/CppUnitDeque.h> | 11 | #include <deque> |
| 12 | #include <string> | 12 | #include <string> |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | CPPUNIT_NS_BEGIN | 15 | CPPUNIT_NS_BEGIN |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | #if CPPUNIT_NEED_DLL_DECL | ||
| 19 | // template class CPPUNIT_API std::deque<std::string>; | ||
| 20 | #endif | ||
| 21 | |||
| 22 | /*! \brief Message associated to an Exception. | 18 | /*! \brief Message associated to an Exception. |
| 23 | * \ingroup CreatingNewAssertions | 19 | * \ingroup CreatingNewAssertions |
| 24 | * A message is composed of two items: | 20 | * A message is composed of two items: |
| @@ -38,7 +34,7 @@ CPPUNIT_NS_BEGIN | |||
| 38 | class CPPUNIT_API Message | 34 | class CPPUNIT_API Message |
| 39 | { | 35 | { |
| 40 | public: | 36 | public: |
| 41 | Message(); | 37 | Message() {}; |
| 42 | 38 | ||
| 43 | // Ensure thread-safe copy by detaching the string. | 39 | // Ensure thread-safe copy by detaching the string. |
| 44 | Message( const Message &other ); | 40 | Message( const Message &other ); |
| @@ -57,6 +53,8 @@ public: | |||
| 57 | const std::string &detail2, | 53 | const std::string &detail2, |
| 58 | const std::string &detail3 ); | 54 | const std::string &detail3 ); |
| 59 | 55 | ||
| 56 | virtual ~Message(); | ||
| 57 | |||
| 60 | Message &operator =( const Message &other ); | 58 | Message &operator =( const Message &other ); |
| 61 | 59 | ||
| 62 | /*! \brief Returns the short description. | 60 | /*! \brief Returns the short description. |
| @@ -141,7 +139,7 @@ public: | |||
| 141 | private: | 139 | private: |
| 142 | std::string m_shortDescription; | 140 | std::string m_shortDescription; |
| 143 | 141 | ||
| 144 | typedef CppUnitDeque<std::string> Details; | 142 | typedef std::deque<std::string> Details; |
| 145 | Details m_details; | 143 | Details m_details; |
| 146 | }; | 144 | }; |
| 147 | 145 | ||
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 | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | // Version number of package | 21 | // Version number of package |
| 22 | #ifndef CPPUNIT_VERSION | 22 | #ifndef CPPUNIT_VERSION |
| 23 | #define CPPUNIT_VERSION "1.12.0" | 23 | #define CPPUNIT_VERSION "1.14.0" |
| 24 | #endif | 24 | #endif |
| 25 | 25 | ||
| 26 | #include <cppunit/config/CppUnitApi.h> // define CPPUNIT_API & CPPUNIT_NEED_DLL_DECL | 26 | #include <cppunit/config/CppUnitApi.h> // define CPPUNIT_API & CPPUNIT_NEED_DLL_DECL |
| @@ -61,20 +61,6 @@ | |||
| 61 | # endif // !defined(CPPUNIT_NO_STD_NAMESPACE) | 61 | # endif // !defined(CPPUNIT_NO_STD_NAMESPACE) |
| 62 | #endif // !defined(CPPUNIT_HAVE_NAMESPACES) | 62 | #endif // !defined(CPPUNIT_HAVE_NAMESPACES) |
| 63 | 63 | ||
| 64 | /* Define CPPUNIT_STD_NEED_ALLOCATOR to 1 if you need to specify | ||
| 65 | * the allocator you used when instantiating STL container. Typically | ||
| 66 | * used for compilers that do not support template default parameter. | ||
| 67 | * CPPUNIT_STD_ALLOCATOR will be used as the allocator. Default is | ||
| 68 | * std::allocator. On some compilers, you may need to change this to | ||
| 69 | * std::allocator<T>. | ||
| 70 | */ | ||
| 71 | #if CPPUNIT_STD_NEED_ALLOCATOR | ||
| 72 | # if !defined(CPPUNIT_STD_ALLOCATOR) | ||
| 73 | # define CPPUNIT_STD_ALLOCATOR std::allocator | ||
| 74 | # endif // !defined(CPPUNIT_STD_ALLOCATOR) | ||
| 75 | #endif // defined(CPPUNIT_STD_NEED_ALLOCATOR) | ||
| 76 | |||
| 77 | |||
| 78 | // Compiler error location format for CompilerOutputter | 64 | // Compiler error location format for CompilerOutputter |
| 79 | // If not define, assumes that it's gcc | 65 | // If not define, assumes that it's gcc |
| 80 | // See class CompilerOutputter for format. | 66 | // See class CompilerOutputter for format. |
| @@ -162,11 +148,17 @@ | |||
| 162 | /// \internal | 148 | /// \internal |
| 163 | #define _CPPUNIT_DO_JOIN2( symbol1, symbol2 ) symbol1##symbol2 | 149 | #define _CPPUNIT_DO_JOIN2( symbol1, symbol2 ) symbol1##symbol2 |
| 164 | 150 | ||
| 151 | /// \internal Unique suffix for variable name. Can be overridden in platform specific | ||
| 152 | /// config-*.h. Default to line number. | ||
| 153 | #ifndef CPPUNIT_UNIQUE_COUNTER | ||
| 154 | # define CPPUNIT_UNIQUE_COUNTER __LINE__ | ||
| 155 | #endif | ||
| 156 | |||
| 165 | /*! Adds the line number to the specified string to create a unique identifier. | 157 | /*! Adds the line number to the specified string to create a unique identifier. |
| 166 | * \param prefix Prefix added to the line number to create a unique identifier. | 158 | * \param prefix Prefix added to the line number to create a unique identifier. |
| 167 | * \see CPPUNIT_TEST_SUITE_REGISTRATION for an example of usage. | 159 | * \see CPPUNIT_TEST_SUITE_REGISTRATION for an example of usage. |
| 168 | */ | 160 | */ |
| 169 | #define CPPUNIT_MAKE_UNIQUE_NAME( prefix ) CPPUNIT_JOIN( prefix, __LINE__ ) | 161 | #define CPPUNIT_MAKE_UNIQUE_NAME( prefix ) CPPUNIT_JOIN( prefix, CPPUNIT_UNIQUE_COUNTER ) |
| 170 | 162 | ||
| 171 | /*! Defines wrap colunm for %CppUnit. Used by CompilerOuputter. | 163 | /*! Defines wrap colunm for %CppUnit. Used by CompilerOuputter. |
| 172 | */ | 164 | */ |
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 | |||
| @@ -84,6 +84,8 @@ public: | |||
| 84 | ~ProtectorGuard(); | 84 | ~ProtectorGuard(); |
| 85 | 85 | ||
| 86 | private: | 86 | private: |
| 87 | ProtectorGuard( const ProtectorGuard& ); /* not copyable */ | ||
| 88 | ProtectorGuard& operator=( const ProtectorGuard& ); /* not assignable */ | ||
| 87 | TestResult *m_result; | 89 | TestResult *m_result; |
| 88 | }; | 90 | }; |
| 89 | 91 | ||
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 | |||
| @@ -50,15 +50,21 @@ protected: | |||
| 50 | 50 | ||
| 51 | public: | 51 | public: |
| 52 | ExclusiveZone( SynchronizationObject *syncObject ) | 52 | ExclusiveZone( SynchronizationObject *syncObject ) |
| 53 | : m_syncObject( syncObject ) | 53 | : m_syncObject( syncObject ) |
| 54 | { | 54 | { |
| 55 | m_syncObject->lock(); | 55 | m_syncObject->lock(); |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | ~ExclusiveZone() | 58 | ~ExclusiveZone() |
| 59 | { | 59 | { |
| 60 | m_syncObject->unlock (); | 60 | m_syncObject->unlock (); |
| 61 | } | 61 | } |
| 62 | private: | ||
| 63 | /// Prevents the use of the copy constructor. | ||
| 64 | ExclusiveZone( const ExclusiveZone& ); | ||
| 65 | |||
| 66 | /// Prevents the use of the copy operator. | ||
| 67 | ExclusiveZone& operator=( const ExclusiveZone& ); | ||
| 62 | }; | 68 | }; |
| 63 | 69 | ||
| 64 | virtual void setSynchronizationObject( SynchronizationObject *syncObject ); | 70 | virtual void setSynchronizationObject( SynchronizationObject *syncObject ); |
diff --git a/3rdParty/CppUnit/src/include/cppunit/TestAssert.h b/3rdParty/CppUnit/src/include/cppunit/TestAssert.h index f74797b..bb29ac0 100644 --- a/3rdParty/CppUnit/src/include/cppunit/TestAssert.h +++ b/3rdParty/CppUnit/src/include/cppunit/TestAssert.h | |||
| @@ -5,14 +5,20 @@ | |||
| 5 | #include <cppunit/Exception.h> | 5 | #include <cppunit/Exception.h> |
| 6 | #include <cppunit/Asserter.h> | 6 | #include <cppunit/Asserter.h> |
| 7 | #include <cppunit/portability/Stream.h> | 7 | #include <cppunit/portability/Stream.h> |
| 8 | #include <cppunit/tools/StringHelper.h> | ||
| 8 | #include <stdio.h> | 9 | #include <stdio.h> |
| 9 | #include <float.h> // For struct assertion_traits<double> | 10 | #include <float.h> // For struct assertion_traits<double> |
| 10 | 11 | ||
| 12 | // Work around "passing 'T' chooses 'int' over 'unsigned int'" warnings when T | ||
| 13 | // is an enum type: | ||
| 14 | #if defined __GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)) | ||
| 15 | #pragma GCC system_header | ||
| 16 | #endif | ||
| 11 | 17 | ||
| 12 | CPPUNIT_NS_BEGIN | ||
| 13 | 18 | ||
| 19 | CPPUNIT_NS_BEGIN | ||
| 14 | 20 | ||
| 15 | /*! \brief Traits used by CPPUNIT_ASSERT_EQUAL(). | 21 | /*! \brief Traits used by CPPUNIT_ASSERT* macros. |
| 16 | * | 22 | * |
| 17 | * Here is an example of specialising these traits: | 23 | * Here is an example of specialising these traits: |
| 18 | * | 24 | * |
| @@ -24,7 +30,17 @@ CPPUNIT_NS_BEGIN | |||
| 24 | * { | 30 | * { |
| 25 | * return x == y; | 31 | * return x == y; |
| 26 | * } | 32 | * } |
| 27 | * | 33 | * |
| 34 | * static bool less( const std::string& x, const std::string& y ) | ||
| 35 | * { | ||
| 36 | * return x < y; | ||
| 37 | * } | ||
| 38 | * | ||
| 39 | * static bool lessEqual( const std::string& x, const std::string& y ) | ||
| 40 | * { | ||
| 41 | * return x <= y; | ||
| 42 | * } | ||
| 43 | * | ||
| 28 | * static std::string toString( const std::string& x ) | 44 | * static std::string toString( const std::string& x ) |
| 29 | * { | 45 | * { |
| 30 | * std::string text = '"' + x + '"'; // adds quote around the string to see whitespace | 46 | * std::string text = '"' + x + '"'; // adds quote around the string to see whitespace |
| @@ -43,15 +59,22 @@ struct assertion_traits | |||
| 43 | return x == y; | 59 | return x == y; |
| 44 | } | 60 | } |
| 45 | 61 | ||
| 62 | static bool less( const T& x, const T& y ) | ||
| 63 | { | ||
| 64 | return x < y; | ||
| 65 | } | ||
| 66 | |||
| 67 | static bool lessEqual( const T& x, const T& y ) | ||
| 68 | { | ||
| 69 | return x <= y; | ||
| 70 | } | ||
| 71 | |||
| 46 | static std::string toString( const T& x ) | 72 | static std::string toString( const T& x ) |
| 47 | { | 73 | { |
| 48 | OStringStream ost; | 74 | return CPPUNIT_NS::StringHelper::toString(x); |
| 49 | ost << x; | ||
| 50 | return ost.str(); | ||
| 51 | } | 75 | } |
| 52 | }; | 76 | }; |
| 53 | 77 | ||
| 54 | |||
| 55 | /*! \brief Traits used by CPPUNIT_ASSERT_DOUBLES_EQUAL(). | 78 | /*! \brief Traits used by CPPUNIT_ASSERT_DOUBLES_EQUAL(). |
| 56 | * | 79 | * |
| 57 | * This specialisation from @c struct @c assertion_traits<> ensures that | 80 | * This specialisation from @c struct @c assertion_traits<> ensures that |
| @@ -68,6 +91,16 @@ struct assertion_traits<double> | |||
| 68 | return x == y; | 91 | return x == y; |
| 69 | } | 92 | } |
| 70 | 93 | ||
| 94 | static bool less( double x, double y ) | ||
| 95 | { | ||
| 96 | return x < y; | ||
| 97 | } | ||
| 98 | |||
| 99 | static bool lessEqual( double x, double y ) | ||
| 100 | { | ||
| 101 | return x <= y; | ||
| 102 | } | ||
| 103 | |||
| 71 | static std::string toString( double x ) | 104 | static std::string toString( double x ) |
| 72 | { | 105 | { |
| 73 | #ifdef DBL_DIG | 106 | #ifdef DBL_DIG |
| @@ -118,6 +151,82 @@ void CPPUNIT_API assertDoubleEquals( double expected, | |||
| 118 | const std::string &message ); | 151 | const std::string &message ); |
| 119 | 152 | ||
| 120 | 153 | ||
| 154 | /*! \brief (Implementation) Asserts that an object is less than another one of the same type | ||
| 155 | * Use CPPUNIT_ASSERT_LESS, CPPUNIT_ASSERT_GREATER instead of this function. | ||
| 156 | * \sa assertion_traits, Asserter::failNotLess(). | ||
| 157 | */ | ||
| 158 | template <class T> | ||
| 159 | void assertLess( const T& expected, | ||
| 160 | const T& actual, | ||
| 161 | SourceLine sourceLine, | ||
| 162 | const std::string& message ) | ||
| 163 | { | ||
| 164 | if ( !assertion_traits<T>::less(actual,expected) ) | ||
| 165 | { | ||
| 166 | Asserter::failNotLess( assertion_traits<T>::toString(expected), | ||
| 167 | assertion_traits<T>::toString(actual), | ||
| 168 | sourceLine, | ||
| 169 | message ); | ||
| 170 | } | ||
| 171 | } | ||
| 172 | |||
| 173 | |||
| 174 | /*! \brief (Implementation) Asserts that an object is less than another one of the same type | ||
| 175 | * Use CPPUNIT_ASSERT_LESS, CPPUNIT_ASSERT_GREATER instead of this function. | ||
| 176 | * \sa assertion_traits, Asserter::failNotLess(). | ||
| 177 | */ | ||
| 178 | template <class T> | ||
| 179 | void assertGreater( const T& expected, | ||
| 180 | const T& actual, | ||
| 181 | SourceLine sourceLine, | ||
| 182 | const std::string& message ) | ||
| 183 | { | ||
| 184 | if ( !assertion_traits<T>::less(expected,actual) ) | ||
| 185 | { | ||
| 186 | Asserter::failNotGreater( assertion_traits<T>::toString(expected), | ||
| 187 | assertion_traits<T>::toString(actual), | ||
| 188 | sourceLine, | ||
| 189 | message ); | ||
| 190 | } | ||
| 191 | } | ||
| 192 | |||
| 193 | /*! \brief (Implementation) Asserts that two objects of the same type are equals. | ||
| 194 | * Use CPPUNIT_ASSERT_LESSEQUAL, CPPUNIT_ASSERT_GREATEREQUAL instead of this function. | ||
| 195 | * \sa assertion_traits, Asserter::failNotLessEqual(). | ||
| 196 | */ | ||
| 197 | template <class T> | ||
| 198 | void assertLessEqual( const T& expected, | ||
| 199 | const T& actual, | ||
| 200 | SourceLine sourceLine, | ||
| 201 | const std::string& message ) | ||
| 202 | { | ||
| 203 | if ( !assertion_traits<T>::lessEqual(actual,expected) ) | ||
| 204 | { | ||
| 205 | Asserter::failNotLessEqual( assertion_traits<T>::toString(expected), | ||
| 206 | assertion_traits<T>::toString(actual), | ||
| 207 | sourceLine, | ||
| 208 | message ); | ||
| 209 | } | ||
| 210 | } | ||
| 211 | |||
| 212 | /*! \brief (Implementation) Asserts that two objects of the same type are equals. | ||
| 213 | * Use CPPUNIT_ASSERT_LESSEQUAL, CPPUNIT_ASSERT_GREATEREQUAL instead of this function. | ||
| 214 | * \sa assertion_traits, Asserter::failNotLessEqual(). | ||
| 215 | */ | ||
| 216 | template <class T> | ||
| 217 | void assertGreaterEqual( const T& expected, | ||
| 218 | const T& actual, | ||
| 219 | SourceLine sourceLine, | ||
| 220 | const std::string& message ) | ||
| 221 | { | ||
| 222 | if ( !assertion_traits<T>::lessEqual(expected,actual) ) | ||
| 223 | { | ||
| 224 | Asserter::failNotGreaterEqual( assertion_traits<T>::toString(expected), | ||
| 225 | assertion_traits<T>::toString(actual), | ||
| 226 | sourceLine, | ||
| 227 | message ); | ||
| 228 | } | ||
| 229 | } | ||
| 121 | /* A set of macros which allow us to get the line number | 230 | /* A set of macros which allow us to get the line number |
| 122 | * and file name at the point of an error. | 231 | * and file name at the point of an error. |
| 123 | * Just goes to show that preprocessors do have some | 232 | * Just goes to show that preprocessors do have some |
| @@ -217,6 +326,109 @@ void CPPUNIT_API assertDoubleEquals( double expected, | |||
| 217 | (message) ) ) | 326 | (message) ) ) |
| 218 | #endif | 327 | #endif |
| 219 | 328 | ||
| 329 | /** Asserts that actual is less than expected, provides additional message on failure. | ||
| 330 | * \ingroup Assertions | ||
| 331 | * | ||
| 332 | * Less and string representation can be defined with | ||
| 333 | * an appropriate assertion_traits class. | ||
| 334 | * | ||
| 335 | * A diagnostic is printed if actual is less than expected. | ||
| 336 | * The message is printed in addition to the expected and actual value | ||
| 337 | * to provide additional information. | ||
| 338 | * | ||
| 339 | * Requirement for \a expected and \a actual parameters: | ||
| 340 | * - They are exactly of the same type | ||
| 341 | * - They are serializable into a std::strstream using operator <<. | ||
| 342 | * - They can be compared using operator <. | ||
| 343 | * | ||
| 344 | * The last two requirements (serialization and comparison) can be | ||
| 345 | * removed by specializing the CppUnit::assertion_traits. | ||
| 346 | * | ||
| 347 | * \sa CPPUNIT_ASSERT_GREATER | ||
| 348 | */ | ||
| 349 | #define CPPUNIT_ASSERT_LESS(expected, actual) \ | ||
| 350 | ( CPPUNIT_NS::assertLess( (expected), \ | ||
| 351 | (actual), \ | ||
| 352 | CPPUNIT_SOURCELINE(), \ | ||
| 353 | "" ) ) | ||
| 354 | |||
| 355 | /** Asserts that actual is greater than expected, provides additional message on failure. | ||
| 356 | * \ingroup Assertions | ||
| 357 | * | ||
| 358 | * String representation can be defined with | ||
| 359 | * an appropriate assertion_traits class. For comparison assertLess is used. | ||
| 360 | * | ||
| 361 | * A diagnostic is printed if actual is less than expected. | ||
| 362 | * The message is printed in addition to the expected and actual value | ||
| 363 | * to provide additional information. | ||
| 364 | * | ||
| 365 | * Requirement for \a expected and \a actual parameters: | ||
| 366 | * - They are exactly of the same type | ||
| 367 | * - They are serializable into a std::strstream using operator <<. | ||
| 368 | * - They can be compared using operator<. | ||
| 369 | * | ||
| 370 | * The last two requirements (serialization and comparison) can be | ||
| 371 | * removed by specializing the CppUnit::assertion_traits. | ||
| 372 | * | ||
| 373 | * \sa CPPUNIT_ASSERT_LESS | ||
| 374 | */ | ||
| 375 | #define CPPUNIT_ASSERT_GREATER(expected, actual) \ | ||
| 376 | ( CPPUNIT_NS::assertGreater( (expected), \ | ||
| 377 | (actual), \ | ||
| 378 | CPPUNIT_SOURCELINE(), \ | ||
| 379 | "" ) ) | ||
| 380 | |||
| 381 | /** Asserts that actual is less or equal than expected, provides additional message on failure. | ||
| 382 | * \ingroup Assertions | ||
| 383 | * | ||
| 384 | * LessEqual and string representation can be defined with | ||
| 385 | * an appropriate assertion_traits class. | ||
| 386 | * | ||
| 387 | * A diagnostic is printed if actual is greater than expected. | ||
| 388 | * The message is printed in addition to the expected and actual value | ||
| 389 | * to provide additional information. | ||
| 390 | * | ||
| 391 | * Requirement for \a expected and \a actual parameters: | ||
| 392 | * - They are exactly of the same type | ||
| 393 | * - They are serializable into a std::strstream using operator <<. | ||
| 394 | * - They can be compared using operator <=. | ||
| 395 | * | ||
| 396 | * The last two requirements (serialization and comparison) can be | ||
| 397 | * removed by specializing the CppUnit::assertion_traits. | ||
| 398 | * | ||
| 399 | * \sa CPPUNIT_ASSERT_GREATEREQUAL | ||
| 400 | */ | ||
| 401 | #define CPPUNIT_ASSERT_LESSEQUAL(expected, actual) \ | ||
| 402 | ( CPPUNIT_NS::assertLessEqual( (expected), \ | ||
| 403 | (actual), \ | ||
| 404 | CPPUNIT_SOURCELINE(), \ | ||
| 405 | "" ) ) | ||
| 406 | |||
| 407 | /** Asserts that actual is greater than expected, provides additional message on failure. | ||
| 408 | * \ingroup Assertions | ||
| 409 | * | ||
| 410 | * String representation can be defined with | ||
| 411 | * an appropriate assertion_traits class. For comparison assertLess is used. | ||
| 412 | * | ||
| 413 | * A diagnostic is printed if actual is less than expected. | ||
| 414 | * The message is printed in addition to the expected and actual value | ||
| 415 | * to provide additional information. | ||
| 416 | * | ||
| 417 | * Requirement for \a expected and \a actual parameters: | ||
| 418 | * - They are exactly of the same type | ||
| 419 | * - They are serializable into a std::strstream using operator <<. | ||
| 420 | * - They can be compared using operator<=. | ||
| 421 | * | ||
| 422 | * The last two requirements (serialization and comparison) can be | ||
| 423 | * removed by specializing the CppUnit::assertion_traits. | ||
| 424 | * | ||
| 425 | * \sa CPPUNIT_ASSERT_LESSEQUAL | ||
| 426 | */ | ||
| 427 | #define CPPUNIT_ASSERT_GREATEREQUAL(expected, actual) \ | ||
| 428 | ( CPPUNIT_NS::assertGreaterEqual( (expected), \ | ||
| 429 | (actual), \ | ||
| 430 | CPPUNIT_SOURCELINE(), \ | ||
| 431 | "" ) ) | ||
| 220 | /*! \brief Macro for primitive double value comparisons. | 432 | /*! \brief Macro for primitive double value comparisons. |
| 221 | * \ingroup Assertions | 433 | * \ingroup Assertions |
| 222 | * | 434 | * |
| @@ -263,7 +475,7 @@ void CPPUNIT_API assertDoubleEquals( double expected, | |||
| 263 | 475 | ||
| 264 | 476 | ||
| 265 | // implementation detail | 477 | // implementation detail |
| 266 | #if CPPUNIT_USE_TYPEINFO_NAME | 478 | #if defined(CPPUNIT_USE_TYPEINFO_NAME) |
| 267 | #define CPPUNIT_EXTRACT_EXCEPTION_TYPE_( exception, no_rtti_message ) \ | 479 | #define CPPUNIT_EXTRACT_EXCEPTION_TYPE_( exception, no_rtti_message ) \ |
| 268 | CPPUNIT_NS::TypeInfoHelper::getClassName( typeid(exception) ) | 480 | CPPUNIT_NS::TypeInfoHelper::getClassName( typeid(exception) ) |
| 269 | #else | 481 | #else |
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 | |||
| @@ -4,8 +4,10 @@ | |||
| 4 | #include <cppunit/Exception.h> | 4 | #include <cppunit/Exception.h> |
| 5 | #include <cppunit/TestCase.h> | 5 | #include <cppunit/TestCase.h> |
| 6 | 6 | ||
| 7 | #include <functional> | ||
| 7 | 8 | ||
| 8 | #if CPPUNIT_USE_TYPEINFO_NAME | 9 | |
| 10 | #if defined(CPPUNIT_USE_TYPEINFO_NAME) | ||
| 9 | # include <cppunit/extensions/TypeInfoHelper.h> | 11 | # include <cppunit/extensions/TypeInfoHelper.h> |
| 10 | #endif | 12 | #endif |
| 11 | 13 | ||
| @@ -33,7 +35,7 @@ struct ExpectedExceptionTraits | |||
| 33 | { | 35 | { |
| 34 | static void expectedException() | 36 | static void expectedException() |
| 35 | { | 37 | { |
| 36 | #if CPPUNIT_USE_TYPEINFO_NAME | 38 | #if defined(CPPUNIT_USE_TYPEINFO_NAME) |
| 37 | throw Exception( Message( | 39 | throw Exception( Message( |
| 38 | "expected exception not thrown", | 40 | "expected exception not thrown", |
| 39 | "Expected exception type: " + | 41 | "Expected exception type: " + |
| @@ -116,7 +118,7 @@ public: | |||
| 116 | TestCase( name ), | 118 | TestCase( name ), |
| 117 | m_ownFixture( true ), | 119 | m_ownFixture( true ), |
| 118 | m_fixture( new Fixture() ), | 120 | m_fixture( new Fixture() ), |
| 119 | m_test( test ) | 121 | m_test_function( std::bind(test, m_fixture) ) |
| 120 | { | 122 | { |
| 121 | } | 123 | } |
| 122 | 124 | ||
| @@ -133,7 +135,7 @@ public: | |||
| 133 | TestCase( name ), | 135 | TestCase( name ), |
| 134 | m_ownFixture( false ), | 136 | m_ownFixture( false ), |
| 135 | m_fixture( &fixture ), | 137 | m_fixture( &fixture ), |
| 136 | m_test( test ) | 138 | m_test_function( std::bind(test, &fixture) ) |
| 137 | { | 139 | { |
| 138 | } | 140 | } |
| 139 | 141 | ||
| @@ -150,9 +152,17 @@ public: | |||
| 150 | TestCase( name ), | 152 | TestCase( name ), |
| 151 | m_ownFixture( true ), | 153 | m_ownFixture( true ), |
| 152 | m_fixture( fixture ), | 154 | m_fixture( fixture ), |
| 153 | m_test( test ) | 155 | m_test_function( std::bind(test, fixture) ) |
| 154 | { | 156 | { |
| 155 | } | 157 | } |
| 158 | |||
| 159 | TestCaller(std::string name, std::function<void()> test_function, Fixture* fixture): | ||
| 160 | TestCase(name), | ||
| 161 | m_ownFixture(true), | ||
| 162 | m_fixture(fixture), | ||
| 163 | m_test_function(test_function) | ||
| 164 | { | ||
| 165 | } | ||
| 156 | 166 | ||
| 157 | ~TestCaller() | 167 | ~TestCaller() |
| 158 | { | 168 | { |
| @@ -162,14 +172,7 @@ public: | |||
| 162 | 172 | ||
| 163 | void runTest() | 173 | void runTest() |
| 164 | { | 174 | { |
| 165 | // try { | 175 | m_test_function(); |
| 166 | (m_fixture->*m_test)(); | ||
| 167 | // } | ||
| 168 | // catch ( ExpectedException & ) { | ||
| 169 | // return; | ||
| 170 | // } | ||
| 171 | |||
| 172 | // ExpectedExceptionTraits<ExpectedException>::expectedException(); | ||
| 173 | } | 176 | } |
| 174 | 177 | ||
| 175 | void setUp() | 178 | void setUp() |
| @@ -194,7 +197,7 @@ private: | |||
| 194 | private: | 197 | private: |
| 195 | bool m_ownFixture; | 198 | bool m_ownFixture; |
| 196 | Fixture *m_fixture; | 199 | Fixture *m_fixture; |
| 197 | TestMethod m_test; | 200 | std::function<void()> m_test_function; |
| 198 | }; | 201 | }; |
| 199 | 202 | ||
| 200 | 203 | ||
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 | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z | 8 | #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z |
| 9 | #endif | 9 | #endif |
| 10 | 10 | ||
| 11 | #include <cppunit/portability/CppUnitDeque.h> | 11 | #include <deque> |
| 12 | #include <string> | 12 | #include <string> |
| 13 | 13 | ||
| 14 | CPPUNIT_NS_BEGIN | 14 | CPPUNIT_NS_BEGIN |
| @@ -16,11 +16,6 @@ CPPUNIT_NS_BEGIN | |||
| 16 | 16 | ||
| 17 | class Test; | 17 | class Test; |
| 18 | 18 | ||
| 19 | #if CPPUNIT_NEED_DLL_DECL | ||
| 20 | // template class CPPUNIT_API std::deque<Test *>; | ||
| 21 | #endif | ||
| 22 | |||
| 23 | |||
| 24 | /*! \brief A List of Test representing a path to access a Test. | 19 | /*! \brief A List of Test representing a path to access a Test. |
| 25 | * \ingroup ExecutingTest | 20 | * \ingroup ExecutingTest |
| 26 | * | 21 | * |
| @@ -174,7 +169,7 @@ protected: | |||
| 174 | void checkIndexValid( int index ) const; | 169 | void checkIndexValid( int index ) const; |
| 175 | 170 | ||
| 176 | /// A list of test names. | 171 | /// A list of test names. |
| 177 | typedef CppUnitDeque<std::string> PathTestNames; | 172 | typedef std::deque<std::string> PathTestNames; |
| 178 | 173 | ||
| 179 | /*! \brief Splits a path string into its test name components. | 174 | /*! \brief Splits a path string into its test name components. |
| 180 | * \param pathAsString Path string created with toString(). | 175 | * \param pathAsString Path string created with toString(). |
| @@ -199,7 +194,7 @@ protected: | |||
| 199 | PathTestNames &testNames ); | 194 | PathTestNames &testNames ); |
| 200 | 195 | ||
| 201 | protected: | 196 | protected: |
| 202 | typedef CppUnitDeque<Test *> Tests; | 197 | typedef std::deque<Test *> Tests; |
| 203 | Tests m_tests; | 198 | Tests m_tests; |
| 204 | 199 | ||
| 205 | }; | 200 | }; |
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 | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #endif | 9 | #endif |
| 10 | 10 | ||
| 11 | #include <cppunit/SynchronizedObject.h> | 11 | #include <cppunit/SynchronizedObject.h> |
| 12 | #include <cppunit/portability/CppUnitDeque.h> | 12 | #include <deque> |
| 13 | #include <string> | 13 | #include <string> |
| 14 | 14 | ||
| 15 | CPPUNIT_NS_BEGIN | 15 | CPPUNIT_NS_BEGIN |
| @@ -24,10 +24,6 @@ class TestFailure; | |||
| 24 | class TestListener; | 24 | class TestListener; |
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | #if CPPUNIT_NEED_DLL_DECL | ||
| 28 | // template class CPPUNIT_API std::deque<TestListener *>; | ||
| 29 | #endif | ||
| 30 | |||
| 31 | /*! \brief Manages TestListener. | 27 | /*! \brief Manages TestListener. |
| 32 | * \ingroup TrackingTestExecution | 28 | * \ingroup TrackingTestExecution |
| 33 | * | 29 | * |
| @@ -133,7 +129,7 @@ protected: | |||
| 133 | virtual void endTestRun( Test *test ); | 129 | virtual void endTestRun( Test *test ); |
| 134 | 130 | ||
| 135 | protected: | 131 | protected: |
| 136 | typedef CppUnitDeque<TestListener *> TestListeners; | 132 | typedef std::deque<TestListener *> TestListeners; |
| 137 | TestListeners m_listeners; | 133 | TestListeners m_listeners; |
| 138 | ProtectorChain *m_protectorChain; | 134 | ProtectorChain *m_protectorChain; |
| 139 | bool m_stop; | 135 | bool m_stop; |
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 | |||
| @@ -9,16 +9,11 @@ | |||
| 9 | #endif | 9 | #endif |
| 10 | 10 | ||
| 11 | #include <cppunit/TestSuccessListener.h> | 11 | #include <cppunit/TestSuccessListener.h> |
| 12 | #include <cppunit/portability/CppUnitDeque.h> | 12 | #include <deque> |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | CPPUNIT_NS_BEGIN | 15 | CPPUNIT_NS_BEGIN |
| 16 | 16 | ||
| 17 | #if CPPUNIT_NEED_DLL_DECL | ||
| 18 | // template class CPPUNIT_API std::deque<TestFailure *>; | ||
| 19 | // template class CPPUNIT_API std::deque<Test *>; | ||
| 20 | #endif | ||
| 21 | |||
| 22 | 17 | ||
| 23 | /*! \brief Collects test result. | 18 | /*! \brief Collects test result. |
| 24 | * \ingroup WritingTestResult | 19 | * \ingroup WritingTestResult |
| @@ -36,8 +31,8 @@ CPPUNIT_NS_BEGIN | |||
| 36 | class CPPUNIT_API TestResultCollector : public TestSuccessListener | 31 | class CPPUNIT_API TestResultCollector : public TestSuccessListener |
| 37 | { | 32 | { |
| 38 | public: | 33 | public: |
| 39 | typedef CppUnitDeque<TestFailure *> TestFailures; | 34 | typedef std::deque<TestFailure *> TestFailures; |
| 40 | typedef CppUnitDeque<Test *> Tests; | 35 | typedef std::deque<Test *> Tests; |
| 41 | 36 | ||
| 42 | 37 | ||
| 43 | /*! Constructs a TestResultCollector object. | 38 | /*! Constructs a TestResultCollector object. |
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 | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #endif | 9 | #endif |
| 10 | 10 | ||
| 11 | #include <cppunit/TestComposite.h> | 11 | #include <cppunit/TestComposite.h> |
| 12 | #include <cppunit/portability/CppUnitVector.h> | 12 | #include <vector> |
| 13 | 13 | ||
| 14 | CPPUNIT_NS_BEGIN | 14 | CPPUNIT_NS_BEGIN |
| 15 | 15 | ||
| @@ -56,7 +56,7 @@ public: | |||
| 56 | * TestComposite interface instead. | 56 | * TestComposite interface instead. |
| 57 | * \return Reference on a vector that contains the tests of the suite. | 57 | * \return Reference on a vector that contains the tests of the suite. |
| 58 | */ | 58 | */ |
| 59 | const CppUnitVector<Test *> &getTests() const; | 59 | const std::vector<Test *> &getTests() const; |
| 60 | 60 | ||
| 61 | /*! Destroys all the tests of the suite. | 61 | /*! Destroys all the tests of the suite. |
| 62 | */ | 62 | */ |
| @@ -67,7 +67,7 @@ public: | |||
| 67 | Test *doGetChildTestAt( int index ) const; | 67 | Test *doGetChildTestAt( int index ) const; |
| 68 | 68 | ||
| 69 | private: | 69 | private: |
| 70 | CppUnitVector<Test *> m_tests; | 70 | std::vector<Test *> m_tests; |
| 71 | }; | 71 | }; |
| 72 | 72 | ||
| 73 | 73 | ||
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 | |||
| @@ -26,6 +26,8 @@ public: | |||
| 26 | virtual void addFailure( const TestFailure &failure ); | 26 | virtual void addFailure( const TestFailure &failure ); |
| 27 | virtual void startTest( Test *test ); | 27 | virtual void startTest( Test *test ); |
| 28 | virtual void print( OStream &stream ); | 28 | virtual void print( OStream &stream ); |
| 29 | |||
| 30 | using TestResult::addFailure; | ||
| 29 | }; | 31 | }; |
| 30 | 32 | ||
| 31 | /** insertion operator for easy output */ | 33 | /** insertion operator for easy output */ |
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 | |||
| @@ -9,8 +9,8 @@ | |||
| 9 | #endif | 9 | #endif |
| 10 | 10 | ||
| 11 | #include <cppunit/Outputter.h> | 11 | #include <cppunit/Outputter.h> |
| 12 | #include <cppunit/portability/CppUnitDeque.h> | 12 | #include <deque> |
| 13 | #include <cppunit/portability/CppUnitMap.h> | 13 | #include <map> |
| 14 | #include <cppunit/portability/Stream.h> | 14 | #include <cppunit/portability/Stream.h> |
| 15 | 15 | ||
| 16 | 16 | ||
| @@ -46,7 +46,7 @@ public: | |||
| 46 | */ | 46 | */ |
| 47 | XmlOutputter( TestResultCollector *result, | 47 | XmlOutputter( TestResultCollector *result, |
| 48 | OStream &stream, | 48 | OStream &stream, |
| 49 | std::string encoding = std::string("ISO-8859-1") ); | 49 | const std::string& encoding = std::string("ISO-8859-1") ); |
| 50 | 50 | ||
| 51 | /// Destructor. | 51 | /// Destructor. |
| 52 | virtual ~XmlOutputter(); | 52 | virtual ~XmlOutputter(); |
| @@ -85,7 +85,7 @@ public: | |||
| 85 | */ | 85 | */ |
| 86 | virtual void setStandalone( bool standalone ); | 86 | virtual void setStandalone( bool standalone ); |
| 87 | 87 | ||
| 88 | typedef CppUnitMap<Test *,TestFailure*, std::less<Test*> > FailedTests; | 88 | typedef std::map<Test *,TestFailure*, std::less<Test*> > FailedTests; |
| 89 | 89 | ||
| 90 | /*! \brief Sets the root element and adds its children. | 90 | /*! \brief Sets the root element and adds its children. |
| 91 | * | 91 | * |
| @@ -137,7 +137,7 @@ protected: | |||
| 137 | virtual void fillFailedTestsMap( FailedTests &failedTests ); | 137 | virtual void fillFailedTestsMap( FailedTests &failedTests ); |
| 138 | 138 | ||
| 139 | protected: | 139 | protected: |
| 140 | typedef CppUnitDeque<XmlOutputterHook *> Hooks; | 140 | typedef std::deque<XmlOutputterHook *> Hooks; |
| 141 | 141 | ||
| 142 | TestResultCollector *m_result; | 142 | TestResultCollector *m_result; |
| 143 | OStream &m_stream; | 143 | OStream &m_stream; |
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 @@ | |||
| 1 | #ifndef _INCLUDE_CPPUNIT_CONFIG_AUTO_H | ||
| 2 | #define _INCLUDE_CPPUNIT_CONFIG_AUTO_H 1 | ||
| 3 | |||
| 4 | /* include/cppunit/config-auto.h. Generated automatically at end of configure. */ | ||
| 5 | /* config/config.h. Generated by configure. */ | ||
| 6 | /* config/config.h.in. Generated from configure.in by autoheader. */ | ||
| 7 | |||
| 8 | /* define if library uses std::string::compare(string,pos,n) */ | ||
| 9 | /* #undef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST */ | ||
| 10 | |||
| 11 | |||
| 12 | #define CPPUNIT_HAVE_CPP_CAST | ||
| 13 | |||
| 14 | /* define if the library defines strstream */ | ||
| 15 | #ifndef CPPUNIT_HAVE_CLASS_STRSTREAM | ||
| 16 | #define CPPUNIT_HAVE_CLASS_STRSTREAM 1 | ||
| 17 | #endif | ||
| 18 | |||
| 19 | /* Define to 1 if you have the <cmath> header file. */ | ||
| 20 | #ifndef CPPUNIT_HAVE_CMATH | ||
| 21 | #define CPPUNIT_HAVE_CMATH 1 | ||
| 22 | #endif | ||
| 23 | |||
| 24 | /* Define if you have the GNU dld library. */ | ||
| 25 | /* #undef CPPUNIT_HAVE_DLD */ | ||
| 26 | |||
| 27 | /* Define to 1 if you have the `dlerror' function. */ | ||
| 28 | #ifndef CPPUNIT_HAVE_DLERROR | ||
| 29 | #define CPPUNIT_HAVE_DLERROR 1 | ||
| 30 | #endif | ||
| 31 | |||
| 32 | /* Define to 1 if you have the <dlfcn.h> header file. */ | ||
| 33 | #ifndef CPPUNIT_HAVE_DLFCN_H | ||
| 34 | #define CPPUNIT_HAVE_DLFCN_H 1 | ||
| 35 | #endif | ||
| 36 | |||
| 37 | /* define if the compiler supports GCC C++ ABI name demangling */ | ||
| 38 | #ifndef CPPUNIT_HAVE_GCC_ABI_DEMANGLE | ||
| 39 | #define CPPUNIT_HAVE_GCC_ABI_DEMANGLE 1 | ||
| 40 | #endif | ||
| 41 | |||
| 42 | /* Define to 1 if you have the <inttypes.h> header file. */ | ||
| 43 | #ifndef CPPUNIT_HAVE_INTTYPES_H | ||
| 44 | #define CPPUNIT_HAVE_INTTYPES_H 1 | ||
| 45 | #endif | ||
| 46 | |||
| 47 | /* Define if you have the libdl library or equivalent. */ | ||
| 48 | #ifndef CPPUNIT_HAVE_LIBDL | ||
| 49 | #define CPPUNIT_HAVE_LIBDL 1 | ||
| 50 | #endif | ||
| 51 | |||
| 52 | /* Define to 1 if you have the <memory.h> header file. */ | ||
| 53 | #ifndef CPPUNIT_HAVE_MEMORY_H | ||
| 54 | #define CPPUNIT_HAVE_MEMORY_H 1 | ||
| 55 | #endif | ||
| 56 | |||
| 57 | /* define to 1 if the compiler implements namespaces */ | ||
| 58 | #ifndef CPPUNIT_HAVE_NAMESPACES | ||
| 59 | #define CPPUNIT_HAVE_NAMESPACES 1 | ||
| 60 | #endif | ||
| 61 | |||
| 62 | /* define if the compiler supports Run-Time Type Identification */ | ||
| 63 | #ifndef CPPUNIT_HAVE_RTTI | ||
| 64 | #define CPPUNIT_HAVE_RTTI 1 | ||
| 65 | #endif | ||
| 66 | |||
| 67 | /* Define if you have the shl_load function. */ | ||
| 68 | /* #undef CPPUNIT_HAVE_SHL_LOAD */ | ||
| 69 | |||
| 70 | /* define if the compiler has stringstream */ | ||
| 71 | #ifndef CPPUNIT_HAVE_SSTREAM | ||
| 72 | #define CPPUNIT_HAVE_SSTREAM 1 | ||
| 73 | #endif | ||
| 74 | |||
| 75 | /* Define to 1 if you have the <stdint.h> header file. */ | ||
| 76 | #ifndef CPPUNIT_HAVE_STDINT_H | ||
| 77 | #define CPPUNIT_HAVE_STDINT_H 1 | ||
| 78 | #endif | ||
| 79 | |||
| 80 | /* Define to 1 if you have the <stdlib.h> header file. */ | ||
| 81 | #ifndef CPPUNIT_HAVE_STDLIB_H | ||
| 82 | #define CPPUNIT_HAVE_STDLIB_H 1 | ||
| 83 | #endif | ||
| 84 | |||
| 85 | /* Define to 1 if you have the <strings.h> header file. */ | ||
| 86 | #ifndef CPPUNIT_HAVE_STRINGS_H | ||
| 87 | #define CPPUNIT_HAVE_STRINGS_H 1 | ||
| 88 | #endif | ||
| 89 | |||
| 90 | /* Define to 1 if you have the <string.h> header file. */ | ||
| 91 | #ifndef CPPUNIT_HAVE_STRING_H | ||
| 92 | #define CPPUNIT_HAVE_STRING_H 1 | ||
| 93 | #endif | ||
| 94 | |||
| 95 | /* Define to 1 if you have the <strstream> header file. */ | ||
| 96 | #ifndef CPPUNIT_HAVE_STRSTREAM | ||
| 97 | #define CPPUNIT_HAVE_STRSTREAM 1 | ||
| 98 | #endif | ||
| 99 | |||
| 100 | /* Define to 1 if you have the <sys/stat.h> header file. */ | ||
| 101 | #ifndef CPPUNIT_HAVE_SYS_STAT_H | ||
| 102 | #define CPPUNIT_HAVE_SYS_STAT_H 1 | ||
| 103 | #endif | ||
| 104 | |||
| 105 | /* Define to 1 if you have the <sys/types.h> header file. */ | ||
| 106 | #ifndef CPPUNIT_HAVE_SYS_TYPES_H | ||
| 107 | #define CPPUNIT_HAVE_SYS_TYPES_H 1 | ||
| 108 | #endif | ||
| 109 | |||
| 110 | /* Define to 1 if you have the <unistd.h> header file. */ | ||
| 111 | #ifndef CPPUNIT_HAVE_UNISTD_H | ||
| 112 | #define CPPUNIT_HAVE_UNISTD_H 1 | ||
| 113 | #endif | ||
| 114 | |||
| 115 | /* Name of package */ | ||
| 116 | #ifndef CPPUNIT_PACKAGE | ||
| 117 | #define CPPUNIT_PACKAGE "cppunit" | ||
| 118 | #endif | ||
| 119 | |||
| 120 | /* Define to the address where bug reports for this package should be sent. */ | ||
| 121 | #ifndef CPPUNIT_PACKAGE_BUGREPORT | ||
| 122 | #define CPPUNIT_PACKAGE_BUGREPORT "" | ||
| 123 | #endif | ||
| 124 | |||
| 125 | /* Define to the full name of this package. */ | ||
| 126 | #ifndef CPPUNIT_PACKAGE_NAME | ||
| 127 | #define CPPUNIT_PACKAGE_NAME "" | ||
| 128 | #endif | ||
| 129 | |||
| 130 | /* Define to the full name and version of this package. */ | ||
| 131 | #ifndef CPPUNIT_PACKAGE_STRING | ||
| 132 | #define CPPUNIT_PACKAGE_STRING "" | ||
| 133 | #endif | ||
| 134 | |||
| 135 | /* Define to the one symbol short name of this package. */ | ||
| 136 | #ifndef CPPUNIT_PACKAGE_TARNAME | ||
| 137 | #define CPPUNIT_PACKAGE_TARNAME "" | ||
| 138 | #endif | ||
| 139 | |||
| 140 | /* Define to the version of this package. */ | ||
| 141 | #ifndef CPPUNIT_PACKAGE_VERSION | ||
| 142 | #define CPPUNIT_PACKAGE_VERSION "" | ||
| 143 | #endif | ||
| 144 | |||
| 145 | /* Define to 1 if you have the ANSI C header files. */ | ||
| 146 | #ifndef CPPUNIT_STDC_HEADERS | ||
| 147 | #define CPPUNIT_STDC_HEADERS 1 | ||
| 148 | #endif | ||
| 149 | |||
| 150 | /* Define to 1 to use type_info::name() for class names */ | ||
| 151 | #ifndef CPPUNIT_USE_TYPEINFO_NAME | ||
| 152 | #define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI | ||
| 153 | #endif | ||
| 154 | |||
| 155 | /* Version number of package */ | ||
| 156 | #ifndef CPPUNIT_VERSION | ||
| 157 | #define CPPUNIT_VERSION "1.12.0" | ||
| 158 | #endif | ||
| 159 | |||
| 160 | /* _INCLUDE_CPPUNIT_CONFIG_AUTO_H */ | ||
| 161 | #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 | |||
| @@ -15,9 +15,6 @@ | |||
| 15 | * CPPUNIT_HAVE_WIN32_DLL_LOADER | 15 | * CPPUNIT_HAVE_WIN32_DLL_LOADER |
| 16 | * If defined, Win32 implementation of DynamicLibraryManager will be used. | 16 | * If defined, Win32 implementation of DynamicLibraryManager will be used. |
| 17 | * | 17 | * |
| 18 | * CPPUNIT_HAVE_BEOS_DLL_LOADER | ||
| 19 | * If defined, BeOs implementation of DynamicLibraryManager will be used. | ||
| 20 | * | ||
| 21 | * CPPUNIT_HAVE_UNIX_DLL_LOADER | 18 | * CPPUNIT_HAVE_UNIX_DLL_LOADER |
| 22 | * If defined, Unix implementation (dlfcn.h) of DynamicLibraryManager will be used. | 19 | * If defined, Unix implementation (dlfcn.h) of DynamicLibraryManager will be used. |
| 23 | */ | 20 | */ |
| @@ -50,10 +47,6 @@ | |||
| 50 | #undef CPPUNIT_PLUGIN_EXPORT | 47 | #undef CPPUNIT_PLUGIN_EXPORT |
| 51 | #define CPPUNIT_PLUGIN_EXPORT extern "C" __declspec(dllexport) | 48 | #define CPPUNIT_PLUGIN_EXPORT extern "C" __declspec(dllexport) |
| 52 | 49 | ||
| 53 | // Is BeOS platform ? | ||
| 54 | #elif defined(__BEOS__) | ||
| 55 | #define CPPUNIT_HAVE_BEOS_DLL_LOADER 1 | ||
| 56 | |||
| 57 | // Is Unix platform and have shl_load() (hp-ux) | 50 | // Is Unix platform and have shl_load() (hp-ux) |
| 58 | #elif defined(CPPUNIT_HAVE_SHL_LOAD) | 51 | #elif defined(CPPUNIT_HAVE_SHL_LOAD) |
| 59 | #define CPPUNIT_HAVE_UNIX_SHL_LOADER 1 | 52 | #define CPPUNIT_HAVE_UNIX_SHL_LOADER 1 |
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 | |||
| @@ -30,20 +30,6 @@ | |||
| 30 | #define CPPUNIT_HAVE_NAMESPACES 1 | 30 | #define CPPUNIT_HAVE_NAMESPACES 1 |
| 31 | #endif | 31 | #endif |
| 32 | 32 | ||
| 33 | /* define if the compiler supports Run-Time Type Identification */ | ||
| 34 | #ifndef CPPUNIT_HAVE_RTTI | ||
| 35 | # ifdef _CPPRTTI // Defined by the compiler option /GR | ||
| 36 | # define CPPUNIT_HAVE_RTTI 1 | ||
| 37 | # else | ||
| 38 | # define CPPUNIT_HAVE_RTTI 0 | ||
| 39 | # endif | ||
| 40 | #endif | ||
| 41 | |||
| 42 | /* Define to 1 to use type_info::name() for class names */ | ||
| 43 | #ifndef CPPUNIT_USE_TYPEINFO_NAME | ||
| 44 | #define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI | ||
| 45 | #endif | ||
| 46 | |||
| 47 | #define CPPUNIT_HAVE_SSTREAM 1 | 33 | #define CPPUNIT_HAVE_SSTREAM 1 |
| 48 | 34 | ||
| 49 | /* Name of package */ | 35 | /* Name of package */ |
| @@ -73,11 +59,12 @@ | |||
| 73 | // Uncomment to turn on STL wrapping => use this to test compilation. | 59 | // Uncomment to turn on STL wrapping => use this to test compilation. |
| 74 | // This will make CppUnit subclass std::vector & co to provide default | 60 | // This will make CppUnit subclass std::vector & co to provide default |
| 75 | // parameter. | 61 | // parameter. |
| 76 | /*#define CPPUNIT_STD_NEED_ALLOCATOR 1 | 62 | /*#define CPPUNIT_NO_NAMESPACE 1 |
| 77 | #define CPPUNIT_STD_ALLOCATOR std::allocator<T> | ||
| 78 | //#define CPPUNIT_NO_NAMESPACE 1 | ||
| 79 | */ | 63 | */ |
| 80 | 64 | ||
| 65 | #if _MSC_VER >= 1300 // VS 7.0 | ||
| 66 | #define CPPUNIT_UNIQUE_COUNTER __COUNTER__ | ||
| 67 | #endif // if _MSC_VER >= 1300 // VS 7.0 | ||
| 81 | 68 | ||
| 82 | /* _INCLUDE_CPPUNIT_CONFIG_MSVC6_H */ | 69 | /* _INCLUDE_CPPUNIT_CONFIG_MSVC6_H */ |
| 83 | #endif | 70 | #endif |
diff --git a/3rdParty/CppUnit/src/include/cppunit/extensions/ExceptionTestCaseDecorator.h b/3rdParty/CppUnit/src/include/cppunit/extensions/ExceptionTestCaseDecorator.h index 9c816ad..a3f2b3e 100644 --- a/3rdParty/CppUnit/src/include/cppunit/extensions/ExceptionTestCaseDecorator.h +++ b/3rdParty/CppUnit/src/include/cppunit/extensions/ExceptionTestCaseDecorator.h | |||
| @@ -76,7 +76,7 @@ public: | |||
| 76 | 76 | ||
| 77 | // Moved outside the try{} statement to handle the case where the | 77 | // Moved outside the try{} statement to handle the case where the |
| 78 | // expected exception type is Exception (expecting assertion failure). | 78 | // expected exception type is Exception (expecting assertion failure). |
| 79 | #if CPPUNIT_USE_TYPEINFO_NAME | 79 | #if defined(CPPUNIT_USE_TYPEINFO_NAME) |
| 80 | throw Exception( Message( | 80 | throw Exception( Message( |
| 81 | "expected exception not thrown", | 81 | "expected exception not thrown", |
| 82 | "Expected exception type: " + | 82 | "Expected exception type: " + |
| @@ -92,7 +92,7 @@ private: | |||
| 92 | * | 92 | * |
| 93 | * Should be overriden to check the exception. | 93 | * Should be overriden to check the exception. |
| 94 | */ | 94 | */ |
| 95 | virtual void checkException( ExpectedExceptionType &e ) | 95 | virtual void checkException( ExpectedExceptionType & ) |
| 96 | { | 96 | { |
| 97 | } | 97 | } |
| 98 | }; | 98 | }; |
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 | |||
| @@ -166,17 +166,18 @@ | |||
| 166 | #define CPPUNIT_TEST_SUITE_END() \ | 166 | #define CPPUNIT_TEST_SUITE_END() \ |
| 167 | } \ | 167 | } \ |
| 168 | \ | 168 | \ |
| 169 | public: \ | ||
| 169 | static CPPUNIT_NS::TestSuite *suite() \ | 170 | static CPPUNIT_NS::TestSuite *suite() \ |
| 170 | { \ | 171 | { \ |
| 171 | const CPPUNIT_NS::TestNamer &namer = getTestNamer__(); \ | 172 | const CPPUNIT_NS::TestNamer &namer = getTestNamer__(); \ |
| 172 | std::auto_ptr<CPPUNIT_NS::TestSuite> suite( \ | 173 | std::unique_ptr<CPPUNIT_NS::TestSuite> guard( \ |
| 173 | new CPPUNIT_NS::TestSuite( namer.getFixtureName() )); \ | 174 | new CPPUNIT_NS::TestSuite( namer.getFixtureName() )); \ |
| 174 | CPPUNIT_NS::ConcretTestFixtureFactory<TestFixtureType> factory; \ | 175 | CPPUNIT_NS::ConcretTestFixtureFactory<TestFixtureType> factory; \ |
| 175 | CPPUNIT_NS::TestSuiteBuilderContextBase context( *suite.get(), \ | 176 | CPPUNIT_NS::TestSuiteBuilderContextBase context( *guard.get(), \ |
| 176 | namer, \ | 177 | namer, \ |
| 177 | factory ); \ | 178 | factory ); \ |
| 178 | TestFixtureType::addTestsToSuite( context ); \ | 179 | TestFixtureType::addTestsToSuite( context ); \ |
| 179 | return suite.release(); \ | 180 | return guard.release(); \ |
| 180 | } \ | 181 | } \ |
| 181 | private: /* dummy typedef so that the macro can still end with ';'*/ \ | 182 | private: /* dummy typedef so that the macro can still end with ';'*/ \ |
| 182 | typedef int CppUnitDummyTypedefForSemiColonEnding__ | 183 | typedef int CppUnitDummyTypedefForSemiColonEnding__ |
| @@ -300,6 +301,17 @@ | |||
| 300 | &TestFixtureType::testMethod, \ | 301 | &TestFixtureType::testMethod, \ |
| 301 | context.makeFixture() ) ) ) | 302 | context.makeFixture() ) ) ) |
| 302 | 303 | ||
| 304 | #define CPPUNIT_TEST_PARAMETERIZED( testMethod, ... ) \ | ||
| 305 | for (auto& i : __VA_ARGS__) \ | ||
| 306 | { \ | ||
| 307 | TestFixtureType* fixture = context.makeFixture(); \ | ||
| 308 | CPPUNIT_TEST_SUITE_ADD_TEST( \ | ||
| 309 | ( new CPPUNIT_NS::TestCaller<TestFixtureType>( \ | ||
| 310 | context.getTestNameFor(#testMethod, i), \ | ||
| 311 | std::bind(&TestFixtureType::testMethod, fixture, i), \ | ||
| 312 | fixture))); \ | ||
| 313 | } | ||
| 314 | |||
| 303 | /*! \brief Add a test which fail if the specified exception is not caught. | 315 | /*! \brief Add a test which fail if the specified exception is not caught. |
| 304 | * | 316 | * |
| 305 | * Example: | 317 | * Example: |
| @@ -308,13 +320,13 @@ | |||
| 308 | * #include <vector> | 320 | * #include <vector> |
| 309 | * class MyTest : public CppUnit::TestFixture { | 321 | * class MyTest : public CppUnit::TestFixture { |
| 310 | * CPPUNIT_TEST_SUITE( MyTest ); | 322 | * CPPUNIT_TEST_SUITE( MyTest ); |
| 311 | * CPPUNIT_TEST_EXCEPTION( testVectorAtThrow, std::invalid_argument ); | 323 | * CPPUNIT_TEST_EXCEPTION( testVectorAtThrow, std::out_of_range ); |
| 312 | * CPPUNIT_TEST_SUITE_END(); | 324 | * CPPUNIT_TEST_SUITE_END(); |
| 313 | * public: | 325 | * public: |
| 314 | * void testVectorAtThrow() | 326 | * void testVectorAtThrow() |
| 315 | * { | 327 | * { |
| 316 | * std::vector<int> v; | 328 | * std::vector<int> v; |
| 317 | * v.at( 1 ); // must throw exception std::invalid_argument | 329 | * v.at( 1 ); // must throw exception std::out_of_range |
| 318 | * } | 330 | * } |
| 319 | * }; | 331 | * }; |
| 320 | * \endcode | 332 | * \endcode |
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 | |||
| @@ -13,7 +13,7 @@ CPPUNIT_NS_BEGIN | |||
| 13 | * of a test class without subclassing the test. Instead, one can | 13 | * of a test class without subclassing the test. Instead, one can |
| 14 | * subclass the decorater and use it to wrap the test class. | 14 | * subclass the decorater and use it to wrap the test class. |
| 15 | * | 15 | * |
| 16 | * Does not assume ownership of the test it decorates | 16 | * Assumes ownership of the test it decorates |
| 17 | */ | 17 | */ |
| 18 | class CPPUNIT_API TestCaseDecorator : public TestCase | 18 | class CPPUNIT_API TestCaseDecorator : public TestCase |
| 19 | { | 19 | { |
| @@ -31,6 +31,13 @@ public: | |||
| 31 | 31 | ||
| 32 | protected: | 32 | protected: |
| 33 | TestCase *m_test; | 33 | TestCase *m_test; |
| 34 | |||
| 35 | private: | ||
| 36 | |||
| 37 | //prevent the creation of copy c'tor and operator= | ||
| 38 | TestCaseDecorator( const TestCaseDecorator& ); | ||
| 39 | TestCaseDecorator& operator=( const TestCaseDecorator& ); | ||
| 40 | |||
| 34 | }; | 41 | }; |
| 35 | 42 | ||
| 36 | 43 | ||
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 | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #pragma warning( disable: 4251) // X needs to have dll-interface to be used by clients of class Z | 8 | #pragma warning( disable: 4251) // X needs to have dll-interface to be used by clients of class Z |
| 9 | #endif | 9 | #endif |
| 10 | 10 | ||
| 11 | #include <cppunit/portability/CppUnitSet.h> | 11 | #include <set> |
| 12 | #include <cppunit/extensions/TestFactory.h> | 12 | #include <cppunit/extensions/TestFactory.h> |
| 13 | #include <string> | 13 | #include <string> |
| 14 | 14 | ||
| @@ -17,11 +17,6 @@ CPPUNIT_NS_BEGIN | |||
| 17 | 17 | ||
| 18 | class TestSuite; | 18 | class TestSuite; |
| 19 | 19 | ||
| 20 | #if CPPUNIT_NEED_DLL_DECL | ||
| 21 | // template class CPPUNIT_API std::set<TestFactory *>; | ||
| 22 | #endif | ||
| 23 | |||
| 24 | |||
| 25 | /*! \brief Registry for TestFactory. | 20 | /*! \brief Registry for TestFactory. |
| 26 | * \ingroup CreatingTestSuite | 21 | * \ingroup CreatingTestSuite |
| 27 | * | 22 | * |
| @@ -165,7 +160,7 @@ private: | |||
| 165 | void operator =( const TestFactoryRegistry © ); | 160 | void operator =( const TestFactoryRegistry © ); |
| 166 | 161 | ||
| 167 | private: | 162 | private: |
| 168 | typedef CppUnitSet<TestFactory *, std::less<TestFactory*> > Factories; | 163 | typedef std::set<TestFactory *, std::less<TestFactory*> > Factories; |
| 169 | Factories m_factories; | 164 | Factories m_factories; |
| 170 | 165 | ||
| 171 | std::string m_name; | 166 | std::string m_name; |
diff --git a/3rdParty/CppUnit/src/include/cppunit/extensions/TestNamer.h b/3rdParty/CppUnit/src/include/cppunit/extensions/TestNamer.h index 5a6471c..0c8fb31 100644 --- a/3rdParty/CppUnit/src/include/cppunit/extensions/TestNamer.h +++ b/3rdParty/CppUnit/src/include/cppunit/extensions/TestNamer.h | |||
| @@ -3,20 +3,16 @@ | |||
| 3 | 3 | ||
| 4 | #include <cppunit/Portability.h> | 4 | #include <cppunit/Portability.h> |
| 5 | #include <string> | 5 | #include <string> |
| 6 | #include <cppunit/tools/StringHelper.h> | ||
| 6 | 7 | ||
| 7 | #if CPPUNIT_HAVE_RTTI | 8 | #include <typeinfo> |
| 8 | # include <typeinfo> | ||
| 9 | #endif | ||
| 10 | 9 | ||
| 11 | 10 | ||
| 12 | 11 | ||
| 13 | /*! \def CPPUNIT_TESTNAMER_DECL( variableName, FixtureType ) | 12 | /*! \def CPPUNIT_TESTNAMER_DECL( variableName, FixtureType ) |
| 14 | * \brief Declares a TestNamer. | 13 | * \brief Declares a TestNamer. |
| 15 | * | 14 | * |
| 16 | * Declares a TestNamer for the specified type, using RTTI if enabled, otherwise | 15 | * Declares a TestNamer for the specified type |
| 17 | * using macro string expansion. | ||
| 18 | * | ||
| 19 | * RTTI is used if CPPUNIT_USE_TYPEINFO_NAME is defined and not null. | ||
| 20 | * | 16 | * |
| 21 | * \code | 17 | * \code |
| 22 | * void someMethod() | 18 | * void someMethod() |
| @@ -29,19 +25,11 @@ | |||
| 29 | * \relates TestNamer | 25 | * \relates TestNamer |
| 30 | * \see TestNamer | 26 | * \see TestNamer |
| 31 | */ | 27 | */ |
| 32 | #if CPPUNIT_USE_TYPEINFO_NAME | ||
| 33 | # define CPPUNIT_TESTNAMER_DECL( variableName, FixtureType ) \ | 28 | # define CPPUNIT_TESTNAMER_DECL( variableName, FixtureType ) \ |
| 34 | CPPUNIT_NS::TestNamer variableName( typeid(FixtureType) ) | 29 | CPPUNIT_NS::TestNamer variableName( typeid(FixtureType) ) |
| 35 | #else | ||
| 36 | # define CPPUNIT_TESTNAMER_DECL( variableName, FixtureType ) \ | ||
| 37 | CPPUNIT_NS::TestNamer variableName( std::string(#FixtureType) ) | ||
| 38 | #endif | ||
| 39 | |||
| 40 | |||
| 41 | 30 | ||
| 42 | CPPUNIT_NS_BEGIN | 31 | CPPUNIT_NS_BEGIN |
| 43 | 32 | ||
| 44 | |||
| 45 | /*! \brief Names a test or a fixture suite. | 33 | /*! \brief Names a test or a fixture suite. |
| 46 | * | 34 | * |
| 47 | * TestNamer is usually instantiated using CPPUNIT_TESTNAMER_DECL. | 35 | * TestNamer is usually instantiated using CPPUNIT_TESTNAMER_DECL. |
| @@ -50,12 +38,10 @@ CPPUNIT_NS_BEGIN | |||
| 50 | class CPPUNIT_API TestNamer | 38 | class CPPUNIT_API TestNamer |
| 51 | { | 39 | { |
| 52 | public: | 40 | public: |
| 53 | #if CPPUNIT_HAVE_RTTI | ||
| 54 | /*! \brief Constructs a namer using the fixture's type-info. | 41 | /*! \brief Constructs a namer using the fixture's type-info. |
| 55 | * \param typeInfo Type-info of the fixture type. Use to name the fixture suite. | 42 | * \param typeInfo Type-info of the fixture type. Use to name the fixture suite. |
| 56 | */ | 43 | */ |
| 57 | TestNamer( const std::type_info &typeInfo ); | 44 | TestNamer( const std::type_info &typeInfo ); |
| 58 | #endif | ||
| 59 | 45 | ||
| 60 | /*! \brief Constructs a namer using the specified fixture name. | 46 | /*! \brief Constructs a namer using the specified fixture name. |
| 61 | * \param fixtureName Name of the fixture suite. Usually extracted using a macro. | 47 | * \param fixtureName Name of the fixture suite. Usually extracted using a macro. |
| @@ -78,11 +64,16 @@ public: | |||
| 78 | */ | 64 | */ |
| 79 | virtual std::string getTestNameFor( const std::string &testMethodName ) const; | 65 | virtual std::string getTestNameFor( const std::string &testMethodName ) const; |
| 80 | 66 | ||
| 67 | template<typename E> | ||
| 68 | std::string getTestNameFor( const std::string& testMethodName, const E& val) const | ||
| 69 | { | ||
| 70 | return getTestNameFor(testMethodName) + " with parameter: " + CPPUNIT_NS::StringHelper::toString(val); | ||
| 71 | } | ||
| 72 | |||
| 81 | protected: | 73 | protected: |
| 82 | std::string m_fixtureName; | 74 | std::string m_fixtureName; |
| 83 | }; | 75 | }; |
| 84 | 76 | ||
| 85 | |||
| 86 | CPPUNIT_NS_END | 77 | CPPUNIT_NS_END |
| 87 | 78 | ||
| 88 | #endif // CPPUNIT_EXTENSIONS_TESTNAMER_H | 79 | #endif // CPPUNIT_EXTENSIONS_TESTNAMER_H |
diff --git a/3rdParty/CppUnit/src/include/cppunit/extensions/TestSuiteBuilderContext.h b/3rdParty/CppUnit/src/include/cppunit/extensions/TestSuiteBuilderContext.h index db26926..72bfa70 100644 --- a/3rdParty/CppUnit/src/include/cppunit/extensions/TestSuiteBuilderContext.h +++ b/3rdParty/CppUnit/src/include/cppunit/extensions/TestSuiteBuilderContext.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | #define CPPUNIT_HELPER_TESTSUITEBUILDERCONTEXT_H | 2 | #define CPPUNIT_HELPER_TESTSUITEBUILDERCONTEXT_H |
| 3 | 3 | ||
| 4 | #include <cppunit/Portability.h> | 4 | #include <cppunit/Portability.h> |
| 5 | #include <cppunit/portability/CppUnitMap.h> | 5 | #include <map> |
| 6 | #include <string> | 6 | #include <string> |
| 7 | 7 | ||
| 8 | #if CPPUNIT_NEED_DLL_DECL | 8 | #if CPPUNIT_NEED_DLL_DECL |
| @@ -62,6 +62,21 @@ public: | |||
| 62 | */ | 62 | */ |
| 63 | std::string getTestNameFor( const std::string &testMethodName ) const; | 63 | std::string getTestNameFor( const std::string &testMethodName ) const; |
| 64 | 64 | ||
| 65 | /*! \brief Returns the name of the test for the specified method with the corresponding parameter. | ||
| 66 | * | ||
| 67 | * \param testMethodName Name (including a parameter) of the method that implements a test. | ||
| 68 | * \return A string that is the concatenation of the test fixture name | ||
| 69 | * (returned by getFixtureName()), \a testMethodName, | ||
| 70 | * separated using '::' and the parameter. This provides a fairly unique name for a given | ||
| 71 | * test. The parameter must be convertable to std::string through operator<< | ||
| 72 | * or a specialization of CPPUNIT_NS::StringHelper::toString needs to exist. | ||
| 73 | */ | ||
| 74 | template<typename T> | ||
| 75 | std::string getTestNameFor( const std::string &testMethodName, const T& value ) const | ||
| 76 | { | ||
| 77 | return m_namer.getTestNameFor(testMethodName, value); | ||
| 78 | } | ||
| 79 | |||
| 65 | /*! \brief Adds property pair. | 80 | /*! \brief Adds property pair. |
| 66 | * \param key PropertyKey string to add. | 81 | * \param key PropertyKey string to add. |
| 67 | * \param value PropertyValue string to add. | 82 | * \param value PropertyValue string to add. |
| @@ -81,7 +96,7 @@ protected: | |||
| 81 | // shared std::map in dll bug in VC6. | 96 | // shared std::map in dll bug in VC6. |
| 82 | // See http://www.dinkumware.com/vc_fixes.html for detail. | 97 | // See http://www.dinkumware.com/vc_fixes.html for detail. |
| 83 | typedef std::pair<std::string,std::string> Property; | 98 | typedef std::pair<std::string,std::string> Property; |
| 84 | typedef CppUnitVector<Property> Properties; | 99 | typedef std::vector<Property> Properties; |
| 85 | 100 | ||
| 86 | TestSuite &m_suite; | 101 | TestSuite &m_suite; |
| 87 | const TestNamer &m_namer; | 102 | const TestNamer &m_namer; |
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 | |||
| @@ -3,14 +3,11 @@ | |||
| 3 | 3 | ||
| 4 | #include <cppunit/Portability.h> | 4 | #include <cppunit/Portability.h> |
| 5 | 5 | ||
| 6 | #if CPPUNIT_HAVE_RTTI | ||
| 7 | |||
| 8 | #include <typeinfo> | 6 | #include <typeinfo> |
| 9 | #include <string> | 7 | #include <string> |
| 10 | 8 | ||
| 11 | CPPUNIT_NS_BEGIN | 9 | CPPUNIT_NS_BEGIN |
| 12 | 10 | ||
| 13 | |||
| 14 | /**! \brief Helper to use type_info. | 11 | /**! \brief Helper to use type_info. |
| 15 | */ | 12 | */ |
| 16 | class CPPUNIT_API TypeInfoHelper | 13 | class CPPUNIT_API TypeInfoHelper |
| @@ -25,9 +22,6 @@ CPPUNIT_NS_BEGIN | |||
| 25 | static std::string getClassName( const std::type_info &info ); | 22 | static std::string getClassName( const std::type_info &info ); |
| 26 | }; | 23 | }; |
| 27 | 24 | ||
| 28 | |||
| 29 | CPPUNIT_NS_END | 25 | CPPUNIT_NS_END |
| 30 | 26 | ||
| 31 | #endif // CPPUNIT_HAVE_RTTI | ||
| 32 | |||
| 33 | #endif // CPPUNIT_TYPEINFOHELPER_H | 27 | #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 @@ | |||
| 1 | #ifndef CPPUNIT_PORTABILITY_CPPUNITDEQUE_H | ||
| 2 | #define CPPUNIT_PORTABILITY_CPPUNITDEQUE_H | ||
| 3 | |||
| 4 | // The technic used is similar to the wrapper of STLPort. | ||
| 5 | |||
| 6 | #include <cppunit/Portability.h> | ||
| 7 | #include <deque> | ||
| 8 | |||
| 9 | |||
| 10 | #if CPPUNIT_STD_NEED_ALLOCATOR | ||
| 11 | |||
| 12 | template<class T> | ||
| 13 | class CppUnitDeque : public std::deque<T,CPPUNIT_STD_ALLOCATOR> | ||
| 14 | { | ||
| 15 | public: | ||
| 16 | }; | ||
| 17 | |||
| 18 | #else // CPPUNIT_STD_NEED_ALLOCATOR | ||
| 19 | |||
| 20 | #define CppUnitDeque std::deque | ||
| 21 | |||
| 22 | #endif | ||
| 23 | |||
| 24 | #endif // CPPUNIT_PORTABILITY_CPPUNITDEQUE_H | ||
| 25 | |||
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 @@ | |||
| 1 | #ifndef CPPUNIT_PORTABILITY_CPPUNITMAP_H | ||
| 2 | #define CPPUNIT_PORTABILITY_CPPUNITMAP_H | ||
| 3 | |||
| 4 | // The technic used is similar to the wrapper of STLPort. | ||
| 5 | |||
| 6 | #include <cppunit/Portability.h> | ||
| 7 | #include <functional> | ||
| 8 | #include <map> | ||
| 9 | |||
| 10 | |||
| 11 | #if CPPUNIT_STD_NEED_ALLOCATOR | ||
| 12 | |||
| 13 | template<class Key, class T> | ||
| 14 | class CppUnitMap : public std::map<Key | ||
| 15 | ,T | ||
| 16 | ,std::less<Key> | ||
| 17 | ,CPPUNIT_STD_ALLOCATOR> | ||
| 18 | { | ||
| 19 | public: | ||
| 20 | }; | ||
| 21 | |||
| 22 | #else // CPPUNIT_STD_NEED_ALLOCATOR | ||
| 23 | |||
| 24 | #define CppUnitMap std::map | ||
| 25 | |||
| 26 | #endif | ||
| 27 | |||
| 28 | #endif // CPPUNIT_PORTABILITY_CPPUNITMAP_H | ||
| 29 | |||
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 @@ | |||
| 1 | #ifndef CPPUNIT_PORTABILITY_CPPUNITSET_H | ||
| 2 | #define CPPUNIT_PORTABILITY_CPPUNITSET_H | ||
| 3 | |||
| 4 | // The technic used is similar to the wrapper of STLPort. | ||
| 5 | |||
| 6 | #include <cppunit/Portability.h> | ||
| 7 | #include <functional> | ||
| 8 | #include <set> | ||
| 9 | |||
| 10 | |||
| 11 | #if CPPUNIT_STD_NEED_ALLOCATOR | ||
| 12 | |||
| 13 | template<class T> | ||
| 14 | class CppUnitSet : public std::set<T | ||
| 15 | ,std::less<T> | ||
| 16 | ,CPPUNIT_STD_ALLOCATOR> | ||
| 17 | { | ||
| 18 | public: | ||
| 19 | }; | ||
| 20 | |||
| 21 | #else // CPPUNIT_STD_NEED_ALLOCATOR | ||
| 22 | |||
| 23 | #define CppUnitSet std::set | ||
| 24 | |||
| 25 | #endif | ||
| 26 | |||
| 27 | #endif // CPPUNIT_PORTABILITY_CPPUNITSET_H | ||
| 28 | |||
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 @@ | |||
| 1 | #ifndef CPPUNIT_PORTABILITY_CPPUNITVECTOR_H | ||
| 2 | #define CPPUNIT_PORTABILITY_CPPUNITVECTOR_H | ||
| 3 | |||
| 4 | // The technic used is similar to the wrapper of STLPort. | ||
| 5 | |||
| 6 | #include <cppunit/Portability.h> | ||
| 7 | #include <vector> | ||
| 8 | |||
| 9 | |||
| 10 | #if CPPUNIT_STD_NEED_ALLOCATOR | ||
| 11 | |||
| 12 | template<class T> | ||
| 13 | class CppUnitVector : public std::vector<T,CPPUNIT_STD_ALLOCATOR> | ||
| 14 | { | ||
| 15 | public: | ||
| 16 | }; | ||
| 17 | |||
| 18 | #else // CPPUNIT_STD_NEED_ALLOCATOR | ||
| 19 | |||
| 20 | #define CppUnitVector std::vector | ||
| 21 | |||
| 22 | #endif | ||
| 23 | |||
| 24 | #endif // CPPUNIT_PORTABILITY_CPPUNITVECTOR_H | ||
| 25 | |||
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 @@ | |||
| 1 | #ifndef CPPUNIT_TOOLS_STRINGHELPER_H | ||
| 2 | #define CPPUNIT_TOOLS_STRINGHELPER_H | ||
| 3 | |||
| 4 | #include <cppunit/Portability.h> | ||
| 5 | #include <cppunit/portability/Stream.h> | ||
| 6 | #include <string> | ||
| 7 | #include <type_traits> | ||
| 8 | |||
| 9 | |||
| 10 | CPPUNIT_NS_BEGIN | ||
| 11 | |||
| 12 | |||
| 13 | /*! \brief Methods for converting values to strings. Replaces CPPUNIT_NS::StringTools::toString | ||
| 14 | */ | ||
| 15 | namespace StringHelper | ||
| 16 | { | ||
| 17 | |||
| 18 | // work around to handle C++11 enum class correctly. We need an own conversion to std::string | ||
| 19 | // as there is no implicit coversion to int for enum class. | ||
| 20 | |||
| 21 | template<typename T> | ||
| 22 | typename std::enable_if<!std::is_enum<T>::value, std::string>::type toString(const T& x) | ||
| 23 | { | ||
| 24 | OStringStream ost; | ||
| 25 | ost << x; | ||
| 26 | |||
| 27 | return ost.str(); | ||
| 28 | } | ||
| 29 | |||
| 30 | template<typename T> | ||
| 31 | typename std::enable_if<std::is_enum<T>::value, std::string>::type toString(const T& x) | ||
| 32 | { | ||
| 33 | OStringStream ost; | ||
| 34 | ost << static_cast<typename std::underlying_type<T>::type>(x); | ||
| 35 | |||
| 36 | return ost.str(); | ||
| 37 | } | ||
| 38 | |||
| 39 | } | ||
| 40 | |||
| 41 | |||
| 42 | CPPUNIT_NS_END | ||
| 43 | |||
| 44 | #endif // CPPUNIT_TOOLS_STRINGHELPER_H | ||
| 45 | |||
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 | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <cppunit/Portability.h> | 4 | #include <cppunit/Portability.h> |
| 5 | #include <string> | 5 | #include <string> |
| 6 | #include <cppunit/portability/CppUnitVector.h> | 6 | #include <vector> |
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | CPPUNIT_NS_BEGIN | 9 | CPPUNIT_NS_BEGIN |
| @@ -14,7 +14,7 @@ CPPUNIT_NS_BEGIN | |||
| 14 | struct StringTools | 14 | struct StringTools |
| 15 | { | 15 | { |
| 16 | 16 | ||
| 17 | typedef CppUnitVector<std::string> Strings; | 17 | typedef std::vector<std::string> Strings; |
| 18 | 18 | ||
| 19 | static std::string CPPUNIT_API toString( int value ); | 19 | static std::string CPPUNIT_API toString( int value ); |
| 20 | 20 | ||
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 | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z | 8 | #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z |
| 9 | #endif | 9 | #endif |
| 10 | 10 | ||
| 11 | #include <cppunit/portability/CppUnitDeque.h> | 11 | #include <deque> |
| 12 | #include <string> | 12 | #include <string> |
| 13 | 13 | ||
| 14 | 14 | ||
| @@ -131,10 +131,10 @@ private: | |||
| 131 | std::string m_name; | 131 | std::string m_name; |
| 132 | std::string m_content; | 132 | std::string m_content; |
| 133 | 133 | ||
| 134 | typedef CppUnitDeque<Attribute> Attributes; | 134 | typedef std::deque<Attribute> Attributes; |
| 135 | Attributes m_attributes; | 135 | Attributes m_attributes; |
| 136 | 136 | ||
| 137 | typedef CppUnitDeque<XmlElement *> Elements; | 137 | typedef std::deque<XmlElement *> Elements; |
| 138 | Elements m_elements; | 138 | Elements m_elements; |
| 139 | }; | 139 | }; |
| 140 | 140 | ||
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 | |||
| @@ -86,6 +86,12 @@ protected: | |||
| 86 | virtual void wait( bool doWait ); | 86 | virtual void wait( bool doWait ); |
| 87 | virtual void printResult( bool doPrintResult ); | 87 | virtual void printResult( bool doPrintResult ); |
| 88 | 88 | ||
| 89 | private: | ||
| 90 | // prohibit copying | ||
| 91 | TextTestRunner( const TextTestRunner& ); | ||
| 92 | // prohibit copying | ||
| 93 | TextTestRunner& operator=( const TextTestRunner& ); | ||
| 94 | |||
| 89 | TestResultCollector *m_result; | 95 | TestResultCollector *m_result; |
| 90 | TestResult *m_eventManager; | 96 | TestResult *m_eventManager; |
| 91 | Outputter *m_outputter; | 97 | Outputter *m_outputter; |
Swift