summaryrefslogtreecommitdiff
path: root/test/testdso.c
diff options
context:
space:
mode:
authorRyan Bloom <rbb@apache.org>2002-12-29 22:28:11 +0000
committerRyan Bloom <rbb@apache.org>2002-12-29 22:28:11 +0000
commit72ea5dd4011495652b80d6eef8e9959b227703af (patch)
tree6407507b839686103e6973eee313dbfd5be94563 /test/testdso.c
parent3285e905bb7473c1b52b12772c54e5b40f6c8db0 (diff)
downloadapr-72ea5dd4011495652b80d6eef8e9959b227703af.tar.gz
standardize on a couple of easy to test for error codes for DSO errors.
This doesn't work fully on Windows yet, that is the next commit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64233 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testdso.c')
-rw-r--r--test/testdso.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/testdso.c b/test/testdso.c
index 2d04507c2..fe720aa97 100644
--- a/test/testdso.c
+++ b/test/testdso.c
@@ -157,7 +157,7 @@ static void test_unload_module(CuTest *tc)
CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status);
status = apr_dso_sym(&func1, h, "print_hello");
- CuAssertIntEquals(tc, APR_EINIT, status);
+ CuAssertIntEquals(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status));
}
@@ -234,26 +234,28 @@ static void test_unload_library(CuTest *tc)
status = apr_dso_unload(h);
CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status);
+
+ status = apr_dso_sym(&func1, h, "print_hello");
+ CuAssertIntEquals(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status));
}
static void test_load_notthere(CuTest *tc)
{
apr_dso_handle_t *h = NULL;
- char errstr[256];
apr_status_t status;
status = apr_dso_load(&h, "No_File.so", p);
- /* Original test was status == APR_EDSOOPEN, but that's not valid
- * with DSO_USE_SHL (HP/UX etc), OS2 or Win32. Accept simple failure.
- */
- CuAssert(tc, apr_dso_error(h, errstr, 256), status);
+
+ CuAssertIntEquals(tc, 1, APR_STATUS_IS_EDSOOPEN(status));
CuAssertPtrNotNull(tc, h);
}
+#ifndef LIB_NAME
static void library_not_impl(CuTest *tc)
{
CuNotImpl(tc, "Loadable libraries and modules are equivilant on this platform");
}
+#endif
CuSuite *testdso(void)
{