asynctest.c revision 1.1 1 1.1 christos /*
2 1.1 christos * Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved.
3 1.1 christos *
4 1.1 christos * Licensed under the Apache License 2.0 (the "License"). You may not use
5 1.1 christos * this file except in compliance with the License. You can obtain a copy
6 1.1 christos * in the file LICENSE in the source distribution or at
7 1.1 christos * https://www.openssl.org/source/license.html
8 1.1 christos */
9 1.1 christos
10 1.1 christos #ifdef _WIN32
11 1.1 christos # include <windows.h>
12 1.1 christos #endif
13 1.1 christos
14 1.1 christos #include <stdio.h>
15 1.1 christos #include <string.h>
16 1.1 christos #include <openssl/async.h>
17 1.1 christos #include <openssl/crypto.h>
18 1.1 christos
19 1.1 christos static int ctr = 0;
20 1.1 christos static ASYNC_JOB *currjob = NULL;
21 1.1 christos static int custom_alloc_used = 0;
22 1.1 christos static int custom_free_used = 0;
23 1.1 christos
24 1.1 christos static int only_pause(void *args)
25 1.1 christos {
26 1.1 christos ASYNC_pause_job();
27 1.1 christos
28 1.1 christos return 1;
29 1.1 christos }
30 1.1 christos
31 1.1 christos static int add_two(void *args)
32 1.1 christos {
33 1.1 christos ctr++;
34 1.1 christos ASYNC_pause_job();
35 1.1 christos ctr++;
36 1.1 christos
37 1.1 christos return 2;
38 1.1 christos }
39 1.1 christos
40 1.1 christos static int save_current(void *args)
41 1.1 christos {
42 1.1 christos currjob = ASYNC_get_current_job();
43 1.1 christos ASYNC_pause_job();
44 1.1 christos
45 1.1 christos return 1;
46 1.1 christos }
47 1.1 christos
48 1.1 christos static int change_deflt_libctx(void *args)
49 1.1 christos {
50 1.1 christos OSSL_LIB_CTX *libctx = OSSL_LIB_CTX_new();
51 1.1 christos OSSL_LIB_CTX *oldctx, *tmpctx;
52 1.1 christos int ret = 0;
53 1.1 christos
54 1.1 christos if (libctx == NULL)
55 1.1 christos return 0;
56 1.1 christos
57 1.1 christos oldctx = OSSL_LIB_CTX_set0_default(libctx);
58 1.1 christos ASYNC_pause_job();
59 1.1 christos
60 1.1 christos /* Check the libctx is set up as we expect */
61 1.1 christos tmpctx = OSSL_LIB_CTX_set0_default(oldctx);
62 1.1 christos if (tmpctx != libctx)
63 1.1 christos goto err;
64 1.1 christos
65 1.1 christos /* Set it back again to continue to use our own libctx */
66 1.1 christos oldctx = OSSL_LIB_CTX_set0_default(libctx);
67 1.1 christos ASYNC_pause_job();
68 1.1 christos
69 1.1 christos /* Check the libctx is set up as we expect */
70 1.1 christos tmpctx = OSSL_LIB_CTX_set0_default(oldctx);
71 1.1 christos if (tmpctx != libctx)
72 1.1 christos goto err;
73 1.1 christos
74 1.1 christos ret = 1;
75 1.1 christos err:
76 1.1 christos OSSL_LIB_CTX_free(libctx);
77 1.1 christos return ret;
78 1.1 christos }
79 1.1 christos
80 1.1 christos
81 1.1 christos #define MAGIC_WAIT_FD ((OSSL_ASYNC_FD)99)
82 1.1 christos static int waitfd(void *args)
83 1.1 christos {
84 1.1 christos ASYNC_JOB *job;
85 1.1 christos ASYNC_WAIT_CTX *waitctx;
86 1.1 christos job = ASYNC_get_current_job();
87 1.1 christos if (job == NULL)
88 1.1 christos return 0;
89 1.1 christos waitctx = ASYNC_get_wait_ctx(job);
90 1.1 christos if (waitctx == NULL)
91 1.1 christos return 0;
92 1.1 christos
93 1.1 christos /* First case: no fd added or removed */
94 1.1 christos ASYNC_pause_job();
95 1.1 christos
96 1.1 christos /* Second case: one fd added */
97 1.1 christos if (!ASYNC_WAIT_CTX_set_wait_fd(waitctx, waitctx, MAGIC_WAIT_FD, NULL, NULL))
98 1.1 christos return 0;
99 1.1 christos ASYNC_pause_job();
100 1.1 christos
101 1.1 christos /* Third case: all fd removed */
102 1.1 christos if (!ASYNC_WAIT_CTX_clear_fd(waitctx, waitctx))
103 1.1 christos return 0;
104 1.1 christos ASYNC_pause_job();
105 1.1 christos
106 1.1 christos /* Last case: fd added and immediately removed */
107 1.1 christos if (!ASYNC_WAIT_CTX_set_wait_fd(waitctx, waitctx, MAGIC_WAIT_FD, NULL, NULL))
108 1.1 christos return 0;
109 1.1 christos if (!ASYNC_WAIT_CTX_clear_fd(waitctx, waitctx))
110 1.1 christos return 0;
111 1.1 christos
112 1.1 christos return 1;
113 1.1 christos }
114 1.1 christos
115 1.1 christos static int blockpause(void *args)
116 1.1 christos {
117 1.1 christos ASYNC_block_pause();
118 1.1 christos ASYNC_pause_job();
119 1.1 christos ASYNC_unblock_pause();
120 1.1 christos ASYNC_pause_job();
121 1.1 christos
122 1.1 christos return 1;
123 1.1 christos }
124 1.1 christos
125 1.1 christos static int test_ASYNC_init_thread(void)
126 1.1 christos {
127 1.1 christos ASYNC_JOB *job1 = NULL, *job2 = NULL, *job3 = NULL;
128 1.1 christos int funcret1, funcret2, funcret3;
129 1.1 christos ASYNC_WAIT_CTX *waitctx = NULL;
130 1.1 christos
131 1.1 christos if ( !ASYNC_init_thread(2, 0)
132 1.1 christos || (waitctx = ASYNC_WAIT_CTX_new()) == NULL
133 1.1 christos || ASYNC_start_job(&job1, waitctx, &funcret1, only_pause, NULL, 0)
134 1.1 christos != ASYNC_PAUSE
135 1.1 christos || ASYNC_start_job(&job2, waitctx, &funcret2, only_pause, NULL, 0)
136 1.1 christos != ASYNC_PAUSE
137 1.1 christos || ASYNC_start_job(&job3, waitctx, &funcret3, only_pause, NULL, 0)
138 1.1 christos != ASYNC_NO_JOBS
139 1.1 christos || ASYNC_start_job(&job1, waitctx, &funcret1, only_pause, NULL, 0)
140 1.1 christos != ASYNC_FINISH
141 1.1 christos || ASYNC_start_job(&job3, waitctx, &funcret3, only_pause, NULL, 0)
142 1.1 christos != ASYNC_PAUSE
143 1.1 christos || ASYNC_start_job(&job2, waitctx, &funcret2, only_pause, NULL, 0)
144 1.1 christos != ASYNC_FINISH
145 1.1 christos || ASYNC_start_job(&job3, waitctx, &funcret3, only_pause, NULL, 0)
146 1.1 christos != ASYNC_FINISH
147 1.1 christos || funcret1 != 1
148 1.1 christos || funcret2 != 1
149 1.1 christos || funcret3 != 1) {
150 1.1 christos fprintf(stderr, "test_ASYNC_init_thread() failed\n");
151 1.1 christos ASYNC_WAIT_CTX_free(waitctx);
152 1.1 christos ASYNC_cleanup_thread();
153 1.1 christos return 0;
154 1.1 christos }
155 1.1 christos
156 1.1 christos ASYNC_WAIT_CTX_free(waitctx);
157 1.1 christos ASYNC_cleanup_thread();
158 1.1 christos return 1;
159 1.1 christos }
160 1.1 christos
161 1.1 christos static int test_callback(void *arg)
162 1.1 christos {
163 1.1 christos printf("callback test pass\n");
164 1.1 christos return 1;
165 1.1 christos }
166 1.1 christos
167 1.1 christos static int test_ASYNC_callback_status(void)
168 1.1 christos {
169 1.1 christos ASYNC_WAIT_CTX *waitctx = NULL;
170 1.1 christos int set_arg = 100;
171 1.1 christos ASYNC_callback_fn get_callback;
172 1.1 christos void *get_arg;
173 1.1 christos int set_status = 1;
174 1.1 christos
175 1.1 christos if ( !ASYNC_init_thread(1, 0)
176 1.1 christos || (waitctx = ASYNC_WAIT_CTX_new()) == NULL
177 1.1 christos || ASYNC_WAIT_CTX_set_callback(waitctx, test_callback, (void*)&set_arg)
178 1.1 christos != 1
179 1.1 christos || ASYNC_WAIT_CTX_get_callback(waitctx, &get_callback, &get_arg)
180 1.1 christos != 1
181 1.1 christos || test_callback != get_callback
182 1.1 christos || get_arg != (void*)&set_arg
183 1.1 christos || (*get_callback)(get_arg) != 1
184 1.1 christos || ASYNC_WAIT_CTX_set_status(waitctx, set_status) != 1
185 1.1 christos || set_status != ASYNC_WAIT_CTX_get_status(waitctx)) {
186 1.1 christos fprintf(stderr, "test_ASYNC_callback_status() failed\n");
187 1.1 christos ASYNC_WAIT_CTX_free(waitctx);
188 1.1 christos ASYNC_cleanup_thread();
189 1.1 christos return 0;
190 1.1 christos }
191 1.1 christos
192 1.1 christos ASYNC_WAIT_CTX_free(waitctx);
193 1.1 christos ASYNC_cleanup_thread();
194 1.1 christos return 1;
195 1.1 christos
196 1.1 christos }
197 1.1 christos
198 1.1 christos static int test_ASYNC_start_job(void)
199 1.1 christos {
200 1.1 christos ASYNC_JOB *job = NULL;
201 1.1 christos int funcret;
202 1.1 christos ASYNC_WAIT_CTX *waitctx = NULL;
203 1.1 christos
204 1.1 christos ctr = 0;
205 1.1 christos
206 1.1 christos if ( !ASYNC_init_thread(1, 0)
207 1.1 christos || (waitctx = ASYNC_WAIT_CTX_new()) == NULL
208 1.1 christos || ASYNC_start_job(&job, waitctx, &funcret, add_two, NULL, 0)
209 1.1 christos != ASYNC_PAUSE
210 1.1 christos || ctr != 1
211 1.1 christos || ASYNC_start_job(&job, waitctx, &funcret, add_two, NULL, 0)
212 1.1 christos != ASYNC_FINISH
213 1.1 christos || ctr != 2
214 1.1 christos || funcret != 2) {
215 1.1 christos fprintf(stderr, "test_ASYNC_start_job() failed\n");
216 1.1 christos ASYNC_WAIT_CTX_free(waitctx);
217 1.1 christos ASYNC_cleanup_thread();
218 1.1 christos return 0;
219 1.1 christos }
220 1.1 christos
221 1.1 christos ASYNC_WAIT_CTX_free(waitctx);
222 1.1 christos ASYNC_cleanup_thread();
223 1.1 christos return 1;
224 1.1 christos }
225 1.1 christos
226 1.1 christos static int test_ASYNC_get_current_job(void)
227 1.1 christos {
228 1.1 christos ASYNC_JOB *job = NULL;
229 1.1 christos int funcret;
230 1.1 christos ASYNC_WAIT_CTX *waitctx = NULL;
231 1.1 christos
232 1.1 christos currjob = NULL;
233 1.1 christos
234 1.1 christos if ( !ASYNC_init_thread(1, 0)
235 1.1 christos || (waitctx = ASYNC_WAIT_CTX_new()) == NULL
236 1.1 christos || ASYNC_start_job(&job, waitctx, &funcret, save_current, NULL, 0)
237 1.1 christos != ASYNC_PAUSE
238 1.1 christos || currjob != job
239 1.1 christos || ASYNC_start_job(&job, waitctx, &funcret, save_current, NULL, 0)
240 1.1 christos != ASYNC_FINISH
241 1.1 christos || funcret != 1) {
242 1.1 christos fprintf(stderr, "test_ASYNC_get_current_job() failed\n");
243 1.1 christos ASYNC_WAIT_CTX_free(waitctx);
244 1.1 christos ASYNC_cleanup_thread();
245 1.1 christos return 0;
246 1.1 christos }
247 1.1 christos
248 1.1 christos ASYNC_WAIT_CTX_free(waitctx);
249 1.1 christos ASYNC_cleanup_thread();
250 1.1 christos return 1;
251 1.1 christos }
252 1.1 christos
253 1.1 christos static int test_ASYNC_WAIT_CTX_get_all_fds(void)
254 1.1 christos {
255 1.1 christos ASYNC_JOB *job = NULL;
256 1.1 christos int funcret;
257 1.1 christos ASYNC_WAIT_CTX *waitctx = NULL;
258 1.1 christos OSSL_ASYNC_FD fd = OSSL_BAD_ASYNC_FD, delfd = OSSL_BAD_ASYNC_FD;
259 1.1 christos size_t numfds, numdelfds;
260 1.1 christos
261 1.1 christos if ( !ASYNC_init_thread(1, 0)
262 1.1 christos || (waitctx = ASYNC_WAIT_CTX_new()) == NULL
263 1.1 christos /* On first run we're not expecting any wait fds */
264 1.1 christos || ASYNC_start_job(&job, waitctx, &funcret, waitfd, NULL, 0)
265 1.1 christos != ASYNC_PAUSE
266 1.1 christos || !ASYNC_WAIT_CTX_get_all_fds(waitctx, NULL, &numfds)
267 1.1 christos || numfds != 0
268 1.1 christos || !ASYNC_WAIT_CTX_get_changed_fds(waitctx, NULL, &numfds, NULL,
269 1.1 christos &numdelfds)
270 1.1 christos || numfds != 0
271 1.1 christos || numdelfds != 0
272 1.1 christos /* On second run we're expecting one added fd */
273 1.1 christos || ASYNC_start_job(&job, waitctx, &funcret, waitfd, NULL, 0)
274 1.1 christos != ASYNC_PAUSE
275 1.1 christos || !ASYNC_WAIT_CTX_get_all_fds(waitctx, NULL, &numfds)
276 1.1 christos || numfds != 1
277 1.1 christos || !ASYNC_WAIT_CTX_get_all_fds(waitctx, &fd, &numfds)
278 1.1 christos || fd != MAGIC_WAIT_FD
279 1.1 christos || (fd = OSSL_BAD_ASYNC_FD, 0) /* Assign to something else */
280 1.1 christos || !ASYNC_WAIT_CTX_get_changed_fds(waitctx, NULL, &numfds, NULL,
281 1.1 christos &numdelfds)
282 1.1 christos || numfds != 1
283 1.1 christos || numdelfds != 0
284 1.1 christos || !ASYNC_WAIT_CTX_get_changed_fds(waitctx, &fd, &numfds, NULL,
285 1.1 christos &numdelfds)
286 1.1 christos || fd != MAGIC_WAIT_FD
287 1.1 christos /* On third run we expect one deleted fd */
288 1.1 christos || ASYNC_start_job(&job, waitctx, &funcret, waitfd, NULL, 0)
289 1.1 christos != ASYNC_PAUSE
290 1.1 christos || !ASYNC_WAIT_CTX_get_all_fds(waitctx, NULL, &numfds)
291 1.1 christos || numfds != 0
292 1.1 christos || !ASYNC_WAIT_CTX_get_changed_fds(waitctx, NULL, &numfds, NULL,
293 1.1 christos &numdelfds)
294 1.1 christos || numfds != 0
295 1.1 christos || numdelfds != 1
296 1.1 christos || !ASYNC_WAIT_CTX_get_changed_fds(waitctx, NULL, &numfds, &delfd,
297 1.1 christos &numdelfds)
298 1.1 christos || delfd != MAGIC_WAIT_FD
299 1.1 christos /* On last run we are not expecting any wait fd */
300 1.1 christos || ASYNC_start_job(&job, waitctx, &funcret, waitfd, NULL, 0)
301 1.1 christos != ASYNC_FINISH
302 1.1 christos || !ASYNC_WAIT_CTX_get_all_fds(waitctx, NULL, &numfds)
303 1.1 christos || numfds != 0
304 1.1 christos || !ASYNC_WAIT_CTX_get_changed_fds(waitctx, NULL, &numfds, NULL,
305 1.1 christos &numdelfds)
306 1.1 christos || numfds != 0
307 1.1 christos || numdelfds != 0
308 1.1 christos || funcret != 1) {
309 1.1 christos fprintf(stderr, "test_ASYNC_get_wait_fd() failed\n");
310 1.1 christos ASYNC_WAIT_CTX_free(waitctx);
311 1.1 christos ASYNC_cleanup_thread();
312 1.1 christos return 0;
313 1.1 christos }
314 1.1 christos
315 1.1 christos ASYNC_WAIT_CTX_free(waitctx);
316 1.1 christos ASYNC_cleanup_thread();
317 1.1 christos return 1;
318 1.1 christos }
319 1.1 christos
320 1.1 christos static int test_ASYNC_block_pause(void)
321 1.1 christos {
322 1.1 christos ASYNC_JOB *job = NULL;
323 1.1 christos int funcret;
324 1.1 christos ASYNC_WAIT_CTX *waitctx = NULL;
325 1.1 christos
326 1.1 christos if ( !ASYNC_init_thread(1, 0)
327 1.1 christos || (waitctx = ASYNC_WAIT_CTX_new()) == NULL
328 1.1 christos || ASYNC_start_job(&job, waitctx, &funcret, blockpause, NULL, 0)
329 1.1 christos != ASYNC_PAUSE
330 1.1 christos || ASYNC_start_job(&job, waitctx, &funcret, blockpause, NULL, 0)
331 1.1 christos != ASYNC_FINISH
332 1.1 christos || funcret != 1) {
333 1.1 christos fprintf(stderr, "test_ASYNC_block_pause() failed\n");
334 1.1 christos ASYNC_WAIT_CTX_free(waitctx);
335 1.1 christos ASYNC_cleanup_thread();
336 1.1 christos return 0;
337 1.1 christos }
338 1.1 christos
339 1.1 christos ASYNC_WAIT_CTX_free(waitctx);
340 1.1 christos ASYNC_cleanup_thread();
341 1.1 christos return 1;
342 1.1 christos }
343 1.1 christos
344 1.1 christos static int test_ASYNC_start_job_ex(void)
345 1.1 christos {
346 1.1 christos ASYNC_JOB *job = NULL;
347 1.1 christos int funcret;
348 1.1 christos ASYNC_WAIT_CTX *waitctx = NULL;
349 1.1 christos OSSL_LIB_CTX *libctx = OSSL_LIB_CTX_new();
350 1.1 christos OSSL_LIB_CTX *oldctx, *tmpctx, *globalctx;
351 1.1 christos int ret = 0;
352 1.1 christos
353 1.1 christos if (libctx == NULL) {
354 1.1 christos fprintf(stderr,
355 1.1 christos "test_ASYNC_start_job_ex() failed to create libctx\n");
356 1.1 christos goto err;
357 1.1 christos }
358 1.1 christos
359 1.1 christos globalctx = oldctx = OSSL_LIB_CTX_set0_default(libctx);
360 1.1 christos
361 1.1 christos if ((waitctx = ASYNC_WAIT_CTX_new()) == NULL
362 1.1 christos || ASYNC_start_job(&job, waitctx, &funcret, change_deflt_libctx,
363 1.1 christos NULL, 0)
364 1.1 christos != ASYNC_PAUSE) {
365 1.1 christos fprintf(stderr,
366 1.1 christos "test_ASYNC_start_job_ex() failed to start job\n");
367 1.1 christos goto err;
368 1.1 christos }
369 1.1 christos
370 1.1 christos /* Reset the libctx temporarily to find out what it is*/
371 1.1 christos tmpctx = OSSL_LIB_CTX_set0_default(oldctx);
372 1.1 christos oldctx = OSSL_LIB_CTX_set0_default(tmpctx);
373 1.1 christos if (tmpctx != libctx) {
374 1.1 christos fprintf(stderr,
375 1.1 christos "test_ASYNC_start_job_ex() failed - unexpected libctx\n");
376 1.1 christos goto err;
377 1.1 christos }
378 1.1 christos
379 1.1 christos if (ASYNC_start_job(&job, waitctx, &funcret, change_deflt_libctx, NULL, 0)
380 1.1 christos != ASYNC_PAUSE) {
381 1.1 christos fprintf(stderr,
382 1.1 christos "test_ASYNC_start_job_ex() - restarting job failed\n");
383 1.1 christos goto err;
384 1.1 christos }
385 1.1 christos
386 1.1 christos /* Reset the libctx and continue with the global default libctx */
387 1.1 christos tmpctx = OSSL_LIB_CTX_set0_default(oldctx);
388 1.1 christos if (tmpctx != libctx) {
389 1.1 christos fprintf(stderr,
390 1.1 christos "test_ASYNC_start_job_ex() failed - unexpected libctx\n");
391 1.1 christos goto err;
392 1.1 christos }
393 1.1 christos
394 1.1 christos if (ASYNC_start_job(&job, waitctx, &funcret, change_deflt_libctx, NULL, 0)
395 1.1 christos != ASYNC_FINISH
396 1.1 christos || funcret != 1) {
397 1.1 christos fprintf(stderr,
398 1.1 christos "test_ASYNC_start_job_ex() - finishing job failed\n");
399 1.1 christos goto err;
400 1.1 christos }
401 1.1 christos
402 1.1 christos /* Reset the libctx temporarily to find out what it is*/
403 1.1 christos tmpctx = OSSL_LIB_CTX_set0_default(libctx);
404 1.1 christos OSSL_LIB_CTX_set0_default(tmpctx);
405 1.1 christos if (tmpctx != globalctx) {
406 1.1 christos fprintf(stderr,
407 1.1 christos "test_ASYNC_start_job_ex() failed - global libctx check failed\n");
408 1.1 christos goto err;
409 1.1 christos }
410 1.1 christos
411 1.1 christos ret = 1;
412 1.1 christos err:
413 1.1 christos ASYNC_WAIT_CTX_free(waitctx);
414 1.1 christos ASYNC_cleanup_thread();
415 1.1 christos OSSL_LIB_CTX_free(libctx);
416 1.1 christos return ret;
417 1.1 christos }
418 1.1 christos
419 1.1 christos static void *test_alloc_stack(size_t *num)
420 1.1 christos {
421 1.1 christos custom_alloc_used = 1;
422 1.1 christos return OPENSSL_malloc(*num);
423 1.1 christos }
424 1.1 christos
425 1.1 christos static void test_free_stack(void *addr)
426 1.1 christos {
427 1.1 christos custom_free_used = 1;
428 1.1 christos OPENSSL_free(addr);
429 1.1 christos }
430 1.1 christos
431 1.1 christos static int test_ASYNC_set_mem_functions(void)
432 1.1 christos {
433 1.1 christos ASYNC_stack_alloc_fn alloc_fn;
434 1.1 christos ASYNC_stack_free_fn free_fn;
435 1.1 christos
436 1.1 christos /* Not all platforms support this */
437 1.1 christos if (ASYNC_set_mem_functions(test_alloc_stack, test_free_stack) == 0) return 1;
438 1.1 christos
439 1.1 christos ASYNC_get_mem_functions(&alloc_fn, &free_fn);
440 1.1 christos
441 1.1 christos if ((alloc_fn != test_alloc_stack) || (free_fn != test_free_stack)) {
442 1.1 christos fprintf(stderr,
443 1.1 christos "test_ASYNC_set_mem_functions() - setting and retrieving custom allocators failed\n");
444 1.1 christos return 0;
445 1.1 christos }
446 1.1 christos
447 1.1 christos if (!ASYNC_init_thread(1, 1)) {
448 1.1 christos fprintf(stderr,
449 1.1 christos "test_ASYNC_set_mem_functions() - failed initialising ctx pool\n");
450 1.1 christos return 0;
451 1.1 christos }
452 1.1 christos ASYNC_cleanup_thread();
453 1.1 christos
454 1.1 christos if (!custom_alloc_used || !custom_free_used) {
455 1.1 christos fprintf(stderr,
456 1.1 christos "test_ASYNC_set_mem_functions() - custom allocation functions not used\n");
457 1.1 christos
458 1.1 christos return 0;
459 1.1 christos }
460 1.1 christos
461 1.1 christos return 1;
462 1.1 christos }
463 1.1 christos
464 1.1 christos int main(int argc, char **argv)
465 1.1 christos {
466 1.1 christos if (!ASYNC_is_capable()) {
467 1.1 christos fprintf(stderr,
468 1.1 christos "OpenSSL build is not ASYNC capable - skipping async tests\n");
469 1.1 christos } else {
470 1.1 christos if (!test_ASYNC_init_thread()
471 1.1 christos || !test_ASYNC_callback_status()
472 1.1 christos || !test_ASYNC_start_job()
473 1.1 christos || !test_ASYNC_get_current_job()
474 1.1 christos || !test_ASYNC_WAIT_CTX_get_all_fds()
475 1.1 christos || !test_ASYNC_block_pause()
476 1.1 christos || !test_ASYNC_start_job_ex()
477 1.1 christos || !test_ASYNC_set_mem_functions()) {
478 1.1 christos return 1;
479 1.1 christos }
480 1.1 christos }
481 1.1 christos printf("PASS\n");
482 1.1 christos return 0;
483 1.1 christos }
484