summaryrefslogtreecommitdiff
path: root/test/testrmm.c
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2004-03-16 18:17:33 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2004-03-16 18:17:33 +0000
commit119410fade460129d86fc957ee7d19280509d8b4 (patch)
tree97199d8040204ade0c9c487a43af78a933581e4a /test/testrmm.c
parent09ffd91064db2595b219618c4f6c31d614b67cba (diff)
downloadlibapr-util-119410fade460129d86fc957ee7d19280509d8b4.tar.gz
Fix a signed/unsigned mismatch that caused an underflow.
Patch by Ahab A. <eabouzou yahoo.com> Test by Phillip M Chiasson <gozer apache.org> PR: 25550 git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@59010 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testrmm.c')
-rw-r--r--test/testrmm.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/testrmm.c b/test/testrmm.c
index 33f59369..a1cf75c5 100644
--- a/test/testrmm.c
+++ b/test/testrmm.c
@@ -29,7 +29,7 @@
#if APR_HAS_SHARED_MEMORY
-#define FRAG_SIZE 10
+#define FRAG_SIZE 80
#define FRAG_COUNT 10
#define SHARED_SIZE (apr_size_t)(FRAG_SIZE * FRAG_COUNT * sizeof(char*))
@@ -78,7 +78,15 @@ static apr_status_t test_rmm(apr_pool_t *parpool)
off[i] = apr_rmm_malloc(rmm, fragsize);
}
fprintf(stdout, "OK\n");
-
+
+ printf("Checking for out of memory allocation............");
+ if (apr_rmm_malloc(rmm, FRAG_SIZE * FRAG_COUNT) == 0) {
+ fprintf(stdout, "OK\n");
+ }
+ else {
+ return APR_EGENERAL;
+ }
+
printf("Setting each fragment to a unique value..........");
for (i = 0; i < FRAG_COUNT; i++) {
int j;