Skip to content

Commit

Permalink
tests: socket: socketpair: assert recvfrom returns >= 0
Browse files Browse the repository at this point in the history
Fixes #25731
Coverity-CID: 210568

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
  • Loading branch information
cfriedt authored and carlescufi committed Jun 3, 2020
1 parent 195a536 commit 15a2a6d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/net/socket/socketpair/src/test_socketpair_happy_path.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ static void happy_path(

res = recvfrom(sv[(!i) & 1], actual_msg, sizeof(actual_msg), 0,
NULL, &len);

zassert_not_equal(res, -1, "recvfrom(2) failed: %d", errno);
zassert_true(res >= 0, "recvfrom(2) failed: %d", errno);
actual_msg_len = res;
zassert_equal(actual_msg_len, expected_msg_len,
"wrong return value");
Expand Down

0 comments on commit 15a2a6d

Please sign in to comment.