9 progname = getexecname();
10 return progname == NULL;
12 #endif /* TEST_GETEXECNAME */
19 const char * progname;
21 progname = getprogname();
22 return progname == NULL;
24 #endif /* TEST_GETPROGNAME */
33 event_set(&ev, 0, EV_READ, NULL, NULL);
38 #endif /* TEST_LIBEVENT */
40 #include <event2/event.h>
41 #include <event2/event_compat.h>
42 #include <event2/event_struct.h>
43 #include <event2/buffer.h>
44 #include <event2/buffer_compat.h>
45 #include <event2/bufferevent.h>
46 #include <event2/bufferevent_struct.h>
47 #include <event2/bufferevent_compat.h>
54 event_set(&ev, 0, EV_READ, NULL, NULL);
59 #endif /* TEST_LIBEVENT2 */
61 #include <sys/socket.h>
68 c = socketpair(AF_UNIX, SOCK_STREAM, 0, fds);
71 #endif /* TEST_LIB_SOCKET */
78 return !!pledge("stdio", NULL);
80 #endif /* TEST_PLEDGE */
81 #if TEST_PROGRAM_INVOCATION_SHORT_NAME
82 #define _GNU_SOURCE /* See feature_test_macros(7) */
89 return !program_invocation_short_name;
91 #endif /* TEST_PROGRAM_INVOCATION_SHORT_NAME */
93 #include <sys/prctl.h>
98 prctl(PR_SET_NAME, "foo");
101 #endif /* TEST_PR_SET_NAME */
103 #include <sys/socket.h>
108 int src = 0, dst = 1;
111 * invalid usage, i'm only interested in checking if it
114 setsockopt(src, SOL_SOCKET, SO_SPLICE, &dst, sizeof(int));
117 #endif /* TEST_SO_SPLICE */
122 return 0; /* not meant to do anything */
124 #endif /* TEST_STATIC */
132 return ! (strlcat(buf, "b", sizeof(buf)) == 2 &&
133 buf[0] == 'a' && buf[1] == 'b' && buf[2] == '\0');
135 #endif /* TEST_STRLCAT */
143 return ! (strlcpy(buf, "a", sizeof(buf)) == 1 &&
144 buf[0] == 'a' && buf[1] == '\0');
146 #endif /* TEST_STRLCPY */
149 * Copyright (c) 2015 Ingo Schwarze <schwarze@openbsd.org>
151 * Permission to use, copy, modify, and distribute this software for any
152 * purpose with or without fee is hereby granted, provided that the above
153 * copyright notice and this permission notice appear in all copies.
155 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
156 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
157 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
158 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
159 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
160 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
161 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
164 # define _OPENBSD_SOURCE
173 if (strtonum("1", 0, 2, &errstr) != 1)
177 if (strtonum("1x", 0, 2, &errstr) != 0)
181 if (strtonum("2", 0, 1, &errstr) != 0)
185 if (strtonum("0", 1, 2, &errstr) != 0)
191 #endif /* TEST_STRTONUM */
198 return -1 != unveil(NULL, NULL);
200 #endif /* TEST_UNVEIL */
207 #endif /* TEST_NOOP */
212 extern char *__progname;
216 #endif /* TEST___PROGNAME */