Enable -Wimplicit-fallthrough
[folly.git] / folly / test / FormatOtherTest.cpp
index 951321665dd2f213695f341d16bbc249d7cce022..a7477fe10b6ee22850ff08dd162d01b64e70fccb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <folly/Format.h>
 
 #include <glog/logging.h>
-#include <gtest/gtest.h>
 
 #include <folly/FBVector.h>
 #include <folly/FileUtil.h>
+#include <folly/Portability.h>
 #include <folly/dynamic.h>
 #include <folly/json.h>
+#include <folly/portability/GTest.h>
 #include <folly/small_vector.h>
 
 using namespace folly;
@@ -33,7 +34,13 @@ TEST(FormatOther, file) {
   {
     int fds[2];
     CHECK_ERR(pipe(fds));
-    SCOPE_EXIT { closeNoInt(fds[1]); };
+    SCOPE_EXIT {
+      // fclose on Windows automatically closes the underlying
+      // file descriptor.
+      if (!kIsWindows) {
+        closeNoInt(fds[1]);
+      }
+    };
     {
       FILE* fp = fdopen(fds[1], "wb");
       PCHECK(fp);