celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject celix git commit: CELIX-263: fixed wrong constants used in celix_thread_test
Date Sun, 18 Oct 2015 18:05:34 GMT
Repository: celix
Updated Branches:
  refs/heads/develop fe816550e -> 9806a8092


CELIX-263: fixed wrong constants used in celix_thread_test


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/9806a809
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/9806a809
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/9806a809

Branch: refs/heads/develop
Commit: 9806a809220a3fd47a91519a2ca152cfb7a31f66
Parents: fe81655
Author: Bjoern Petri <bpetri@apache.org>
Authored: Sun Oct 18 20:05:09 2015 +0200
Committer: Bjoern Petri <bpetri@apache.org>
Committed: Sun Oct 18 20:05:09 2015 +0200

----------------------------------------------------------------------
 utils/private/test/celix_threads_test.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/9806a809/utils/private/test/celix_threads_test.cpp
----------------------------------------------------------------------
diff --git a/utils/private/test/celix_threads_test.cpp b/utils/private/test/celix_threads_test.cpp
index d5a01b4..6d62bad 100644
--- a/utils/private/test/celix_threads_test.cpp
+++ b/utils/private/test/celix_threads_test.cpp
@@ -172,6 +172,9 @@ TEST(celix_thread_mutex, lock) {
 
 	//possible race condition, not perfect test
 	celixThreadMutex_unlock(&params->mu);
+
+	sleep(2);
+
 	celixThreadMutex_lock(&params->mu2);
 	LONGS_EQUAL(666, params->i);
 	celixThreadMutex_unlock(&params->mu2);
@@ -191,14 +194,14 @@ TEST(celix_thread_mutex, attrSettype) {
 	celixThreadMutexAttr_create(&mu_attr);
 
 	//test recursive mutex
-	celixThreadMutexAttr_settype(&mu_attr, PTHREAD_MUTEX_RECURSIVE);
+	celixThreadMutexAttr_settype(&mu_attr, CELIX_THREAD_MUTEX_RECURSIVE);
 	celixThreadMutex_create(&mu, &mu_attr);
 	//if program doesnt deadlock: succes! also check factorial of 10, for reasons unknown
 	LONGS_EQUAL(3628800, thread_test_func_recur_lock(&mu, 10));
 	celixThreadMutex_destroy(&mu);
 
 	//test deadlock check mutex
-	celixThreadMutexAttr_settype(&mu_attr, PTHREAD_MUTEX_ERRORCHECK);
+	celixThreadMutexAttr_settype(&mu_attr, CELIX_THREAD_MUTEX_ERRORCHECK);
 	celixThreadMutex_create(&mu, &mu_attr);
 	//get deadlock error
 	celixThreadMutex_lock(&mu);


Mime
View raw message