summaryrefslogtreecommitdiff
path: root/tests/mutex5.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mutex5.c')
-rw-r--r--tests/mutex5.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/tests/mutex5.c b/tests/mutex5.c
index 6a9a917..d7b9064 100644
--- a/tests/mutex5.c
+++ b/tests/mutex5.c
@@ -13,19 +13,23 @@ int
main()
{
int mxType = -1;
+ int bool = 0; /* Use to quell GNU compiler warnings. */
- assert(PTHREAD_MUTEX_DEFAULT == PTHREAD_MUTEX_NORMAL);
- assert(PTHREAD_MUTEX_DEFAULT != PTHREAD_MUTEX_ERRORCHECK);
- assert(PTHREAD_MUTEX_DEFAULT != PTHREAD_MUTEX_RECURSIVE);
- assert(PTHREAD_MUTEX_RECURSIVE != PTHREAD_MUTEX_ERRORCHECK);
+ assert(bool = PTHREAD_MUTEX_DEFAULT == PTHREAD_MUTEX_NORMAL);
+ assert(bool = PTHREAD_MUTEX_DEFAULT != PTHREAD_MUTEX_ERRORCHECK);
+ assert(bool = PTHREAD_MUTEX_DEFAULT != PTHREAD_MUTEX_RECURSIVE);
+ assert(bool = PTHREAD_MUTEX_RECURSIVE != PTHREAD_MUTEX_ERRORCHECK);
- assert(PTHREAD_MUTEX_NORMAL == PTHREAD_MUTEX_FAST_NP);
- assert(PTHREAD_MUTEX_RECURSIVE == PTHREAD_MUTEX_RECURSIVE_NP);
- assert(PTHREAD_MUTEX_ERRORCHECK == PTHREAD_MUTEX_ERRORCHECK_NP);
+ assert(bool = PTHREAD_MUTEX_NORMAL == PTHREAD_MUTEX_FAST_NP);
+ assert(bool = PTHREAD_MUTEX_RECURSIVE == PTHREAD_MUTEX_RECURSIVE_NP);
+ assert(bool = PTHREAD_MUTEX_ERRORCHECK == PTHREAD_MUTEX_ERRORCHECK_NP);
- assert(pthread_mutexattr_init(&mxAttr) == 0);
- assert(pthread_mutexattr_gettype(&mxAttr, &mxType) == 0);
- assert(mxType == PTHREAD_MUTEX_NORMAL);
+ if (bool == bool)
+ {
+ assert(pthread_mutexattr_init(&mxAttr) == 0);
+ assert(pthread_mutexattr_gettype(&mxAttr, &mxType) == 0);
+ assert(mxType == PTHREAD_MUTEX_NORMAL);
+ }
return 0;
}