You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2005/09/21 15:47:18 UTC

svn commit: r290695 - in /apr/apr-util/branches/1.2.x/test: dbd.c testdbd.c

Author: jorton
Date: Wed Sep 21 06:47:15 2005
New Revision: 290695

URL: http://svn.apache.org/viewcvs?rev=290695&view=rev
Log:
Merge r232567 from trunk:

Clean up warnings in the dbd tests caused by r231463.

* test/testdbd.c
  (test_statement,
   create_table,
   drop_table,
   delete_rows,
   insert_data,
   select_rows,
   test_dbd_generic): make the dbd driver argument const.
  (test_dbd_sqlite2,
   test_dbd_sqlite3): make the dbd driver variable const.

* test/dbd.c
  (create_table,
   drop_table,
   insert_rows,
   invalid_op,
   select_sequential,
   select_random,
   test_transactions,
   test_pselect,
   test_pquery): make dbd driver argument const.
  (main): make dbd driver variable const.

Submitted by: rooneg


Modified:
    apr/apr-util/branches/1.2.x/test/dbd.c
    apr/apr-util/branches/1.2.x/test/testdbd.c

Modified: apr/apr-util/branches/1.2.x/test/dbd.c
URL: http://svn.apache.org/viewcvs/apr/apr-util/branches/1.2.x/test/dbd.c?rev=290695&r1=290694&r2=290695&view=diff
==============================================================================
--- apr/apr-util/branches/1.2.x/test/dbd.c (original)
+++ apr/apr-util/branches/1.2.x/test/dbd.c Wed Sep 21 06:47:15 2005
@@ -32,7 +32,7 @@
     fflush(stdout);
 
 static int create_table(apr_pool_t* pool, apr_dbd_t* handle,
-                        apr_dbd_driver_t* driver)
+                        const apr_dbd_driver_t* driver)
 {
     int rv = 0;
     int nrows;
@@ -44,7 +44,7 @@
     return rv;
 }
 static int drop_table(apr_pool_t* pool, apr_dbd_t* handle,
-                      apr_dbd_driver_t* driver)
+                      const apr_dbd_driver_t* driver)
 {
     int rv = 0;
     int nrows;
@@ -53,7 +53,7 @@
     return rv;
 }
 static int insert_rows(apr_pool_t* pool, apr_dbd_t* handle,
-                       apr_dbd_driver_t* driver)
+                       const apr_dbd_driver_t* driver)
 {
     int i;
     int rv = 0;
@@ -91,7 +91,7 @@
     return rv;
 }
 static int invalid_op(apr_pool_t* pool, apr_dbd_t* handle,
-                      apr_dbd_driver_t* driver)
+                      const apr_dbd_driver_t* driver)
 {
     int rv = 0;
     int nrows;
@@ -105,7 +105,7 @@
     return rv;
 }
 static int select_sequential(apr_pool_t* pool, apr_dbd_t* handle,
-                             apr_dbd_driver_t* driver)
+                             const apr_dbd_driver_t* driver)
 {
     int rv = 0;
     int i = 0;
@@ -137,7 +137,7 @@
     return (rv == -1) ? 0 : 1;
 }
 static int select_random(apr_pool_t* pool, apr_dbd_t* handle,
-                         apr_dbd_driver_t* driver)
+                         const apr_dbd_driver_t* driver)
 {
     int rv = 0;
     int n;
@@ -193,7 +193,7 @@
     return rv;
 }
 static int test_transactions(apr_pool_t* pool, apr_dbd_t* handle,
-                             apr_dbd_driver_t* driver)
+                             const apr_dbd_driver_t* driver)
 {
     int rv = 0;
     int nrows;
@@ -266,7 +266,7 @@
     return rv;
 }
 static int test_pselect(apr_pool_t* pool, apr_dbd_t* handle,
-                        apr_dbd_driver_t* driver)
+                        const apr_dbd_driver_t* driver)
 {
     int rv = 0;
     int i, n;
@@ -310,7 +310,7 @@
     return (rv == -1) ? 0 : 1;
 }
 static int test_pquery(apr_pool_t* pool, apr_dbd_t* handle,
-                       apr_dbd_driver_t* driver)
+                       const apr_dbd_driver_t* driver)
 {
     int rv = 0;
     const char *query = "INSERT INTO apr_dbd_test VALUES (%s, %s, %d)";
@@ -345,7 +345,7 @@
     const char *params;
     apr_pool_t *pool = NULL;
     apr_dbd_t *sql = NULL;
-    apr_dbd_driver_t *driver = NULL;
+    const apr_dbd_driver_t *driver = NULL;
     int rv;
 
     apr_initialize();

Modified: apr/apr-util/branches/1.2.x/test/testdbd.c
URL: http://svn.apache.org/viewcvs/apr/apr-util/branches/1.2.x/test/testdbd.c?rev=290695&r1=290694&r2=290695&view=diff
==============================================================================
--- apr/apr-util/branches/1.2.x/test/testdbd.c (original)
+++ apr/apr-util/branches/1.2.x/test/testdbd.c Wed Sep 21 06:47:15 2005
@@ -32,7 +32,7 @@
 
 #if APU_HAVE_SQLITE2 || APU_HAVE_SQLITE3
 static void test_statement(abts_case *tc, apr_dbd_t* handle, 
-                           apr_dbd_driver_t* driver, const char* sql)
+                           const apr_dbd_driver_t* driver, const char* sql)
 {
     int nrows;
     apr_status_t rv;
@@ -43,7 +43,7 @@
 }
 
 static void create_table(abts_case *tc, apr_dbd_t* handle, 
-                              apr_dbd_driver_t* driver)
+                         const apr_dbd_driver_t* driver)
 {
     const char *sql = "CREATE TABLE apr_dbd_test ("
                              "col1 varchar(40) not null,"
@@ -54,14 +54,14 @@
 }
 
 static void drop_table(abts_case *tc, apr_dbd_t* handle, 
-                              apr_dbd_driver_t* driver)
+                       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, 
-                              apr_dbd_driver_t* driver)
+                        const apr_dbd_driver_t* driver)
 {
     const char *sql = "DELETE FROM apr_dbd_test";
     test_statement(tc, handle, driver, sql);
@@ -69,7 +69,7 @@
 
 
 static void insert_data(abts_case *tc, apr_dbd_t* handle, 
-                        apr_dbd_driver_t* driver, int count)
+                        const apr_dbd_driver_t* driver, int count)
 {
     apr_pool_t* pool = p;
     const char* sql = "INSERT INTO apr_dbd_test VALUES('%d', '%d', %d)";
@@ -87,7 +87,7 @@
 }
 
 static void select_rows(abts_case *tc, apr_dbd_t* handle, 
-                        apr_dbd_driver_t* driver, int count)
+                        const apr_dbd_driver_t* driver, int count)
 {
     apr_status_t rv;
     apr_pool_t* pool = p;
@@ -137,7 +137,7 @@
 }
 
 static void test_dbd_generic(abts_case *tc, apr_dbd_t* handle, 
-                             apr_dbd_driver_t* driver)
+                             const apr_dbd_driver_t* driver)
 {
     void* native;
     apr_pool_t *pool = p;
@@ -166,7 +166,7 @@
 {
     apr_pool_t *pool = p;
     apr_status_t rv;
-    apr_dbd_driver_t* driver = NULL;
+    const apr_dbd_driver_t* driver = NULL;
     apr_dbd_t* handle = NULL;
 
     rv = apr_dbd_get_driver(pool, "sqlite2", &driver);
@@ -188,7 +188,7 @@
 {
     apr_pool_t *pool = p;
     apr_status_t rv;
-    apr_dbd_driver_t* driver = NULL;
+    const apr_dbd_driver_t* driver = NULL;
     apr_dbd_t* handle = NULL;
 
     rv = apr_dbd_get_driver(pool, "sqlite3", &driver);