Lines Matching +full:protocol +full:- +full:tests
1 // SPDX-License-Identifier: GPL-2.0
15 int protocol; member
18 * -foo = error foo
22 /* If non-zero, accept EAFNOSUPPORT to handle the case
23 * of the protocol not being configured into the kernel.
28 static struct socket_testcase tests[] = { variable
29 { AF_MAX, 0, 0, -EAFNOSUPPORT, 0 },
31 { AF_INET, SOCK_DGRAM, IPPROTO_TCP, -EPROTONOSUPPORT, 1 },
33 { AF_INET, SOCK_STREAM, IPPROTO_UDP, -EPROTONOSUPPORT, 1 },
45 for (i = 0; i < ARRAY_SIZE(tests); i++) { in run_tests()
46 struct socket_testcase *s = &tests[i]; in run_tests()
49 fd = socket(s->domain, s->type, s->protocol); in run_tests()
51 if (s->nosupport_ok && in run_tests()
55 if (s->expect < 0 && in run_tests()
56 errno == -s->expect) in run_tests()
59 strerror_r(-s->expect, err_string1, ERR_STRING_SZ); in run_tests()
64 s->domain, s->type, s->protocol, in run_tests()
67 err = -1; in run_tests()
72 if (s->expect < 0) { in run_tests()
77 s->domain, s->type, s->protocol, in run_tests()
80 err = -1; in run_tests()