From ba89c6399c7d19779f541ca38e3fa662a4dfd533 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 3 May 2014 17:34:58 -0700 Subject: [PATCH] "Undo" delete. --- test/gtest-extra-test.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/gtest-extra-test.cc b/test/gtest-extra-test.cc index fc738703..db5ff7a7 100644 --- a/test/gtest-extra-test.cc +++ b/test/gtest-extra-test.cc @@ -284,9 +284,11 @@ TEST(FileTest, CloseError) { message + "\n"); EXPECT_EQ(message, error.what()); #else + File other(".travis.yml", File::RDONLY); close(f->descriptor()); // Closing file twice causes death on Windows. EXPECT_DEATH(f->close(), ""); + other.dup2(f->descriptor()); // "undo" close or delete will fail delete f; #endif }