Fix handling of volatile char (#1115)

This commit is contained in:
Victor Zverovich
2019-04-14 12:34:56 -07:00
parent bade46aae5
commit 5d755d0a4e
2 changed files with 11 additions and 5 deletions

View File

@@ -1550,6 +1550,11 @@ TEST(FormatterTest, FormatChar) {
EXPECT_EQ(fmt::format("{:02X}", n), fmt::format("{:02X}", 'x'));
}
TEST(FormatterTest, FormatVolatileChar) {
volatile char c = 'x';
EXPECT_EQ("x", format("{}", c));
}
TEST(FormatterTest, FormatUnsignedChar) {
EXPECT_EQ("42", format("{}", static_cast<unsigned char>(42)));
EXPECT_EQ("42", format("{}", static_cast<uint8_t>(42)));