summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tobias.markmann@isode.com>2019-11-14 21:08:53 (GMT)
committerTobias Markmann <tobias.markmann@isode.com>2019-11-15 11:58:11 (GMT)
commit8230b23238b4d0ef0fcde01a799758558d502fa1 (patch)
tree849251b42e457357b86a2ba91e9b78f635cc55a3 /3rdParty/CppUnit/src/include/cppunit/tools
parentcaca46ceedddd43c707e7eda9b4c765d61730ccb (diff)
downloadswift-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/tools')
-rw-r--r--3rdParty/CppUnit/src/include/cppunit/tools/StringHelper.h45
-rw-r--r--3rdParty/CppUnit/src/include/cppunit/tools/StringTools.h4
-rw-r--r--3rdParty/CppUnit/src/include/cppunit/tools/XmlElement.h6
3 files changed, 50 insertions, 5 deletions
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
10CPPUNIT_NS_BEGIN
11
12
13/*! \brief Methods for converting values to strings. Replaces CPPUNIT_NS::StringTools::toString
14 */
15namespace 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
21template<typename T>
22typename 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
30template<typename T>
31typename 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
42CPPUNIT_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
9CPPUNIT_NS_BEGIN 9CPPUNIT_NS_BEGIN
@@ -14,7 +14,7 @@ CPPUNIT_NS_BEGIN
14struct StringTools 14struct 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