From 1c54b505929ac84ab42bdee710e06a7c2f3513c3 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 22 Nov 2013 14:43:20 +0100 Subject: [PATCH] Fix somewhat brain damaged test --- test/test_mutex.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/test_mutex.c b/test/test_mutex.c index 0a7798f..3d8a937 100644 --- a/test/test_mutex.c +++ b/test/test_mutex.c @@ -84,25 +84,27 @@ static void *my_handler(void *arg) static void tst_create_thread(void) { void *return_data; - int mydata = 42; + int mydata0 = 42; + int mydata1= 42; yaz_thread_t t[2]; - t[0] = yaz_thread_create(my_handler, &mydata); + t[0] = yaz_thread_create(my_handler, &mydata0); YAZ_CHECK(t[0]); - t[1] = yaz_thread_create(my_handler, &mydata); + t[1] = yaz_thread_create(my_handler, &mydata1); YAZ_CHECK(t[1]); return_data = 0; yaz_thread_join(&t[0], &return_data); YAZ_CHECK(!t[0]); - YAZ_CHECK(return_data == &mydata); + YAZ_CHECK(return_data == &mydata0); return_data = 0; yaz_thread_join(&t[1], &return_data); YAZ_CHECK(!t[1]); - YAZ_CHECK(return_data == &mydata); + YAZ_CHECK(return_data == &mydata1); - YAZ_CHECK_EQ(mydata, 44); + YAZ_CHECK_EQ(mydata0, 43); + YAZ_CHECK_EQ(mydata1, 43); } int main (int argc, char **argv) -- 1.7.10.4