[Libreoffice-commits] core.git: config_host/config_firebird.h.in configure.ac dbaccess/qa

Michal Kubecek mkubecek at suse.cz
Fri Jun 3 17:09:06 UTC 2016


 config_host/config_firebird.h.in                       |   10 ++++++++++
 configure.ac                                           |   16 +++++++++++++---
 dbaccess/qa/unit/data/firebird_integer_x64le_ods12.odb |binary
 dbaccess/qa/unit/firebird.cxx                          |    5 +++++
 4 files changed, 28 insertions(+), 3 deletions(-)

New commits:
commit de899f0b350e51b1932fa4674f7ce2ae386cd1ce
Author: Michal Kubecek <mkubecek at suse.cz>
Date:   Thu Jun 2 11:56:10 2016 +0200

    connectivity: firebird: use ODS12 test database for Firebird 3
    
    Firebird 3.0 uses new database file format (ODS, On Disk Structure) so
    that we need to use either ODS11 or ODS12 version of test database for
    dbaccess_firebird test, depending on whether building against Firebird
    2.5 or 3.0 libraries.
    
    Change-Id: Idecdc35b0ac87ab7f46cb79b5c044c65423a2c7e
    Reviewed-on: https://gerrit.libreoffice.org/25846
    Reviewed-by: jan iversen <jani at documentfoundation.org>
    Tested-by: jan iversen <jani at documentfoundation.org>

diff --git a/config_host/config_firebird.h.in b/config_host/config_firebird.h.in
new file mode 100644
index 0000000..c6aa43a
--- /dev/null
+++ b/config_host/config_firebird.h.in
@@ -0,0 +1,10 @@
+/*
+Settings for Firebird
+*/
+
+#ifndef CONFIG_FIREBIRD_H
+#define CONFIG_FIREBIRD_H
+
+#define HAVE_FIREBIRD_30 0
+
+#endif
diff --git a/configure.ac b/configure.ac
index 0c4b677..0a1e137 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8675,8 +8675,10 @@ if test "$enable_firebird_sdbc" = "yes" ; then
         if test -n "${FIREBIRD_VERSION}"; then
             FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
             FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2`
-            if test "$FIREBIRD_MAJOR" -eq "2" -a "$FIREBIRD_MINOR" -eq "5" -o \
-                    "$FIREBIRD_MAJOR" -eq "3" -a "$FIREBIRD_MINOR" -eq "0"; then
+            if test "$FIREBIRD_MAJOR" -eq "2" -a "$FIREBIRD_MINOR" -eq "5"; then
+                AC_MSG_RESULT([OK])
+            elif test "$FIREBIRD_MAJOR" -eq "3" -a "$FIREBIRD_MINOR" -eq "0"; then
+                AC_DEFINE(HAVE_FIREBIRD_30, 1)
                 AC_MSG_RESULT([OK])
             else
                 AC_MSG_ERROR([Ensure firebird 2.5.x or 3.0.x is installed])
@@ -8685,10 +8687,16 @@ if test "$enable_firebird_sdbc" = "yes" ; then
             __save_CFLAGS="${CFLAGS}"
             CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
             AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
-#if defined(FB_API_VER) && (FB_API_VER == 25 || FB_API_VER == 30)
+#if defined(FB_API_VER) && FB_API_VER == 25
+int fb_api_is_25(void) { return 0; }
+#elif defined(FB_API_VER) && FB_API_VER == 30
+int fb_api_is_30(void) { return 0; }
 #else
 #error "Wrong Firebird API version"
 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 2.5.x or 3.0.x is installed]))
+            if nm conftest.$OBJEXT | grep fb_api_is_30; then
+                AC_DEFINE(HAVE_FIREBIRD_30, 1)
+            fi
             CFLAGS="${__save_CFLAGS}"
         fi
         ENABLE_FIREBIRD_SDBC="TRUE"
@@ -8731,6 +8739,7 @@ AC_SUBST(LIBATOMIC_OPS_LIBS)
 AC_SUBST(SYSTEM_FIREBIRD)
 AC_SUBST(FIREBIRD_CFLAGS)
 AC_SUBST(FIREBIRD_LIBS)
+AC_SUBST(HAVE_FIREBIRD_30)
 dnl AC_SUBST([TOMMATH_CFLAGS])
 dnl AC_SUBST([TOMMATH_LIBS])
 
@@ -12938,6 +12947,7 @@ AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
 AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
 AC_CONFIG_HEADERS([config_host/config_dbus.h])
 AC_CONFIG_HEADERS([config_host/config_features.h])
+AC_CONFIG_HEADERS([config_host/config_firebird.h])
 AC_CONFIG_HEADERS([config_host/config_folders.h])
 AC_CONFIG_HEADERS([config_host/config_gio.h])
 AC_CONFIG_HEADERS([config_host/config_global.h])
diff --git a/dbaccess/qa/unit/data/firebird_integer_x64le_ods12.odb b/dbaccess/qa/unit/data/firebird_integer_x64le_ods12.odb
new file mode 100644
index 0000000..95691ed
Binary files /dev/null and b/dbaccess/qa/unit/data/firebird_integer_x64le_ods12.odb differ
diff --git a/dbaccess/qa/unit/firebird.cxx b/dbaccess/qa/unit/firebird.cxx
index c9ee575..da0bed7 100644
--- a/dbaccess/qa/unit/firebird.cxx
+++ b/dbaccess/qa/unit/firebird.cxx
@@ -16,6 +16,7 @@
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/XStatement.hpp>
 #include <svtools/miscopt.hxx>
+#include <config_firebird.h>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::sdb;
@@ -65,7 +66,11 @@ void FirebirdTest::testEmptyDBConnection()
 void FirebirdTest::testIntegerDatabase()
 {
     uno::Reference< XOfficeDatabaseDocument > xDocument =
+#if HAVE_FIREBIRD_30
+        getDocumentForFileName("firebird_integer_x64le_ods12.odb");
+#else
         getDocumentForFileName("firebird_integer_x64le.odb");
+#endif
 
     uno::Reference< XConnection > xConnection =
         getConnectionForDocument(xDocument);


More information about the Libreoffice-commits mailing list