apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r692755 - in /apr/apr-util/branches/1.3.x: ./ CHANGES test/testdbd.c
Date Sat, 06 Sep 2008 22:36:41 GMT
Author: minfrin
Date: Sat Sep  6 15:36:40 2008
New Revision: 692755

URL: http://svn.apache.org/viewvc?rev=692755&view=rev
Log:
Backport:
Fix a segfault in the DBD testcase when the DBD modules were not present.

Modified:
    apr/apr-util/branches/1.3.x/   (props changed)
    apr/apr-util/branches/1.3.x/CHANGES
    apr/apr-util/branches/1.3.x/test/testdbd.c

Propchange: apr/apr-util/branches/1.3.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Sat Sep  6 15:36:40 2008
@@ -0,0 +1,2 @@
+/apr/apr-util/branches/1.3.x:692751
+/apr/apr-util/trunk:692751

Modified: apr/apr-util/branches/1.3.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/CHANGES?rev=692755&r1=692754&r2=692755&view=diff
==============================================================================
--- apr/apr-util/branches/1.3.x/CHANGES [utf-8] (original)
+++ apr/apr-util/branches/1.3.x/CHANGES [utf-8] Sat Sep  6 15:36:40 2008
@@ -1,7 +1,8 @@
                                                      -*- coding: utf-8 -*-
 Changes with APR-util 1.3.5
 
-
+  *) Fix a segfault in the DBD testcase when the DBD modules were not present.
+     [Graham Leggett]
 
 Changes with APR-util 1.3.4
 

Modified: apr/apr-util/branches/1.3.x/test/testdbd.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/test/testdbd.c?rev=692755&r1=692754&r2=692755&view=diff
==============================================================================
--- apr/apr-util/branches/1.3.x/test/testdbd.c (original)
+++ apr/apr-util/branches/1.3.x/test/testdbd.c Sat Sep  6 15:36:40 2008
@@ -31,7 +31,7 @@
 }
 
 #if APU_HAVE_SQLITE2 || APU_HAVE_SQLITE3
-static void test_statement(abts_case *tc, apr_dbd_t* handle, 
+static void test_statement(abts_case *tc, apr_dbd_t* handle,
                            const apr_dbd_driver_t* driver, const char* sql)
 {
     int nrows;
@@ -42,7 +42,7 @@
     ABTS_ASSERT(tc, sql, rv == APR_SUCCESS);
 }
 
-static void create_table(abts_case *tc, apr_dbd_t* handle, 
+static void create_table(abts_case *tc, apr_dbd_t* handle,
                          const apr_dbd_driver_t* driver)
 {
     const char *sql = "CREATE TABLE apr_dbd_test ("
@@ -53,14 +53,14 @@
     test_statement(tc, handle, driver, sql);
 }
 
-static void drop_table(abts_case *tc, apr_dbd_t* handle, 
+static void drop_table(abts_case *tc, apr_dbd_t* handle,
                        const apr_dbd_driver_t* driver)
 {
     const char *sql = "DROP TABLE apr_dbd_test";
     test_statement(tc, handle, driver, sql);
 }
 
-static void delete_rows(abts_case *tc, apr_dbd_t* handle, 
+static void delete_rows(abts_case *tc, apr_dbd_t* handle,
                         const apr_dbd_driver_t* driver)
 {
     const char *sql = "DELETE FROM apr_dbd_test";
@@ -68,7 +68,7 @@
 }
 
 
-static void insert_data(abts_case *tc, apr_dbd_t* handle, 
+static void insert_data(abts_case *tc, apr_dbd_t* handle,
                         const apr_dbd_driver_t* driver, int count)
 {
     apr_pool_t* pool = p;
@@ -86,7 +86,7 @@
     }
 }
 
-static void select_rows(abts_case *tc, apr_dbd_t* handle, 
+static void select_rows(abts_case *tc, apr_dbd_t* handle,
                         const apr_dbd_driver_t* driver, int count)
 {
     apr_status_t rv;
@@ -144,7 +144,7 @@
   ABTS_STR_EQUAL(tc, "foo''bar", escaped);
 }
 
-static void test_dbd_generic(abts_case *tc, apr_dbd_t* handle, 
+static void test_dbd_generic(abts_case *tc, apr_dbd_t* handle,
                              const apr_dbd_driver_t* driver)
 {
     void* native;
@@ -182,12 +182,18 @@
     rv = apr_dbd_get_driver(pool, "sqlite2", &driver);
     ABTS_ASSERT(tc, "failed to fetch driver", rv == APR_SUCCESS);
     ABTS_PTR_NOTNULL(tc, driver);
+    if (!driver) {
+    	return;
+    }
 
     ABTS_STR_EQUAL(tc, "sqlite2", apr_dbd_name(driver));
 
     rv = apr_dbd_open(driver, pool, "data/sqlite2.db:600", &handle);
     ABTS_ASSERT(tc, "failed to open database", rv == APR_SUCCESS);
     ABTS_PTR_NOTNULL(tc, handle);
+    if (!handle) {
+    	return;
+    }
 
     test_dbd_generic(tc, handle, driver);
 }
@@ -204,12 +210,18 @@
     rv = apr_dbd_get_driver(pool, "sqlite3", &driver);
     ABTS_ASSERT(tc, "failed to fetch driver", rv == APR_SUCCESS);
     ABTS_PTR_NOTNULL(tc, driver);
+    if (!driver) {
+    	return;
+    }
 
     ABTS_STR_EQUAL(tc, "sqlite3", apr_dbd_name(driver));
 
     rv = apr_dbd_open(driver, pool, "data/sqlite3.db", &handle);
     ABTS_ASSERT(tc, "failed to open database", rv == APR_SUCCESS);
     ABTS_PTR_NOTNULL(tc, handle);
+    if (!handle) {
+    	return;
+    }
 
     test_dbd_generic(tc, handle, driver);
 }



Mime
View raw message