From 05a4b4fda9d2a8780c13a991c07b7719d9cf1608 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 24 Dec 2012 12:28:54 -0800 Subject: [PATCH] Test formatting of the largest pointer --- format_test.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/format_test.cc b/format_test.cc index 6e2f49a5..fc0e4193 100644 --- a/format_test.cc +++ b/format_test.cc @@ -39,6 +39,8 @@ #include #include "format.h" +#include + using std::size_t; using std::sprintf; @@ -702,6 +704,8 @@ TEST(FormatterTest, FormatPointer) { EXPECT_EQ("0x0", str(Format("{0}") << reinterpret_cast(0))); EXPECT_EQ("0x1234", str(Format("{0}") << reinterpret_cast(0x1234))); EXPECT_EQ("0x1234", str(Format("{0:p}") << reinterpret_cast(0x1234))); + EXPECT_EQ("0x" + std::string(sizeof(void*) * CHAR_BIT / 4, 'f'), + str(Format("{0}") << reinterpret_cast(~uintptr_t()))); } TEST(FormatterTest, FormatString) {