From 9547730c9ee50dfe5b215f03c4d0a3f74605df4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Sun, 18 Nov 2012 13:45:02 +0100 Subject: [PATCH] Fix unitintialized msgtype in threadqueue test --- test/test_threadqueue.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_threadqueue.c b/test/test_threadqueue.c index 7b28725..99484d0 100644 --- a/test/test_threadqueue.c +++ b/test/test_threadqueue.c @@ -20,6 +20,7 @@ START_TEST (test_thread_queue_length) for(i = 0; i < 51; i++) { struct thr_msg *msg = malloc(sizeof *msg); fail_if(msg == NULL); + msg->msg.msgtype = 1; fail_if(uc_thread_queue_add(&queue, &msg->msg) != 0); } @@ -36,6 +37,7 @@ START_TEST (test_thread_queue_one_thread) for(i = 0; i < 51; i++) { struct thr_msg *msg = malloc(sizeof *msg); fail_if(msg == NULL); + msg->msg.msgtype = 0; msg->a = i; fail_if(uc_thread_queue_add(&queue, &msg->msg) != 0); } @@ -72,6 +74,7 @@ START_TEST (test_thread_queue_walk) struct thr_msg *msg = malloc(sizeof *msg); fail_if(msg == NULL); msg->a = i; + msg->msg.msgtype = 0; fail_if(uc_thread_queue_add(&queue, &msg->msg) != 0); } @@ -114,6 +117,7 @@ START_TEST (test_thread_queue_reader_writer) struct thr_msg *msg = malloc(sizeof *msg); fail_if(msg == NULL); msg->a = i; + msg->msg.msgtype = 0; fail_if(uc_thread_queue_add(&queue, &msg->msg) != 0); } @@ -137,6 +141,7 @@ START_TEST (test_thread_queue_reader_writer_len_1) struct thr_msg *msg = malloc(sizeof *msg); fail_if(msg == NULL); msg->a = i; + msg->msg.msgtype = 0; fail_if(uc_thread_queue_add(&queue, &msg->msg) != 0); } @@ -161,6 +166,7 @@ void *test_thread_queue_multiple_writers_func(void *arg) struct thr_msg *msg = malloc(sizeof *msg); fail_if(msg == NULL); msg->a = i; + msg->msg.msgtype = 0; fail_if(uc_thread_queue_add(queue, &msg->msg) != 0); } @@ -237,6 +243,7 @@ START_TEST (test_thread_queue_timeout2) fail_if(uc_thread_queue_init(&queue, 10) != 0); fail_if(pthread_create(&tid1, NULL, thread_test_thread_queue_timeout2, &queue) != 0); my_msg.b = 12345; + my_msg.msg.msgtype = 0; fail_if(uc_thread_queue_add(&queue, &my_msg.msg) != 0);