commit | f7777e8554dd5a5d5364751b60957efc4ae9ba9a | [log] [tgz] |
---|---|---|
author | Howard Hinnant <hhinnant@apple.com> | Tue Jul 16 23:50:06 2013 +0000 |
committer | Howard Hinnant <hhinnant@apple.com> | Tue Jul 16 23:50:06 2013 +0000 |
tree | 3fb59a15b155db4bfbf334d02303516f5fb10f54 | |
parent | 206f6cdc3328959aed4ece29ad65d8320da246f2 [diff] |
Add pointer format test for Windows. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186472 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.pass.cpp b/test/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.pass.cpp index fe420a5..114bba9 100644 --- a/test/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.pass.cpp +++ b/test/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.pass.cpp
@@ -63,8 +63,14 @@ std::ostream os(&sb); const void* n = 0; os << n; - assert(sb.str() == "0x0" || sb.str() == "(nil)"); assert(os.good()); + // %p is implementation defined. + // On some platforms (Windows), it's a hex number without + // any leading 0x like prefix. + // In that format, we assume a null pointer will yield 2 '0' hex digits + // for each 8 bits of address space. + assert(sb.str() == "0x0" || sb.str() == "(nil)" || + sb.str() == std::string(sizeof(void*)*2,'0')); } { testbuf<char> sb;