You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/10/28 15:26:20 UTC

svn commit: r1536364 - in /subversion/trunk: build.conf subversion/tests/libsvn_wc/wc-queries-test.c

Author: brane
Date: Mon Oct 28 14:26:19 2013
New Revision: 1536364

URL: http://svn.apache.org/r1536364
Log:
Don't compile the SQLite amalgamation twice. The WC test can use the same
wrapper as libsvn_subr.

* build.conf (wc-queries-test): Add sqlite3wrapper from libsvn_subr to sources.
* subversion/tests/libsvn_wc/wc-queries-test.c: Don't include sqlite3.c;
   Instead, use the same method as libsvn_subr/sqlite.c to import the
   wrapped functions from sqlite3wrapper.c
  (test_sqlite_version): Call sqlite3_libversion instead of using the
   sqlite3_version array directly, since the latter is not exported from
   sqlite3wrapper.c.

Modified:
    subversion/trunk/build.conf
    subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c

Modified: subversion/trunk/build.conf
URL: http://svn.apache.org/viewvc/subversion/trunk/build.conf?rev=1536364&r1=1536363&r2=1536364&view=diff
==============================================================================
--- subversion/trunk/build.conf (original)
+++ subversion/trunk/build.conf Mon Oct 28 14:26:19 2013
@@ -1209,7 +1209,7 @@ msvc-force-static = yes
 description = Test Sqlite query evaluation
 type = exe
 path = subversion/tests/libsvn_wc
-sources = wc-queries-test.c
+sources = wc-queries-test.c ../../libsvn_subr/sqlite3wrapper.c
 install = test
 libs = libsvn_test libsvn_subr apriconv apr sqlite
 

Modified: subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1536364&r1=1536363&r2=1536364&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c Mon Oct 28 14:26:19 2013
@@ -30,22 +30,17 @@
 #include "../svn_test.h"
 
 #ifdef SVN_SQLITE_INLINE
-/* Include sqlite3 inline, making all symbols private. */
-  #define SQLITE_API static
-  #ifdef __APPLE__
-    #include <Availability.h>
-    #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1060
-      /* <libkern/OSAtomic.h> is included on OS X by sqlite3.c, and
-         on old systems (Leopard or older), it cannot be compiled
-         with -std=c89 because it uses inline. This is a work-around. */
-      #define inline __inline__
-      #include <libkern/OSAtomic.h>
-      #undef inline
-    #endif
-  #endif
-  #include <sqlite3.c>
+/* Import the sqlite3 API vtable from sqlite3wrapper.c */
+#  define SQLITE_OMIT_DEPRECATED
+#  include <sqlite3ext.h>
+extern const sqlite3_api_routines *const svn_sqlite3__api_funcs;
+extern int (*const svn_sqlite3__api_initialize)(void);
+extern int (*const svn_sqlite3__api_config)(int, ...);
+#  define sqlite3_api svn_sqlite3__api_funcs
+#  define sqlite3_initialize svn_sqlite3__api_initialize
+#  define sqlite3_config svn_sqlite3__api_config
 #else
-  #include <sqlite3.h>
+#  include <sqlite3.h>
 #endif
 
 #include "../../libsvn_wc/wc-queries.h"
@@ -162,7 +157,7 @@ create_memory_db(sqlite3 **db,
 static svn_error_t *
 test_sqlite_version(apr_pool_t *scratch_pool)
 {
-  printf("DBG: Using Sqlite %s\n", sqlite3_version);
+  printf("DBG: Using Sqlite %s\n", sqlite3_libversion());
 
   if (sqlite3_libversion_number() != SQLITE_VERSION_NUMBER)
     printf("DBG: Compiled against Sqlite %s\n", SQLITE_VERSION);
@@ -170,7 +165,7 @@ test_sqlite_version(apr_pool_t *scratch_
   if (sqlite3_libversion_number() < SQLITE_VERSION_NUMBER)
     return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
             "Compiled against Sqlite %s (at runtime we have Sqlite %s)",
-            SQLITE_VERSION, sqlite3_version);
+            SQLITE_VERSION, sqlite3_libversion());
 
 #if !SQLITE_VERSION_AT_LEAST(3, 7, 9)
   return svn_error_create(SVN_ERR_TEST_FAILED, NULL,