From 440a47011fc5052d15f82a82f8704fc5320f67f7 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 4 Jan 2014 19:12:05 +0000 Subject: [PATCH] Convert pointers to integrates when printing. - handles function pointers that way too (otherwise printed as 1 by gcc and clang) --- include/internal/catch_tostring.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/internal/catch_tostring.hpp b/include/internal/catch_tostring.hpp index cec4cfed..ae78e1f9 100644 --- a/include/internal/catch_tostring.hpp +++ b/include/internal/catch_tostring.hpp @@ -95,7 +95,7 @@ struct StringMaker { if( !p ) return INTERNAL_CATCH_STRINGIFY( NULL ); std::ostringstream oss; - oss << p; + oss << "0x" << std::hex << reinterpret_cast( p ); return oss.str(); } };