summaryrefslogtreecommitdiff
path: root/test/testprocmutex.c
diff options
context:
space:
mode:
authordreid <dreid@13f79535-47bb-0310-9956-ffa450edef68>2004-06-29 17:16:18 +0000
committerdreid <dreid@13f79535-47bb-0310-9956-ffa450edef68>2004-06-29 17:16:18 +0000
commitc5904c70c2b459847e9adaae111b8b7ab9765311 (patch)
tree92be8ed38af958230c184a2f196a2623fba5af01 /test/testprocmutex.c
parent0295bac438ac2041fcbcfcbc92297454eb1592b1 (diff)
downloadlibapr-c5904c70c2b459847e9adaae111b8b7ab9765311.tar.gz
Destroy the shared memory once the test finishes.
Exit if we fail tests rather than pressing on. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65239 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testprocmutex.c')
-rw-r--r--test/testprocmutex.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/testprocmutex.c b/test/testprocmutex.c
index 17e9dbeda..407a7d9f7 100644
--- a/test/testprocmutex.c
+++ b/test/testprocmutex.c
@@ -101,6 +101,8 @@ static void test_exclusive(abts_case *tc, const char *lockname,
rv = apr_proc_mutex_create(&proc_lock, lockname, mech, p);
APR_ASSERT_SUCCESS(tc, "create the mutex", rv);
+ if (rv != APR_SUCCESS)
+ return;
for (n = 0; n < CHILDREN; n++)
make_child(tc, &child[n], p);
@@ -128,9 +130,13 @@ static void proc_mutex(abts_case *tc, void *data)
}
APR_ASSERT_SUCCESS(tc, "create shm segment", rv);
+ if (rv != APR_SUCCESS)
+ return;
x = apr_shm_baseaddr_get(shm);
test_exclusive(tc, NULL, *mech);
+ rv = apr_shm_destroy(shm);
+ APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
#else
ABTS_NOT_IMPL(tc, "APR lacks fork() support");
#endif
@@ -166,4 +172,3 @@ abts_suite *testprocmutex(abts_suite *suite)
return suite;
}
-