Try workaround for a bogus Coverity warning

This commit is contained in:
vitaut 2015-10-20 07:22:38 -07:00
parent a68ce59c74
commit 221dd0cb66

View File

@ -168,6 +168,7 @@ TEST(BufferedFileTest, Fileno) {
BufferedFile f; BufferedFile f;
#ifndef __COVERITY__ #ifndef __COVERITY__
// fileno on a null FILE pointer either crashes or returns an error. // fileno on a null FILE pointer either crashes or returns an error.
// Disable Coverity because this is intentional.
EXPECT_DEATH_IF_SUPPORTED({ EXPECT_DEATH_IF_SUPPORTED({
try { try {
f.fileno(); f.fileno();
@ -326,7 +327,8 @@ TEST(FileTest, Dup) {
} }
TEST(FileTest, DupError) { TEST(FileTest, DupError) {
EXPECT_SYSTEM_ERROR_NOASSERT(File::dup(-1), volatile int value = -1;
EXPECT_SYSTEM_ERROR_NOASSERT(File::dup(value),
EBADF, "cannot duplicate file descriptor -1"); EBADF, "cannot duplicate file descriptor -1");
} }