dreid 2004/06/29 10:16:18
Modified: test testprocmutex.c
Log:
Destroy the shared memory once the test finishes.
Exit if we fail tests rather than pressing on.
Revision Changes Path
1.22 +6 -1 apr/test/testprocmutex.c
Index: testprocmutex.c
===================================================================
RCS file: /home/cvs/apr/test/testprocmutex.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- testprocmutex.c 14 Jun 2004 09:09:05 -0000 1.21
+++ testprocmutex.c 29 Jun 2004 17:16:18 -0000 1.22
@@ -101,6 +101,8 @@
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 @@
}
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 @@
return suite;
}
-