1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

UTest: Fix utest warnings.

This commit is contained in:
winlin 2022-10-05 22:33:12 +08:00
parent cfbbe3044f
commit 9c81a0e1bd
8 changed files with 603 additions and 560 deletions

View file

@ -275,22 +275,22 @@ VOID TEST(ServiceStSRTTest, ReadWrite)
// Client send msg to server.
ssize_t nb_write = 0;
HELPER_EXPECT_SUCCESS(srt_client_socket->sendmsg((char*)content.data(), content.size(), &nb_write));
EXPECT_EQ(nb_write, content.size());
EXPECT_EQ((size_t)nb_write, content.size());
// Server recv msg from client
char buf[1500];
ssize_t nb_read = 0;
HELPER_EXPECT_SUCCESS(srt_server_accepted_socket->recvmsg(buf, sizeof(buf), &nb_read));
EXPECT_EQ(nb_read, content.size());
EXPECT_EQ((size_t)nb_read, content.size());
EXPECT_EQ(std::string(buf, nb_read), content);
// Server echo msg back to client.
HELPER_EXPECT_SUCCESS(srt_server_accepted_socket->sendmsg(buf, nb_read, &nb_write));
EXPECT_EQ(nb_write, content.size());
EXPECT_EQ((size_t)nb_write, content.size());
// Client recv echo msg from server.
HELPER_EXPECT_SUCCESS(srt_client_socket->recvmsg(buf, sizeof(buf), &nb_read));
EXPECT_EQ(nb_read, content.size());
EXPECT_EQ((size_t)nb_read, content.size());
EXPECT_EQ(std::string(buf, nb_read), content);
}