From 221dd0cb66dc00d421190138a3dc8d49b5301544 Mon Sep 17 00:00:00 2001 From: vitaut Date: Tue, 20 Oct 2015 07:22:38 -0700 Subject: [PATCH] Try workaround for a bogus Coverity warning --- test/posix-test.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/posix-test.cc b/test/posix-test.cc index ace421d4..d38c952b 100644 --- a/test/posix-test.cc +++ b/test/posix-test.cc @@ -168,6 +168,7 @@ TEST(BufferedFileTest, Fileno) { BufferedFile f; #ifndef __COVERITY__ // fileno on a null FILE pointer either crashes or returns an error. + // Disable Coverity because this is intentional. EXPECT_DEATH_IF_SUPPORTED({ try { f.fileno(); @@ -326,7 +327,8 @@ TEST(FileTest, Dup) { } 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"); }