Commit 7da4ef82 authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

suppress warnings in tests for deprecated functions

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
parent 4bfbe0a1
......@@ -141,7 +141,12 @@ TEST(Promise, setException) {
{
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));
FOLLY_POP_WARNING
EXPECT_THROW(f.value(), eggs_t);
}
{
......
......@@ -43,6 +43,10 @@ TEST(Shell, Shellify) {
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");
......@@ -58,3 +62,4 @@ TEST(Shell, Shellify_deprecated) {
command = shellify("ls {}", "blah'; rm -rf /");
EXPECT_EQ(command[2], "ls 'blah'\\''; rm -rf /'");
}
FOLLY_POP_WARNING
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment