diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2023-11-21 21:43:03 +0300 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2023-11-21 21:45:26 +0300 |
commit | 3cbbf9192abdc9183eb215b5e8b06c778e5c2214 (patch) | |
tree | 44db270715ffcdfdf3c099a61d5b3c5e0106dd25 /lib | |
parent | 57b97ecb40caeb116c22451bbdaaa9a1d12c0b43 (diff) | |
parent | 3ece0e85f679c23d2a5128993846c58a2f5f890e (diff) | |
download | linux-3cbbf9192abdc9183eb215b5e8b06c778e5c2214.tar.xz |
Merge branch 'selftests-bpf-update-multiple-prog_tests-to-use-assert_-macros'
Yuran Pereira says:
====================
selftests/bpf: Update multiple prog_tests to use ASSERT_ macros
Multiple files/programs in `tools/testing/selftests/bpf/prog_tests/` still
heavily use the `CHECK` macro, even when better `ASSERT_` alternatives are
available.
As it was already pointed out by Yonghong Song [1] in the bpf selftests the use
of the ASSERT_* series of macros is preferred over the CHECK macro.
This patchset replaces the usage of `CHECK(` macros to the equivalent `ASSERT_`
family of macros in the following prog_tests:
- bind_perm.c
- bpf_obj_id.c
- bpf_tcp_ca.c
- vmlinux.c
[1] https://lore.kernel.org/lkml/0a142924-633c-44e6-9a92-2dc019656bf2@linux.dev
Changes in v3:
- Addressed the following points mentioned by Yonghong Song
- Improved `bpf_map_lookup_elem` assertion in bpf_tcp_ca.
- Replaced assertion introduced in v2 with one that checks `thread_ret`
instead of `pthread_join`. This ensures that `server`'s return value
(thread_ret) is the one being checked, as oposed to `pthread_join`'s
return value, since the latter one is less likely to fail.
Changes in v2:
- Fixed pthread_join assertion that broke the previous test
Previous version:
v2 - https://lore.kernel.org/lkml/GV1PR10MB6563AECF8E94798A1E5B36A4E8B6A@GV1PR10MB6563.EURPRD10.PROD.OUTLOOK.COM
v1 - https://lore.kernel.org/lkml/GV1PR10MB6563FCFF1C5DEBE84FEA985FE8B0A@GV1PR10MB6563.EURPRD10.PROD.OUTLOOK.COM
====================
Link: https://lore.kernel.org/r/GV1PR10MB6563BEFEA4269E1DDBC264B1E8BBA@GV1PR10MB6563.EURPRD10.PROD.OUTLOOK.COM
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions