diff options
author | Wang Yufen <wangyufen@huawei.com> | 2022-09-26 07:12:07 +0200 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2022-09-29 02:33:59 +0200 |
commit | a0a17296713aea7b3cbc94662c6ffb53a79a3f2c (patch) | |
tree | 9a92a5c3272d25f05fee760b7b64c5bb7a7c8486 /tools/testing/selftests | |
parent | selftests/bpf: Convert sockopt_sk test to ASSERT_* macros (diff) | |
download | linux-a0a17296713aea7b3cbc94662c6ffb53a79a3f2c.tar.xz linux-a0a17296713aea7b3cbc94662c6ffb53a79a3f2c.zip |
selftests/bpf: Convert tcp_estats test to ASSERT_* macros
Convert the selftest to use the preferred ASSERT_* macros instead of the
deprecated CHECK().
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/1664169131-32405-8-git-send-email-wangyufen@huawei.com
Diffstat (limited to 'tools/testing/selftests')
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/tcp_estats.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/tcp_estats.c b/tools/testing/selftests/bpf/prog_tests/tcp_estats.c index 032dbfb26256..e070bca2b764 100644 --- a/tools/testing/selftests/bpf/prog_tests/tcp_estats.c +++ b/tools/testing/selftests/bpf/prog_tests/tcp_estats.c @@ -6,11 +6,9 @@ void test_tcp_estats(void) const char *file = "./test_tcp_estats.bpf.o"; int err, prog_fd; struct bpf_object *obj; - __u32 duration = 0; err = bpf_prog_test_load(file, BPF_PROG_TYPE_TRACEPOINT, &obj, &prog_fd); - CHECK(err, "", "err %d errno %d\n", err, errno); - if (err) + if (!ASSERT_OK(err, "")) return; bpf_object__close(obj); |