apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1790045 - in /apr/apr/trunk/test: testglobalmutex.c testprocmutex.c
Date Mon, 03 Apr 2017 20:16:23 GMT
Author: ylavic
Date: Mon Apr  3 20:16:22 2017
New Revision: 1790045

URL: http://svn.apache.org/viewvc?rev=1790045&view=rev
Log:
Follow up to r1667900: don't fail test{proc,global}mutex if
APR_LOCK_DEFAULT_TIMED is not implemented (e.g. MacOS).


Modified:
    apr/apr/trunk/test/testglobalmutex.c
    apr/apr/trunk/test/testprocmutex.c

Modified: apr/apr/trunk/test/testglobalmutex.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testglobalmutex.c?rev=1790045&r1=1790044&r2=1790045&view=diff
==============================================================================
--- apr/apr/trunk/test/testglobalmutex.c (original)
+++ apr/apr/trunk/test/testglobalmutex.c Mon Apr  3 20:16:22 2017
@@ -84,6 +84,11 @@ static void test_exclusive(abts_case *tc
     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);

Modified: apr/apr/trunk/test/testprocmutex.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testprocmutex.c?rev=1790045&r1=1790044&r2=1790045&view=diff
==============================================================================
--- apr/apr/trunk/test/testprocmutex.c (original)
+++ apr/apr/trunk/test/testprocmutex.c Mon Apr  3 20:16:22 2017
@@ -130,14 +130,12 @@ static void test_exclusive(abts_case *tc
     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);



Mime
View raw message