From abf858b7bd926c804e12bef59eaa4966efac17d5 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 15 Feb 2022 19:47:06 +0100 Subject: [PATCH] [mac] Turn on TestTCP (#15197) --- src/inet/TCPEndPointImplSockets.cpp | 5 +++++ src/transport/raw/tests/BUILD.gn | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/inet/TCPEndPointImplSockets.cpp b/src/inet/TCPEndPointImplSockets.cpp index d5d41fcc98afa1..f542d6d46fd3fd 100644 --- a/src/inet/TCPEndPointImplSockets.cpp +++ b/src/inet/TCPEndPointImplSockets.cpp @@ -1134,7 +1134,12 @@ CHIP_ERROR TCPEndPointImplSockets::CheckConnectionProgress(bool & isProgressing) // Fetch the bytes pending successful transmission in the TCP out queue. +#ifdef __APPLE__ + socklen_t len = sizeof(currPendingBytesRaw); + if (getsockopt(mSocket, SOL_SOCKET, SO_NWRITE, &currPendingBytesRaw, &len) < 0) +#else if (ioctl(mSocket, TIOCOUTQ, &currPendingBytesRaw) < 0) +#endif { return CHIP_ERROR_POSIX(errno); } diff --git a/src/transport/raw/tests/BUILD.gn b/src/transport/raw/tests/BUILD.gn index ae606987ed5b7d..9a78e82a56a7fe 100644 --- a/src/transport/raw/tests/BUILD.gn +++ b/src/transport/raw/tests/BUILD.gn @@ -42,12 +42,9 @@ chip_test_suite("tests") { test_sources = [ "TestMessageHeader.cpp", "TestPeerAddress.cpp", + "TestTCP.cpp", ] - if (current_os != "mac") { - test_sources += [ "TestTCP.cpp" ] - } - public_deps = [ ":helpers", "${chip_root}/src/inet/tests:helpers",