Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/projects/SelfTest/ToStringTuple.cpp
diff options
context:
space:
mode:
authorPhil Nash2017-11-03 12:05:38 +0000
committerPhil Nash2017-11-03 12:05:38 +0000
commit46c7c9d3a0cb975dabf5970cc65fd8fc72d4c5b5 (patch)
treef07e8d45a6f21ac8249e43f17f6fc58749d6cc51 /projects/SelfTest/ToStringTuple.cpp
parent2d91035404884089d1faf038300e437963e0c2a4 (diff)
parentb119ebdde15ae4b092f22766fcd652307b42cdf2 (diff)
downloadcatch3-46c7c9d3a0cb975dabf5970cc65fd8fc72d4c5b5.tar.gz
Merge branch 'catch2'
Diffstat (limited to 'projects/SelfTest/ToStringTuple.cpp')
-rw-r--r--projects/SelfTest/ToStringTuple.cpp44
1 files changed, 16 insertions, 28 deletions
diff --git a/projects/SelfTest/ToStringTuple.cpp b/projects/SelfTest/ToStringTuple.cpp
index fa61f631..fe19ce01 100644
--- a/projects/SelfTest/ToStringTuple.cpp
+++ b/projects/SelfTest/ToStringTuple.cpp
@@ -1,59 +1,47 @@
+#define CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER
#include "catch.hpp"
-#ifdef CATCH_CPP11_OR_GREATER
+#include <tuple>
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wc++98-compat"
-#endif
-
-TEST_CASE( "tuple<>", "[toString][tuple][c++11][.]" )
+TEST_CASE( "tuple<>", "[toString][tuple]" )
{
typedef std::tuple<> type;
- CHECK( "{ }" == Catch::toString(type{}) );
+ CHECK( "{ }" == ::Catch::Detail::stringify(type{}) );
type value {};
- CHECK( "{ }" == Catch::toString(value) );
+ CHECK( "{ }" == ::Catch::Detail::stringify(value) );
}
-TEST_CASE( "tuple<int>", "[toString][tuple][c++11][.]" )
+TEST_CASE( "tuple<int>", "[toString][tuple]" )
{
typedef std::tuple<int> type;
- CHECK( "{ 0 }" == Catch::toString(type{0}) );
+ CHECK( "{ 0 }" == ::Catch::Detail::stringify(type{0}) );
}
-TEST_CASE( "tuple<float,int>", "[toString][tuple][c++11][.]" )
+TEST_CASE( "tuple<float,int>", "[toString][tuple]" )
{
typedef std::tuple<float,int> type;
- CHECK( "1.2f" == Catch::toString(float(1.2)) );
- CHECK( "{ 1.2f, 0 }" == Catch::toString(type{1.2,0}) );
+ CHECK( "1.2f" == ::Catch::Detail::stringify(float(1.2)) );
+ CHECK( "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) );
}
-TEST_CASE( "tuple<string,string>", "[toString][tuple][c++11][.]" )
+TEST_CASE( "tuple<string,string>", "[toString][tuple]" )
{
typedef std::tuple<std::string,std::string> type;
- CHECK( "{ \"hello\", \"world\" }" == Catch::toString(type{"hello","world"}) );
+ CHECK( "{ \"hello\", \"world\" }" == ::Catch::Detail::stringify(type{"hello","world"}) );
}
-TEST_CASE( "tuple<tuple<int>,tuple<>,float>", "[toString][tuple][c++11][.]" )
+TEST_CASE( "tuple<tuple<int>,tuple<>,float>", "[toString][tuple]" )
{
typedef std::tuple<std::tuple<int>,std::tuple<>,float> type;
type value { std::tuple<int>{42}, {}, 1.2f };
- CHECK( "{ { 42 }, { }, 1.2f }" == Catch::toString(value) );
+ CHECK( "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) );
}
-#ifdef CATCH_CONFIG_CPP11_NULLPTR
-TEST_CASE( "tuple<nullptr,int,const char *>", "[toString][tuple][c++11][.]" )
+TEST_CASE( "tuple<nullptr,int,const char *>", "[toString][tuple]" )
{
typedef std::tuple<std::nullptr_t,int,const char *> type;
type value { nullptr, 42, "Catch me" };
- CHECK( "{ nullptr, 42, \"Catch me\" }" == Catch::toString(value) );
+ CHECK( "{ nullptr, 42, \"Catch me\" }" == ::Catch::Detail::stringify(value) );
}
-#endif
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-#endif /* #ifdef CATCH_CPP11_OR_GREATER */