diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2005-09-13 02:43:59 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2005-09-13 02:43:59 +0000 |
commit | c35ea14f24d1c8ac60b4c76ef4ba2ea7db58b3dc (patch) | |
tree | 1e56a7e8eb564dd2c7fec2d42820d24f4813574a /test/testdso.c | |
parent | a4cca011e579b26652bb506466123dd7a79cdf3c (diff) | |
download | apr-c35ea14f24d1c8ac60b4c76ef4ba2ea7db58b3dc.tar.gz |
The apr_dso tests are borked on win32, begin by choosing a '.dll' file,
and ensure that once we decide the symbol deref has failed, it's absolutely
pointless to both to call NULL.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@280463 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testdso.c')
-rw-r--r-- | test/testdso.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/test/testdso.c b/test/testdso.c index 5187cdd25..241796647 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -30,8 +30,10 @@ #ifdef NETWARE # define MOD_NAME "mod_test.nlm" -#elif defined(BEOS) || defined(WIN32) +#elif defined(BEOS) # define MOD_NAME "mod_test.so" +#elif defined(WIN32) +# define MOD_NAME "mod_test.dll" #elif defined(DARWIN) # define MOD_NAME ".libs/mod_test.so" # define LIB_NAME ".libs/libmod_test.dylib" @@ -78,9 +80,11 @@ static void test_dso_sym(abts_case *tc, void *data) ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, func1); - function = (void (*)(char *))func1; - (*function)(teststr); - ABTS_STR_EQUAL(tc, "Hello - I'm a DSO!\n", teststr); + if (!tc->failed) { + function = (void (*)(char *))func1; + (*function)(teststr); + ABTS_STR_EQUAL(tc, "Hello - I'm a DSO!\n", teststr); + } apr_dso_unload(h); } @@ -101,9 +105,11 @@ static void test_dso_sym_return_value(abts_case *tc, void *data) ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, func1); - function = (int (*)(int))func1; - status = (*function)(5); - ABTS_INT_EQUAL(tc, 5, status); + if (!tc->failed) { + function = (int (*)(int))func1; + status = (*function)(5); + ABTS_INT_EQUAL(tc, 5, status); + } apr_dso_unload(h); } @@ -160,9 +166,11 @@ static void test_dso_sym_library(abts_case *tc, void *data) ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, func1); - function = (void (*)(char *))func1; - (*function)(teststr); - ABTS_STR_EQUAL(tc, "Hello - I'm a DSO!\n", teststr); + if (!tc->failed) { + function = (void (*)(char *))func1; + (*function)(teststr); + ABTS_STR_EQUAL(tc, "Hello - I'm a DSO!\n", teststr); + } apr_dso_unload(h); } @@ -183,9 +191,11 @@ static void test_dso_sym_return_value_library(abts_case *tc, void *data) ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, func1); - function = (int (*)(int))func1; - status = (*function)(5); - ABTS_INT_EQUAL(tc, 5, status); + if (!tc->failed) { + function = (int (*)(int))func1; + status = (*function)(5); + ABTS_INT_EQUAL(tc, 5, status); + } apr_dso_unload(h); } |