Skip to content

Commit

Permalink
selftests/bpf: Clean up dynptr prog_tests
Browse files Browse the repository at this point in the history
Clean up prog_tests/dynptr.c by removing the unneeded "expected_err_msg"
in the dynptr_tests struct, which is a remnant from converting the fail
tests cases to use the generic verification tester.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Link: https://lore.kernel.org/r/20230214051332.4007131-2-joannelkoong@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
  • Loading branch information
Joanne Koong authored and Alexei Starovoitov committed Feb 14, 2023
1 parent 8032cad commit 50a7ced
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions tools/testing/selftests/bpf/prog_tests/dynptr.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
#include "dynptr_fail.skel.h"
#include "dynptr_success.skel.h"

static struct {
const char *prog_name;
const char *expected_err_msg;
} dynptr_tests[] = {
/* success cases */
{"test_read_write", NULL},
{"test_data_slice", NULL},
{"test_ringbuf", NULL},
static const char * const success_tests[] = {
"test_read_write",
"test_data_slice",
"test_ringbuf",
};

static void verify_success(const char *prog_name)
Expand Down Expand Up @@ -53,11 +49,11 @@ void test_dynptr(void)
{
int i;

for (i = 0; i < ARRAY_SIZE(dynptr_tests); i++) {
if (!test__start_subtest(dynptr_tests[i].prog_name))
for (i = 0; i < ARRAY_SIZE(success_tests); i++) {
if (!test__start_subtest(success_tests[i]))
continue;

verify_success(dynptr_tests[i].prog_name);
verify_success(success_tests[i]);
}

RUN_TESTS(dynptr_fail);
Expand Down

0 comments on commit 50a7ced

Please sign in to comment.