test: fix sign comparison warning in socket tests

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.
This commit is contained in:
fanquake 2021-02-12 10:12:00 +08:00
parent 937dfa8398
commit 9cc8e30125
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

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);