Commit a62ff6ec authored by Joe Loser's avatar Joe Loser Committed by Facebook Github Bot

IP_RECVERR is not defined on Mac (#899)

Summary:
Problem:
- `IP_RECVERR` symbol is not defined on Mac OS.
- A test expects this symbol to be found. But, in the case on Mac OS, the symbol is not found and hence will cause a hard compiler error.

Solution:
- `ifdef` the portion of the test that is relying on this symbol.
Pull Request resolved: https://github.com/facebook/folly/pull/899

Differential Revision: D9140373

Pulled By: yfeldblum

fbshipit-source-id: 127ab352cea790194171376ac809c23249883251
parent e1b05e78
......@@ -26,6 +26,7 @@
#include <folly/io/async/EventBase.h>
#include <folly/portability/GMock.h>
#include <folly/portability/GTest.h>
#include <folly/portability/Sockets.h>
using folly::AsyncTimeout;
using folly::AsyncUDPServerSocket;
......@@ -530,6 +531,7 @@ TEST_F(AsyncUDPSocketTest, TestErrToNonExistentServer) {
socket_->setErrMessageCallback(&err);
folly::SocketAddress addr("127.0.0.1", 10000);
bool errRecvd = false;
#ifdef FOLLY_HAVE_MSG_ERRQUEUE
EXPECT_CALL(err, errMessage_(_))
.WillOnce(Invoke([this, &errRecvd](auto& cmsg) {
if ((cmsg.cmsg_level == SOL_IP && cmsg.cmsg_type == IP_RECVERR) ||
......@@ -543,6 +545,7 @@ TEST_F(AsyncUDPSocketTest, TestErrToNonExistentServer) {
}
evb_.terminateLoopSoon();
}));
#endif // FOLLY_HAVE_MSG_ERRQUEUE
socket_->write(addr, folly::IOBuf::copyBuffer("hey"));
evb_.loopForever();
EXPECT_TRUE(errRecvd);
......
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