Summary:
Update ShellTest and PromiseTest to suppress warnings about using deprecated
functions in the tests for those functions.
Reviewed By: yfeldblum
Differential Revision:
D6735670
fbshipit-source-id:
89edcb49d1eff3132398aaef88f5a5cae82e3557
{
Promise<Unit> p;
auto f = p.getFuture();
{
Promise<Unit> p;
auto f = p.getFuture();
+ // Calling setException() with an exception_ptr is deprecated,
+ // but don't complain about this in the test for this function.
+ FOLLY_PUSH_WARNING
+ FOLLY_GCC_DISABLE_WARNING("-Wdeprecated-declarations")
p.setException(std::make_exception_ptr(eggs));
p.setException(std::make_exception_ptr(eggs));
EXPECT_THROW(f.value(), eggs_t);
}
{
EXPECT_THROW(f.value(), eggs_t);
}
{
EXPECT_EQ(command[2], "ls 'blah'\\''; rm -rf /'");
}
EXPECT_EQ(command[2], "ls 'blah'\\''; rm -rf /'");
}
+// Tests for the deprecated shellify() function.
+// Don't warn about using this deprecated function in the test for it.
+FOLLY_PUSH_WARNING
+FOLLY_GCC_DISABLE_WARNING("-Wdeprecated-declarations")
TEST(Shell, Shellify_deprecated) {
auto command = shellify("rm -rf /");
EXPECT_EQ(command[0], "/bin/sh");
TEST(Shell, Shellify_deprecated) {
auto command = shellify("rm -rf /");
EXPECT_EQ(command[0], "/bin/sh");
command = shellify("ls {}", "blah'; rm -rf /");
EXPECT_EQ(command[2], "ls 'blah'\\''; rm -rf /'");
}
command = shellify("ls {}", "blah'; rm -rf /");
EXPECT_EQ(command[2], "ls 'blah'\\''; rm -rf /'");
}