Merge #21159: test: fix sign comparison warning in socket tests

9cc8e30125df14fe47e21e55ab3bf26f4d416565 test: fix sign comparison warning in socket tests (fanquake)

Pull request description:

  This fixes:
  ```bash
  In file included from test/sock_tests.cpp:10:
  In file included from /usr/local/include/boost/test/unit_test.hpp:18:
  In file included from /usr/local/include/boost/test/test_tools.hpp:46:
  /usr/local/include/boost/test/tools/old/impl.hpp:107:17: warning: comparison of integers of different signs: 'const long' and 'const unsigned long' [-Wsign-compare]
      return left == right;
             ~~~~ ^  ~~~~~
  ```

  which was introduced in #20788.

ACKs for top commit:
  practicalswift:
    cr ACK 9cc8e30125df14fe47e21e55ab3bf26f4d416565
  vasild:
    ACK 9cc8e30125df14fe47e21e55ab3bf26f4d416565

Tree-SHA512: 7069a4fde5cec01be03f8477fe396e53658f170efbf1d9ef3339d553bb90a2be9f4acd6b348127b14cd2f91426e0cd1fc35d2d3c9f201cf748c0cf50f47e46a5
This commit is contained in:
fanquake 2021-02-17 08:06:47 +08:00 committed by PastaPastaPasta
parent 3a59c53cad
commit 513bd84fa3

View File

@ -95,7 +95,7 @@ static void CreateSocketPair(int s[2])
static void SendAndRecvMessage(const Sock& sender, const Sock& receiver)
{
const char* msg = "abcd";
constexpr size_t msg_len = 4;
constexpr ssize_t msg_len = 4;
char recv_buf[10];
BOOST_CHECK_EQUAL(sender.Send(msg, msg_len, 0), msg_len);