folly/test/TimeseriesTest.cpp: avoid shadowing warnings
[folly.git] / folly / test / SubprocessTest.cpp
index 66b1831957420556ca4c514deb3aaa919c65dcf7..b3a0cf6de7f14113739308c5c406756ca78766f4 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.
@@ -33,6 +33,8 @@
 #include <folly/portability/GTest.h>
 #include <folly/portability/Unistd.h>
 
+FOLLY_GCC_DISABLE_WARNING(deprecated-declarations)
+
 using namespace folly;
 
 TEST(SimpleSubprocessTest, ExitsSuccessfully) {
@@ -197,7 +199,7 @@ TEST(SimpleSubprocessTest, FdLeakTest) {
   checkFdLeak([] {
     try {
       Subprocess proc(std::vector<std::string>({"/no/such/file"}),
-                      Subprocess::pipeStdout().stderr(Subprocess::PIPE));
+                      Subprocess::pipeStdout().stderrFd(Subprocess::PIPE));
       ADD_FAILURE() << "expected an error when running /no/such/file";
     } catch (const SubprocessSpawnError& ex) {
       EXPECT_EQ(ENOENT, ex.errnoValue());
@@ -234,7 +236,7 @@ TEST(ParentDeathSubprocessTest, ParentDeathSignal) {
 TEST(PopenSubprocessTest, PopenRead) {
   Subprocess proc("ls /", Subprocess::pipeStdout());
   int found = 0;
-  gen::byLine(File(proc.stdout())) |
+  gen::byLine(File(proc.stdoutFd())) |
     [&] (StringPiece line) {
       if (line == "etc" || line == "bin" || line == "usr") {
         ++found;