aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexanderduyck@fb.com>2020-11-03 13:35:04 -0800
committerAlexei Starovoitov <ast@kernel.org>2020-11-03 17:52:37 -0800
commitd3813ea14b696053c076123239093822b527f0f7 (patch)
tree97fc51c0063ed458ae434635cb1bd75572e09e65 /tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c
parent247f0ec361b7e0c5c67db8222873182fb8be5146 (diff)
selftests/bpf: Replace EXPECT_EQ with ASSERT_EQ and refactor verify_results
There is already logic in test_progs.h for asserting that a value is expected to be another value. So instead of reinventing it we should just make use of ASSERT_EQ in tcpbpf_user.c. This will allow for better debugging and integrates much more closely with the test_progs framework. In addition we can refactor the code a bit to merge together the two verify functions and tie them together into a single function. Doing this helps to clean the code up a bit and makes it more readable as all the verification is now done in one function. Lastly we can relocate the verification to the end of the run_test since it is logically part of the test itself. With this we can drop the need for a return value from run_test since verification becomes the last step of the call and then immediately following is the tear down of the test setup. Signed-off-by: Alexander Duyck <alexanderduyck@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/160443930408.1086697.16101205859962113000.stgit@localhost.localdomain
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c')
0 files changed, 0 insertions, 0 deletions