summaryrefslogtreecommitdiff
path: root/test/testmmap.c
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2002-11-14 10:24:52 +0000
committerJoe Orton <jorton@apache.org>2002-11-14 10:24:52 +0000
commit587c3fd41d6339d7537bcad3d1965766de56b8ab (patch)
treee8404e459a670c0bd2f53be57038a74114230f31 /test/testmmap.c
parent59bf8de1ef7c5db0afdb27bc87166835947c0e32 (diff)
downloadapr-587c3fd41d6339d7537bcad3d1965766de56b8ab.tar.gz
Fail gracefully if the apr_mmap_create call fails.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64020 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testmmap.c')
-rw-r--r--test/testmmap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/testmmap.c b/test/testmmap.c
index bcd6ac4d5..7003552b5 100644
--- a/test/testmmap.c
+++ b/test/testmmap.c
@@ -120,6 +120,7 @@ static void test_mmap_create(CuTest *tc)
static void test_mmap_contents(CuTest *tc)
{
+ CuAssertPtrNotNull(tc, themmap);
CuAssertPtrNotNull(tc, themmap->mm);
CuAssertIntEquals(tc, themmap->size, 28);
CuAssertStrEquals(tc, themmap->mm, "This is the MMAP data file.\n");
@@ -128,6 +129,8 @@ static void test_mmap_contents(CuTest *tc)
static void test_mmap_delete(CuTest *tc)
{
apr_status_t rv;
+
+ CuAssertPtrNotNull(tc, themmap);
rv = apr_mmap_delete(themmap);
CuAssertIntEquals(tc, rv, APR_SUCCESS);
}
@@ -137,6 +140,7 @@ static void test_mmap_offset(CuTest *tc)
apr_status_t rv;
void *addr;
+ CuAssertPtrNotNull(tc, themmap);
rv = apr_mmap_offset(&addr, themmap, 5);
CuAssertStrEquals(tc, addr, "This is the MMAP data file.\n" + 5);
}