Fix test.

This commit is contained in:
Victor Zverovich
2014-04-30 12:39:31 -07:00
parent 400812a905
commit 0bece94257

View File

@@ -1556,10 +1556,12 @@ TEST(FormatterTest, FormatExamples) {
EXPECT_EQ("0123456789", s); EXPECT_EQ("0123456789", s);
} }
const char *filename = "nonexistent"; EXPECT_THROW({
FILE *f = fopen(filename, "r"); const char *filename = "nonexistent";
if (!f) FILE *f = fopen(filename, "r");
fmt::ThrowSystemError(errno, "Cannot open file '{}'") << filename; if (!f)
fmt::ThrowSystemError(errno, "Cannot open file '{}'") << filename;
}, fmt::SystemError);
} }
TEST(FormatterTest, StrNamespace) { TEST(FormatterTest, StrNamespace) {