summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2017-04-03 20:18:45 +0000
committerYann Ylavic <ylavic@apache.org>2017-04-03 20:18:45 +0000
commit2f663ccadbdd4d1141f62b5cce36966f0c8efd26 (patch)
tree1fc9c7697ccc3a9eeaca42e4d9ea204e1b25d25a
parentd6b4fb1d5a1203821da4300685db226964ce60b8 (diff)
downloadapr-2f663ccadbdd4d1141f62b5cce36966f0c8efd26.tar.gz
Merge r1790045 from trunk:
Follow up to r1667900: don't fail test{proc,global}mutex if APR_LOCK_DEFAULT_TIMED is not implemented (e.g. MacOS). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1790047 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--test/testglobalmutex.c5
-rw-r--r--test/testprocmutex.c10
2 files changed, 9 insertions, 6 deletions
diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c
index 7340e2540..c79884cfc 100644
--- a/test/testglobalmutex.c
+++ b/test/testglobalmutex.c
@@ -84,6 +84,11 @@ static void test_exclusive(abts_case *tc, void *data)
abts_log_message(mutexname(mech));
rv = apr_global_mutex_create(&global_lock, LOCKNAME, mech, p);
+ if (rv == APR_ENOTIMPL) {
+ /* MacOS lacks TIMED implementation, so don't fail for ENOTIMPL */
+ ABTS_NOT_IMPL(tc, "global mutex TIMED not implemented");
+ return;
+ }
APR_ASSERT_SUCCESS(tc, "Error creating mutex", rv);
launch_child(tc, mech, &p1, p);
diff --git a/test/testprocmutex.c b/test/testprocmutex.c
index ba19b9897..599d58520 100644
--- a/test/testprocmutex.c
+++ b/test/testprocmutex.c
@@ -130,14 +130,12 @@ static void test_exclusive(abts_case *tc, const char *lockname,
int n;
rv = apr_proc_mutex_create(&proc_lock, lockname, mech->num, p);
- APR_ASSERT_SUCCESS(tc, "create the mutex", rv);
- if (rv != APR_SUCCESS) {
- fprintf(stderr, "%s not implemented, ", mech->name);
- ABTS_ASSERT(tc, "Default timed not implemented",
- mech->num != APR_LOCK_DEFAULT &&
- mech->num != APR_LOCK_DEFAULT_TIMED);
+ if (rv == APR_ENOTIMPL) {
+ /* MacOS lacks TIMED implementation, so don't fail for ENOTIMPL */
+ fprintf(stderr, "method %s not implemented, ", mech->name);
return;
}
+ APR_ASSERT_SUCCESS(tc, "create the mutex", rv);
for (n = 0; n < CHILDREN; n++)
make_child(tc, 0, &child[n], p);