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) {