diff options
author | 2017-02-05 16:01:50 +0100 | |
---|---|---|
committer | 2017-02-05 16:06:06 +0100 | |
commit | ac096aa2a0921efde96b76252dffb119dcf27efc (patch) | |
tree | 2ad9a28a7f6babce8cfcbf5995e3e055ff13ff60 /3rdparty/sol2/Catch/projects/SelfTest/ToStringWhich.cpp | |
parent | 29df715138452ee18ba19ec4b07e18c4b3185de7 (diff) |
Update sol2 (nw)
Diffstat (limited to '3rdparty/sol2/Catch/projects/SelfTest/ToStringWhich.cpp')
-rw-r--r-- | 3rdparty/sol2/Catch/projects/SelfTest/ToStringWhich.cpp | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/3rdparty/sol2/Catch/projects/SelfTest/ToStringWhich.cpp b/3rdparty/sol2/Catch/projects/SelfTest/ToStringWhich.cpp deleted file mode 100644 index 1d4aa892581..00000000000 --- a/3rdparty/sol2/Catch/projects/SelfTest/ToStringWhich.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include "catch.hpp" -/* - Demonstrate which version of toString/StringMaker is being used - for various types -*/ - - -struct has_toString { }; -struct has_maker {}; -struct has_maker_and_toString {}; - -namespace Catch { - inline std::string toString( const has_toString& ) { - return "toString( has_toString )"; - } - inline std::string toString( const has_maker_and_toString& ) { - return "toString( has_maker_and_toString )"; - } - template<> - struct StringMaker<has_maker> { - static std::string convert( const has_maker& ) { - return "StringMaker<has_maker>"; - } - }; - template<> - struct StringMaker<has_maker_and_toString> { - static std::string convert( const has_maker_and_toString& ) { - return "StringMaker<has_maker_and_toString>"; - } - }; -} - -// Call the overload -TEST_CASE( "toString( has_toString )", "[toString]" ) { - has_toString item; - REQUIRE( Catch::toString( item ) == "toString( has_toString )" ); -} - -// Call the overload -TEST_CASE( "toString( has_maker )", "[toString]" ) { - has_maker item; - REQUIRE( Catch::toString( item ) == "StringMaker<has_maker>" ); -} - -// Call the overload -TEST_CASE( "toString( has_maker_and_toString )", "[toString]" ) { - has_maker_and_toString item; - REQUIRE( Catch::toString( item ) == "toString( has_maker_and_toString )" ); -} - -// Vectors... -TEST_CASE( "toString( vectors<has_toString )", "[toString]" ) { - std::vector<has_toString> v(1); - // This invokes template<T> toString which actually gives us '{ ? }' - REQUIRE( Catch::toString( v ) == "{ {?} }" ); -} - -TEST_CASE( "toString( vectors<has_maker )", "[toString]" ) { - std::vector<has_maker> v(1); - REQUIRE( Catch::toString( v ) == "{ StringMaker<has_maker> }" ); -} - - -TEST_CASE( "toString( vectors<has_maker_and_toString )", "[toString]" ) { - std::vector<has_maker_and_toString> v(1); - // Note: This invokes the template<T> toString -> StringMaker - REQUIRE( Catch::toString( v ) == "{ StringMaker<has_maker_and_toString> }" ); -} |