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

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPhil Nash2017-07-19 08:16:55 +0100
committerPhil Nash2017-07-19 08:16:55 +0100
commitcd6f6c021afbd8b45de825164259fe6ce110df7d (patch)
treea833cb8c8cf565ca09851e530ca37821f33b4b75
parentb0e3f45a22d47dfa73710574a505c191baa2fb27 (diff)
downloadcatch3-cd6f6c021afbd8b45de825164259fe6ce110df7d.tar.gz
Minor clean-ups in string conversion code
-rw-r--r--include/internal/catch_tostring.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/internal/catch_tostring.h b/include/internal/catch_tostring.h
index 2828be1a..23bfa0f2 100644
--- a/include/internal/catch_tostring.h
+++ b/include/internal/catch_tostring.h
@@ -35,6 +35,9 @@ namespace Catch {
using ::operator<<;
namespace Detail {
+
+ extern const std::string unprintableString;
+
std::string rawMemoryToString( const void *object, std::size_t size );
template<typename T>
@@ -64,7 +67,7 @@ namespace Catch {
static
typename std::enable_if<::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>::type
convert(const Fake& t) {
- std::stringstream sstr;
+ std::ostringstream sstr;
sstr << t;
return sstr.str();
}
@@ -73,14 +76,12 @@ namespace Catch {
static
typename std::enable_if<!::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>::type
convert(const Fake&) {
- return "{?}";
+ return Detail::unprintableString;
}
};
namespace Detail {
- extern const std::string unprintableString;
-
// This function dispatches all stringification requests inside of Catch.
// Should be preferably called fully qualified, like ::Catch::Detail::stringify
template <typename T>