Lines Matching refs:test
149 static int test_prog_type_by_name(const struct sec_name_test *test) in test_prog_type_by_name() argument
155 rc = libbpf_prog_type_by_name(test->sec_name, &prog_type, in test_prog_type_by_name()
158 if (rc != test->expected_load.rc) { in test_prog_type_by_name()
159 warnx("prog: unexpected rc=%d for %s", rc, test->sec_name); in test_prog_type_by_name()
166 if (prog_type != test->expected_load.prog_type) { in test_prog_type_by_name()
168 test->sec_name); in test_prog_type_by_name()
172 if (expected_attach_type != test->expected_load.expected_attach_type) { in test_prog_type_by_name()
174 expected_attach_type, test->sec_name); in test_prog_type_by_name()
181 static int test_attach_type_by_name(const struct sec_name_test *test) in test_attach_type_by_name() argument
186 rc = libbpf_attach_type_by_name(test->sec_name, &attach_type); in test_attach_type_by_name()
188 if (rc != test->expected_attach.rc) { in test_attach_type_by_name()
189 warnx("attach: unexpected rc=%d for %s", rc, test->sec_name); in test_attach_type_by_name()
196 if (attach_type != test->expected_attach.attach_type) { in test_attach_type_by_name()
198 test->sec_name); in test_attach_type_by_name()
205 static int run_test_case(const struct sec_name_test *test) in run_test_case() argument
207 if (test_prog_type_by_name(test)) in run_test_case()
209 if (test_attach_type_by_name(test)) in run_test_case()