apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r1751787 - /apr/apr-util/branches/1.6.x/test/testcrypto.c
Date Thu, 07 Jul 2016 12:26:03 GMT
Author: minfrin
Date: Thu Jul  7 12:26:02 2016
New Revision: 1751787

URL: http://svn.apache.org/viewvc?rev=1751787&view=rev
Log:
Backport r1751783:
testcrypto: Don't silently swallow errors when the driver loads but the
underlying library refuses to initialise.

Modified:
    apr/apr-util/branches/1.6.x/test/testcrypto.c

Modified: apr/apr-util/branches/1.6.x/test/testcrypto.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.6.x/test/testcrypto.c?rev=1751787&r1=1751786&r2=1751787&view=diff
==============================================================================
--- apr/apr-util/branches/1.6.x/test/testcrypto.c (original)
+++ apr/apr-util/branches/1.6.x/test/testcrypto.c Thu Jul  7 12:26:02 2016
@@ -33,24 +33,33 @@ static const apr_crypto_driver_t *get_dr
 {
 
     const apr_crypto_driver_t *driver = NULL;
-    const apu_err_t *err = NULL;
+    const apu_err_t *result = NULL;
     apr_status_t rv;
 
     rv = apr_crypto_init(pool);
     ABTS_ASSERT(tc, "failed to init apr_crypto", rv == APR_SUCCESS);
 
-    rv = apr_crypto_get_driver(&driver, name, params, &err, pool);
-    if (APR_SUCCESS != rv && err) {
-        ABTS_NOT_IMPL(tc, err->msg);
+    rv = apr_crypto_get_driver(&driver, name, params, &result, pool);
+    if (APR_ENOTIMPL == rv) {
+        ABTS_NOT_IMPL(tc,
+                apr_psprintf(pool, "\nCrypto driver '%s' not implemented, skipping", (char
*)name));
         return NULL;
     }
-    if (APR_ENOTIMPL == rv) {
+    if (APR_EDSOOPEN == rv) {
         ABTS_NOT_IMPL(tc,
-                apr_psprintf(pool, "Crypto driver '%s' not implemented, skipping", (char
*)name));
+                apr_psprintf(pool, "\nCrypto driver '%s' DSO could not be opened, skipping",
(char *)name));
         return NULL;
     }
-    ABTS_ASSERT(tc, "failed to apr_crypto_get_driver", rv == APR_SUCCESS);
-    ABTS_ASSERT(tc, "apr_crypto_get_driver returned NULL", driver != NULL);
+    if (APR_SUCCESS != rv && result) {
+        char err[1024];
+        apr_strerror(rv, err, sizeof(err) - 1);
+        fprintf(stderr, "\nget_driver error %d: %s: '%s' native error %d: %s (%s)\n",
+                rv, err, name, result->rc, result->reason ? result->reason : "",
+                result->msg ? result->msg : "");
+    }
+    ABTS_ASSERT(tc, apr_psprintf(pool, "\nfailed to apr_crypto_get_driver for '%s' with %d",
+                name, rv), rv == APR_SUCCESS);
+    ABTS_ASSERT(tc, "\napr_crypto_get_driver returned NULL", driver != NULL);
     if (!driver || rv) {
         return NULL;
     }



Mime
View raw message