X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Ftest%2FFormatOtherTest.cpp;h=427d01d7b883cf7448327cbc6eba78c21f72cab3;hb=7bf1486094cccb266e789a378d8e5f91e3cb7780;hp=466d3c6594b0175f69e08d40c9c468d5b547853e;hpb=6a6ac91e1fda65d7871390f03be8d19b3591ba45;p=folly.git diff --git a/folly/test/FormatOtherTest.cpp b/folly/test/FormatOtherTest.cpp index 466d3c65..427d01d7 100644 --- a/folly/test/FormatOtherTest.cpp +++ b/folly/test/FormatOtherTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2016 Facebook, Inc. + * Copyright 2015-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,11 @@ #include #include +#include #include #include -#include #include +#include 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); @@ -89,7 +96,7 @@ void testFormatSeq() { EXPECT_EQ("10 20 0030", svformat("{} {} {:04}", v)); } -} // namespace +} // namespace TEST(FormatOther, fbvector) { testFormatSeq>();