svn commit: r1924403 - /apr/apr/trunk/test/testdbm.c

[email protected]
Newsgroups gmane.comp.apache.apr.cvs
Message-ID <[email protected]>
Author: minfrin
Date: Sat Mar 15 13:15:11 2025
New Revision: 1924403

URL: http://svn.apache.org/viewvc?rev=1924403&view=rev
Log:
testdbm: Skip the test if the DSO could not be loaded.

Modified:
    apr/apr/trunk/test/testdbm.c

Modified: apr/apr/trunk/test/testdbm.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testdbm.c?rev=1924403&r1=1924402&r2=1924403&view=diff
==============================================================================
--- apr/apr/trunk/test/testdbm.c (original)
+++ apr/apr/trunk/test/testdbm.c Sat Mar 15 13:15:11 2025
@@ -176,9 +176,20 @@ static void test_dbm(abts_case *tc, void
     const char *nofile = apr_pstrcat(p, "data/no-such-test-", type, NULL);
 
     rv = apr_dbm_open_ex(&db, type, file, APR_DBM_RWCREATE, APR_FPROT_OS_DEFAULT, p);
+
+    if (APR_STATUS_IS_EDSOOPEN(rv)) {
+        ABTS_SKIP(tc, data, "DBM DSO '%s' could not be opened.");
+        return;
+    }
+
     APR_ASSERT_SUCCESS(tc, "open database r/w", rv);
-    if (rv != APR_SUCCESS)
+
+    if (APR_SUCCESS != rv) {
+        char errbuf[128];
+        abts_log_message("apr_dbm_open_ex() failed: %s: %s\n", file,
+                         apr_strerror(rv, errbuf, sizeof(errbuf)));
         return;
+    }
 
     table = generate_table();
 
@@ -193,8 +204,12 @@ static void test_dbm(abts_case *tc, void
     rv = apr_dbm_open_ex(&db, type, file, APR_DBM_READONLY, APR_FPROT_OS_DEFAULT, p);
     APR_ASSERT_SUCCESS(tc, "open database r/o", rv);
 
-    if (rv != APR_SUCCESS)
+    if (APR_SUCCESS != rv) {
+        char errbuf[128];
+        abts_log_message("apr_dbm_open_ex() failed: %s: %s\n", file,
+                         apr_strerror(rv, errbuf, sizeof(errbuf)));
         return;
+    }
 
     test_dbm_exists(tc, db, table);
     test_dbm_traversal(tc, db, table);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.