Skip to content

Commit ad6fa6f

Browse files
committed
testdbm: Skip the test if the DSO could not be loaded.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr-util/branches/1.7.x@1924404 13f79535-47bb-0310-9956-ffa450edef68
1 parent c506cc0 commit ad6fa6f

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

test/testdbm.c

+17-3
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,20 @@ static void test_dbm(abts_case *tc, void *data)
176176
const char *nofile = apr_pstrcat(p, "data/no-such-test-", type, NULL);
177177

178178
rv = apr_dbm_open_ex(&db, type, file, APR_DBM_RWCREATE, APR_OS_DEFAULT, p);
179-
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
180179

181-
if (rv != APR_SUCCESS)
180+
if (APR_STATUS_IS_EDSOOPEN(rv)) {
181+
ABTS_SKIP(tc, data, "DBM DSO '%s' could not be opened.");
182182
return;
183+
}
184+
185+
APR_ASSERT_SUCCESS(tc, "open database r/w", rv);
186+
187+
if (APR_SUCCESS != rv) {
188+
char errbuf[128];
189+
abts_log_message("apr_dbm_open_ex() failed: %s: %s\n", file,
190+
apr_strerror(rv, errbuf, sizeof(errbuf)));
191+
return;
192+
}
183193

184194
table = generate_table();
185195

@@ -194,8 +204,12 @@ static void test_dbm(abts_case *tc, void *data)
194204
rv = apr_dbm_open_ex(&db, type, file, APR_DBM_READONLY, APR_OS_DEFAULT, p);
195205
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
196206

197-
if (rv != APR_SUCCESS)
207+
if (APR_SUCCESS != rv) {
208+
char errbuf[128];
209+
abts_log_message("apr_dbm_open_ex() failed: %s: %s\n", file,
210+
apr_strerror(rv, errbuf, sizeof(errbuf)));
198211
return;
212+
}
199213

200214
test_dbm_exists(tc, db, table);
201215
test_dbm_traversal(tc, db, table);

0 commit comments

Comments
 (0)