From 9f0009faeaa0960f57fcacea91b45997258016e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 1 Sep 2015 14:32:27 +0000 Subject: synch more with git svn path=/trunk/externals/iem/iemnet/; revision=17546 --- build/autotests/tests/serialqueue.c | 58 +++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 build/autotests/tests/serialqueue.c (limited to 'build/autotests/tests/serialqueue.c') diff --git a/build/autotests/tests/serialqueue.c b/build/autotests/tests/serialqueue.c new file mode 100644 index 0000000..238be41 --- /dev/null +++ b/build/autotests/tests/serialqueue.c @@ -0,0 +1,58 @@ +#include + +#include + +#define NUMCHUNKS 1000 + + +typedef union { + unsigned char cp; + int count; +} data_t; +static int producer(t_iemnet_queue*q, unsigned int count, unsigned int msec) { + unsigned int i; + data_t data; + for(i=0; isize) { + error("size mismatch %d!=%d", sizeof(data_t), chunk->size); + fail(); + } + data=chunk->data; + // post("consumed %d", data->count); + iemnet__chunk_destroy(chunk); + } + printf("\n"); + return 0; +} + +void serialqueue_setup(void) { + t_iemnet_queue*q=queue_create(); + producer(q, 1000, 1); + consumer(q); + + queue_destroy(q); + pass(); +} -- cgit v1.2.1