examples/usrsocktest: Fix error: variable 'ret' set but not used

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2024-05-24 21:28:14 +08:00 committed by Alan Carvalho de Assis
parent 90a745b520
commit 2d4233c825
17 changed files with 40 additions and 40 deletions

View File

@ -506,25 +506,25 @@ TEST_TEAR_DOWN(basic_daemon)
if (sd >= 0)
{
ret = close(sd);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
if (sd2 >= 0)
{
ret = close(sd2);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
if (sd3 >= 0)
{
ret = close(sd3);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
if (started)
{
ret = usrsocktest_daemon_stop();
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
}
}

View File

@ -239,13 +239,13 @@ TEST_TEAR_DOWN(basic_getsockname)
if (sd >= 0)
{
ret = close(sd);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
if (started)
{
ret = usrsocktest_daemon_stop();
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
}
}

View File

@ -218,13 +218,13 @@ TEST_TEAR_DOWN(basic_getsockopt)
if (sd >= 0)
{
ret = close(sd);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
if (started)
{
ret = usrsocktest_daemon_stop();
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
}
}

View File

@ -295,13 +295,13 @@ TEST_TEAR_DOWN(basic_send)
if (sd >= 0)
{
ret = close(sd);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
if (started)
{
ret = usrsocktest_daemon_stop();
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
}
}

View File

@ -186,13 +186,13 @@ TEST_TEAR_DOWN(basic_setsockopt)
if (sd >= 0)
{
ret = close(sd);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
if (started)
{
ret = usrsocktest_daemon_stop();
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
}
}

View File

@ -563,13 +563,13 @@ TEST_TEAR_DOWN(block_recv)
if (sd >= 0)
{
ret = close(sd);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
if (started)
{
ret = usrsocktest_daemon_stop();
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
}
}

View File

@ -362,13 +362,13 @@ TEST_TEAR_DOWN(block_send)
if (sd >= 0)
{
ret = close(sd);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
if (started)
{
ret = usrsocktest_daemon_stop();
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
}
}

View File

@ -102,13 +102,13 @@ TEST_TEAR_DOWN(char_dev)
if (us_fd >= 0)
{
ret = close(us_fd);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
if (us_fd_two >= 0)
{
ret = close(us_fd_two);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
}

View File

@ -278,13 +278,13 @@ static FAR void *find_endpoint(FAR struct daemon_priv_s *priv,
endpaddr = malloc(sizeof(*endpaddr));
usrsocktest_endp_malloc_cnt++;
assert(endpaddr);
DEBUGASSERT(endpaddr != NULL);
ok = inet_pton(AF_INET, priv->conf->endpoint_addr,
&endpaddr->sin_addr.s_addr);
endpaddr->sin_family = AF_INET;
endpaddr->sin_port = htons(priv->conf->endpoint_port);
assert(ok);
DEBUGASSERT(ok);
if (endpaddr->sin_addr.s_addr == ipaddr)
{
@ -1600,8 +1600,8 @@ static int handle_usrsock_request(int fd, FAR struct daemon_priv_s *priv)
return -EIO;
}
assert(handlers[common_hdr->reqid].hdrlen <
(sizeof(hdrbuf) - sizeof(*common_hdr)));
DEBUGASSERT(handlers[common_hdr->reqid].hdrlen <
sizeof(hdrbuf) - sizeof(*common_hdr));
rlen = read_req(fd, common_hdr, hdrbuf,
handlers[common_hdr->reqid].hdrlen);

View File

@ -152,9 +152,9 @@ TEST_TEAR_DOWN(multithread)
if (tids[i] != -1)
{
ret = pthread_cancel(tids[i]);
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
ret = pthread_join(tids[i], NULL);
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
}
}
@ -163,14 +163,14 @@ TEST_TEAR_DOWN(multithread)
if (sds[i] != -1)
{
ret = close(sds[i]);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
}
if (started)
{
ret = usrsocktest_daemon_stop();
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
}
}

View File

@ -77,19 +77,19 @@ TEST_TEAR_DOWN(no_block_connect)
if (sd >= 0)
{
ret = close(sd);
assert(ret == 0);
TEST_ASSERT_EQUAL(ret, 0);
}
if (sd2 >= 0)
{
ret = close(sd2);
assert(ret == 0);
TEST_ASSERT_EQUAL(ret, 0);
}
if (started)
{
ret = usrsocktest_daemon_stop();
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
}
}

View File

@ -465,13 +465,13 @@ TEST_TEAR_DOWN(no_block_recv)
if (sd >= 0)
{
ret = close(sd);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
if (started)
{
ret = usrsocktest_daemon_stop();
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
}
}

View File

@ -355,13 +355,13 @@ TEST_TEAR_DOWN(no_block_send)
if (sd >= 0)
{
ret = close(sd);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
if (started)
{
ret = usrsocktest_daemon_stop();
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
}
}

View File

@ -100,7 +100,7 @@ TEST_TEAR_DOWN(no_daemon)
if (sd >= 0)
{
ret = close(sd);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
}

View File

@ -574,13 +574,13 @@ TEST_TEAR_DOWN(poll)
if (sd >= 0)
{
ret = close(sd);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
if (started)
{
ret = usrsocktest_daemon_stop();
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
}
}

View File

@ -977,13 +977,13 @@ TEST_TEAR_DOWN(remote_disconnect)
if (sd >= 0)
{
ret = close(sd);
assert(ret >= 0);
TEST_ASSERT_TRUE(ret >= 0);
}
if (started)
{
ret = usrsocktest_daemon_stop();
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
}
}

View File

@ -656,9 +656,9 @@ TEST_TEAR_DOWN(wake_with_signal)
if (tid[i] != -1)
{
ret = pthread_cancel(tid[i]);
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
ret = pthread_join(tid[i], NULL);
assert(ret == OK);
TEST_ASSERT_EQUAL(ret, OK);
}
if (test_sd[i] != -1)