selftests/bpf: Use ASSERT_EQ instead ASSERT_OK for testing memcmp result
authorMartin KaFai Lau <martin.lau@kernel.org>
Thu, 16 Mar 2023 00:07:25 +0000 (17:07 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 16 Mar 2023 17:12:59 +0000 (18:12 +0100)
commited01385c0d78a025bdc72128b7aa7c3309cd5852
treea662fc4dae1b9dc5b2d59e6548863dcf59cfc0bd
parent72fe61d745cb0e199448e9125d894e59508b2bb3
selftests/bpf: Use ASSERT_EQ instead ASSERT_OK for testing memcmp result

In tcp_hdr_options test, it ensures the received tcp hdr option
and the sk local storage have the expected values. It uses memcmp
to check that. Testing the memcmp result with ASSERT_OK is confusing
because ASSERT_OK will print out the errno which is not set.
This patch uses ASSERT_EQ to check for 0 instead.

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20230316000726.1016773-1-martin.lau@linux.dev
tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c