Add overload to 'print' void* correctly

This commit is contained in:
Malcolm Noyes 2014-01-23 10:36:40 +00:00
parent ba3408b2dc
commit 5cddabdc9c
2 changed files with 17 additions and 0 deletions

View File

@ -79,6 +79,19 @@ namespace Detail {
} }
}; };
// For display purposes only.
// Anything implicitly convertible to void* ends up here
inline std::string rawMemoryToString(void* p)
{
std::ostringstream oss;
#ifdef _MSC_VER
oss << "0x" << p;
#else
oss << p;
#endif
return oss.str();
}
// For display purposes only. // For display purposes only.
// Does not consider endian-ness // Does not consider endian-ness
template<typename T> template<typename T>

View File

@ -498,7 +498,9 @@ def approveXml( baseName, args ):
f = open( rawResultsPath, 'r' ) f = open( rawResultsPath, 'r' )
for line in f: for line in f:
xml += line xml += line
f.close()
#xml = xml.replace("<hex digits>", "&lt;hex digits&gt;") #xml = xml.replace("<hex digits>", "&lt;hex digits&gt;")
os.remove( rawResultsPath )
otherResultsTestParser = re.compile( r'(.*\\)(.*\..pp)' ) otherResultsTestParser = re.compile( r'(.*\\)(.*\..pp)' )
hexParser = re.compile( r'(.*)\b(0[xX][0-9a-fA-F]+)\b(.*)' ) hexParser = re.compile( r'(.*)\b(0[xX][0-9a-fA-F]+)\b(.*)' )
@ -743,6 +745,8 @@ def approveMsTest( baseName, filter ):
if line.startswith("Results file:") or line.startswith("Results File:"): if line.startswith("Results file:") or line.startswith("Results File:"):
trxFile = line[13:].strip() trxFile = line[13:].strip()
parseTrxFile(baseName, trxFile) parseTrxFile(baseName, trxFile)
f.close()
os.remove( rawResultsPath )
# Standard console reporter # Standard console reporter
approve( "console.std", ["~_"] ) approve( "console.std", ["~_"] )