f6cef9543ab261d94afaa4bb58fd47aed5891e13
[debian/amanda] / device-src / tests / queue_test.c
1 #include <queueing.h>
2 #include <device.h>
3 #include <amanda.h>
4
5 int main(void) {
6     /* ignore SIGPIPE */
7     signal(SIGPIPE, SIG_IGN);
8
9     /* Comment out this line to disable threads. */
10     device_api_init();
11
12     /* The integer here is the block size to use. Set it to something
13      * bigger for better performance. */
14     return !do_consumer_producer_queue_full(fd_read_producer,
15                                             GINT_TO_POINTER(0),
16                                             fd_write_consumer,
17                                             GINT_TO_POINTER(1),
18                                             1,  /* Block size */
19                                             10, /* Buffer size. */
20                                             STREAMING_REQUIREMENT_DESIRED);
21 }