examples/usrsocktest: correct the check region of remote address
let us skip the sin_zero Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
a8d2924c55
commit
5b47bc24ae
@ -248,7 +248,8 @@ static void no_block_connect(FAR struct usrsocktest_daemon_conf_s *dconf)
|
||||
TEST_ASSERT_EQUAL(1, ret);
|
||||
TEST_ASSERT_EQUAL_UINT8_ARRAY("a", data, 1);
|
||||
TEST_ASSERT_EQUAL(sizeof(remoteaddr), addrlen);
|
||||
TEST_ASSERT_EQUAL_UINT8_ARRAY(&remoteaddr, &addr, addrlen);
|
||||
TEST_ASSERT_EQUAL_UINT8_ARRAY(&remoteaddr, &addr,
|
||||
addrlen - sizeof(addr.sin_zero));
|
||||
TEST_ASSERT_EQUAL(1, usrsocktest_daemon_get_num_connected_sockets());
|
||||
TEST_ASSERT_EQUAL(1, usrsocktest_daemon_get_num_active_sockets());
|
||||
TEST_ASSERT_EQUAL(6, usrsocktest_daemon_get_recv_bytes());
|
||||
@ -265,7 +266,8 @@ static void no_block_connect(FAR struct usrsocktest_daemon_conf_s *dconf)
|
||||
TEST_ASSERT_EQUAL(5, ret);
|
||||
TEST_ASSERT_EQUAL_UINT8_ARRAY("abcde", data, 5);
|
||||
TEST_ASSERT_EQUAL(sizeof(remoteaddr), addrlen);
|
||||
TEST_ASSERT_EQUAL_UINT8_ARRAY(&remoteaddr, &addr, addrlen);
|
||||
TEST_ASSERT_EQUAL_UINT8_ARRAY(&remoteaddr, &addr,
|
||||
addrlen - sizeof(addr.sin_zero));
|
||||
TEST_ASSERT_EQUAL(1, usrsocktest_daemon_get_num_connected_sockets());
|
||||
TEST_ASSERT_EQUAL(1, usrsocktest_daemon_get_num_active_sockets());
|
||||
TEST_ASSERT_EQUAL(11, usrsocktest_daemon_get_recv_bytes());
|
||||
|
@ -180,7 +180,8 @@ static void receive(struct usrsocktest_daemon_conf_s *dconf)
|
||||
TEST_ASSERT_EQUAL(3, ret);
|
||||
TEST_ASSERT_EQUAL_UINT8_ARRAY("abc", data, 3);
|
||||
TEST_ASSERT_EQUAL(addrlen, sizeof(remoteaddr));
|
||||
TEST_ASSERT_EQUAL_UINT8_ARRAY(&remoteaddr, &addr, addrlen);
|
||||
TEST_ASSERT_EQUAL_UINT8_ARRAY(&remoteaddr, &addr,
|
||||
addrlen - sizeof(addr.sin_zero));
|
||||
TEST_ASSERT_EQUAL(1, usrsocktest_daemon_get_num_connected_sockets());
|
||||
TEST_ASSERT_EQUAL(1, usrsocktest_daemon_get_num_active_sockets());
|
||||
TEST_ASSERT_EQUAL(datalen + ret, usrsocktest_daemon_get_recv_bytes());
|
||||
@ -365,7 +366,7 @@ static void delayed_connect(struct usrsocktest_daemon_conf_s *dconf)
|
||||
&addrlen);
|
||||
TEST_ASSERT_EQUAL(-1, ret);
|
||||
TEST_ASSERT_EQUAL(EAGAIN, errno);
|
||||
TEST_ASSERT_EQUAL(0, addrlen);
|
||||
TEST_ASSERT_EQUAL(sizeof(remoteaddr), addrlen);
|
||||
TEST_ASSERT_EQUAL(1, usrsocktest_daemon_get_num_connected_sockets());
|
||||
TEST_ASSERT_EQUAL(1, usrsocktest_daemon_get_num_active_sockets());
|
||||
TEST_ASSERT_EQUAL(0, usrsocktest_daemon_get_send_bytes());
|
||||
|
Loading…
Reference in New Issue
Block a user