mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 15:21:54 +00:00
Make Coverity happy
This commit is contained in:
parent
7e12c5c9df
commit
5b8d0a7aa9
@ -1447,12 +1447,14 @@ TEST(FormatterTest, FormatExamples) {
|
|||||||
|
|
||||||
const char *filename = "nonexistent";
|
const char *filename = "nonexistent";
|
||||||
FILE *ftest = safe_fopen(filename, "r");
|
FILE *ftest = safe_fopen(filename, "r");
|
||||||
|
if (ftest) fclose(ftest);
|
||||||
int error_code = errno;
|
int error_code = errno;
|
||||||
EXPECT_TRUE(ftest == 0);
|
EXPECT_TRUE(ftest == 0);
|
||||||
EXPECT_SYSTEM_ERROR({
|
EXPECT_SYSTEM_ERROR({
|
||||||
FILE *f = safe_fopen(filename, "r");
|
FILE *f = safe_fopen(filename, "r");
|
||||||
if (!f)
|
if (!f)
|
||||||
throw fmt::SystemError(errno, "Cannot open file '{}'", filename);
|
throw fmt::SystemError(errno, "Cannot open file '{}'", filename);
|
||||||
|
fclose(f);
|
||||||
}, error_code, "Cannot open file 'nonexistent'");
|
}, error_code, "Cannot open file 'nonexistent'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user