Suppress an abort in FileUtilTest under MSVC
authorChristopher Dykes <cdykes@fb.com>
Thu, 25 Aug 2016 21:53:29 +0000 (14:53 -0700)
committerFacebook Github Bot 4 <facebook-github-bot-4-bot@fb.com>
Thu, 25 Aug 2016 22:08:57 +0000 (15:08 -0700)
Summary: Because MSVC is right, this shouldn't be happening, but we test weird things.

Reviewed By: yfeldblum

Differential Revision: D3773486

fbshipit-source-id: 50f28bf0ac8ff53f63231b4f6f9ce050b509b464

folly/test/FileUtilTest.cpp

index 6a63b33cedee020a6bc8dee868acdf1779d4da87..6526efa2facb5e81b3a6540e8b037f3e6ba3d9a4 100644 (file)
@@ -335,7 +335,9 @@ TEST_F(ReadFileFd, InvalidFd) {
   File f(aFile.path().string());
   f.close();
   std::string contents;
-  EXPECT_FALSE(readFile(f.fd(), contents));
+  msvcSuppressAbortOnInvalidParams([&] {
+    EXPECT_FALSE(readFile(f.fd(), contents));
+  });
   PLOG(INFO);
 }
 }}  // namespaces