Convert SQL & DBI backends to compile as C++.

This commit is contained in:
John Ralls
2015-11-28 13:40:55 -08:00
parent 1c57e9c61d
commit 0178492663
47 changed files with 470 additions and 401 deletions

View File

@@ -38,30 +38,30 @@ src/app-utils/option-util.c
src/app-utils/prefs.scm
src/app-utils/QuickFill.c
src/app-utils/simple-obj.scm
src/backend/dbi/gnc-backend-dbi.c
src/backend/sql/escape.c
src/backend/sql/gnc-account-sql.c
src/backend/sql/gnc-address-sql.c
src/backend/sql/gnc-backend-sql.c
src/backend/sql/gnc-bill-term-sql.c
src/backend/sql/gnc-book-sql.c
src/backend/sql/gnc-budget-sql.c
src/backend/sql/gnc-commodity-sql.c
src/backend/sql/gnc-customer-sql.c
src/backend/sql/gnc-employee-sql.c
src/backend/sql/gnc-entry-sql.c
src/backend/sql/gnc-invoice-sql.c
src/backend/sql/gnc-job-sql.c
src/backend/sql/gnc-lots-sql.c
src/backend/sql/gnc-order-sql.c
src/backend/sql/gnc-owner-sql.c
src/backend/sql/gnc-price-sql.c
src/backend/sql/gnc-recurrence-sql.c
src/backend/sql/gnc-schedxaction-sql.c
src/backend/dbi/gnc-backend-dbi.cpp
src/backend/sql/escape.cpp
src/backend/sql/gnc-account-sql.cpp
src/backend/sql/gnc-address-sql.cpp
src/backend/sql/gnc-backend-sql.cpp
src/backend/sql/gnc-bill-term-sql.cpp
src/backend/sql/gnc-book-sql.cpp
src/backend/sql/gnc-budget-sql.cpp
src/backend/sql/gnc-commodity-sql.cpp
src/backend/sql/gnc-customer-sql.cpp
src/backend/sql/gnc-employee-sql.cpp
src/backend/sql/gnc-entry-sql.cpp
src/backend/sql/gnc-invoice-sql.cpp
src/backend/sql/gnc-job-sql.cpp
src/backend/sql/gnc-lots-sql.cpp
src/backend/sql/gnc-order-sql.cpp
src/backend/sql/gnc-owner-sql.cpp
src/backend/sql/gnc-price-sql.cpp
src/backend/sql/gnc-recurrence-sql.cpp
src/backend/sql/gnc-schedxaction-sql.cpp
src/backend/sql/gnc-slots-sql.cpp
src/backend/sql/gnc-tax-table-sql.c
src/backend/sql/gnc-transaction-sql.c
src/backend/sql/gnc-vendor-sql.c
src/backend/sql/gnc-tax-table-sql.cpp
src/backend/sql/gnc-transaction-sql.cpp
src/backend/sql/gnc-vendor-sql.cpp
src/backend/xml/gnc-account-xml-v2.c
src/backend/xml/gnc-address-xml-v2.c
src/backend/xml/gnc-backend-xml.c

View File

@@ -20,7 +20,7 @@ AM_CPPFLAGS = \
${WARN_CFLAGS}
libgncmod_backend_dbi_la_SOURCES = \
gnc-backend-dbi.c
gnc-backend-dbi.cpp
noinst_HEADERS = \
gnc-backend-dbi.h \

View File

@@ -22,8 +22,14 @@
/* Private structures and variables for gnc-backend-dbi.c and its unit tests */
#ifndef GNC_BACKEND_DBI_PRIV_H
#define GNC_BACKEND_DBI_PRIV_H
#ifdef __cplusplus
extern "C"
{
#endif
#include <dbi/dbi.h>
#ifdef __cplusplus
}
#endif
#include "gnc-backend-sql.h"
/**

View File

@@ -25,7 +25,8 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL db using libdbi
*/
extern "C"
{
#include "config.h"
#include <platform.h>
@@ -37,8 +38,6 @@
#include <glib.h>
#include <glib/gstdio.h>
#include "gnc-backend-dbi-priv.h"
#include "qof.h"
#include "qofquery-p.h"
#include "qofquerycore-p.h"
@@ -53,8 +52,6 @@
#include <gnc-path.h>
#include "gnc-locale-utils.h"
#include "gnc-backend-dbi.h"
#include "gnc-prefs.h"
#ifdef S_SPLINT_S
@@ -79,6 +76,11 @@ static dbi_inst dbi_instance = NULL;
/* For direct access to dbi data structs, sadly needed for datetime */
#include <dbi/dbi-dev.h>
}
#include "gnc-backend-dbi.h"
#include "gnc-backend-dbi-priv.h"
#define GNC_HOST_NAME_MAX 255
#define TRANSACTION_NAME "trans"
@@ -226,8 +228,8 @@ gnc_dbi_verify_conn( GncDbiSqlConnection* dbi_conn )
static void
create_tables_cb( const gchar* type, gpointer data_p, gpointer be_p )
{
GncSqlObjectBackend* pData = data_p;
GncDbiBackend* be = be_p;
GncSqlObjectBackend* pData = static_cast<decltype(pData)>(data_p);
GncDbiBackend* be = static_cast<decltype(be)>(be_p);
g_return_if_fail( type != NULL && data_p != NULL && be_p != NULL );
g_return_if_fail( pData->version == GNC_SQL_BACKEND_VERSION );
@@ -239,13 +241,13 @@ create_tables_cb( const gchar* type, gpointer data_p, gpointer be_p )
}
static void
sqlite3_error_fn( dbi_conn conn, /*@ unused @*/ void* user_data )
sqlite3_error_fn(dbi_conn conn, void* user_data)
{
const gchar* msg;
(void)dbi_conn_error( conn, &msg );
GncDbiSqlConnection *db_conn = static_cast<decltype(db_conn)>(conn);
(void)dbi_conn_error(db_conn, &msg);
PERR( "DBI error: %s\n", msg );
gnc_dbi_set_error( conn, ERR_BACKEND_MISC, 0, FALSE );
gnc_dbi_set_error(db_conn, ERR_BACKEND_MISC, 0, FALSE);
}
static void
@@ -258,7 +260,7 @@ gnc_dbi_sqlite3_session_begin( QofBackend *qbe, QofSession *session,
gchar* dirname = NULL;
gchar* basename = NULL;
gchar *filepath = NULL;
gchar *msg = " ";
const char *msg = nullptr;
gboolean file_exists;
GncDbiTestResult dbi_test_result = GNC_DBI_PASS;
@@ -270,8 +272,9 @@ gnc_dbi_sqlite3_session_begin( QofBackend *qbe, QofSession *session,
/* Remove uri type if present */
filepath = gnc_uri_get_path ( book_id );
file_exists = g_file_test( filepath,
G_FILE_TEST_IS_REGULAR | G_FILE_TEST_EXISTS );
GFileTest ftest = static_cast<decltype(ftest)>(
G_FILE_TEST_IS_REGULAR | G_FILE_TEST_EXISTS) ;
file_exists = g_file_test( filepath, ftest);
if ( !create && !file_exists )
{
qof_backend_set_error( qbe, ERR_FILEIO_FILE_NOT_FOUND );
@@ -1669,7 +1672,7 @@ gnc_dbi_safe_sync_all( QofBackend *qbe, QofBook *book )
for ( iter = index_list; iter != NULL; iter = g_slist_next( iter) )
{
const char *errmsg;
conn->provider->drop_index (conn->conn, iter->data);
conn->provider->drop_index (conn->conn, static_cast<char*>(iter->data));
if ( DBI_ERROR_NONE != dbi_conn_error( conn->conn, &errmsg ) )
{
qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
@@ -2590,7 +2593,7 @@ add_columns_ddl( GncSqlConnection* conn,
static void
append_sqlite3_col_def( GString* ddl, GncSqlColumnInfo* info )
{
gchar* type_name;
const char* type_name = nullptr;
if ( info->type == BCT_INT )
{
@@ -2669,7 +2672,7 @@ conn_create_table_ddl_sqlite3( GncSqlConnection* conn,
static void
append_mysql_col_def( GString* ddl, GncSqlColumnInfo* info )
{
gchar* type_name;
const char* type_name = nullptr;
if ( info->type == BCT_INT )
{
@@ -2760,7 +2763,7 @@ conn_create_table_ddl_mysql( GncSqlConnection* conn, const gchar* table_name,
static void
append_pgsql_col_def( GString* ddl, GncSqlColumnInfo* info )
{
gchar* type_name;
const char* type_name = nullptr;
if ( info->type == BCT_INT )
{

View File

@@ -28,7 +28,10 @@
#ifndef GNC_BACKEND_DBI_H_
#define GNC_BACKEND_DBI_H_
#ifdef __cplusplus
extern "C"
{
#endif
#include <gmodule.h>
/** Initialization function which can be used when this module is
@@ -45,5 +48,7 @@ void gnc_module_finalize_backend_dbi(void);
G_MODULE_EXPORT void qof_backend_module_init(void);
G_MODULE_EXPORT void qof_backend_module_finalize(void);
#endif
#ifdef __cplusplus
}
#endif
#endif /* GNC_BACKEND_DBI_H_ */

View File

@@ -58,10 +58,10 @@ gnc_dbd_dir_override = GNC_DBD_DIR="@GNC_DBD_DIR@"
endif
test_backend_dbi_SOURCES = \
test-backend-dbi.c \
test-backend-dbi.cpp \
test-backend-dbi-basic.cpp \
test-dbi-stuff.cpp \
test-dbi-business-stuff.c
test-dbi-business-stuff.cpp
test_backend_dbi_LDFLAGS="-ldbi"
test_backend_dbi_CPPFLAGS = \

View File

@@ -37,8 +37,6 @@ extern "C"
#include <qof.h>
#include <unittest-support.h>
#include <test-stuff.h>
#include <test-dbi-stuff.h>
#include <test-dbi-business-stuff.h>
/* For cleaning up the database */
#include <dbi/dbi.h>
#include <gnc-uri-utils.h>
@@ -51,12 +49,14 @@ extern "C"
#include "gncAddress.h"
#include "gncCustomer.h"
#include "gncInvoice.h"
/* For test_conn_index_functions */
#include "../gnc-backend-dbi-priv.h"
/* For version_control */
#include <gnc-prefs.h>
#include <qofsession-p.h>
}
/* For test_conn_index_functions */
#include "test-dbi-stuff.h"
#include "test-dbi-business-stuff.h"
#include "../gnc-backend-dbi-priv.h"
#if LIBDBI_VERSION >= 900
#define HAVE_LIBDBI_R 1
@@ -66,7 +66,7 @@ static dbi_inst dbi_instance = NULL;
#endif
static const gchar* suitename = "/backend/dbi";
extern "C" void test_suite_gnc_backend_dbi (void);
void test_suite_gnc_backend_dbi (void);
typedef struct
{
@@ -616,7 +616,7 @@ create_dbi_test_suite (const char *dbm_name, const char *url)
}
extern "C" void
void
test_suite_gnc_backend_dbi (void)
{
dbi_driver driver = NULL;

View File

@@ -20,12 +20,13 @@
* Boston, MA 02110-1301, USA gnu@gnu.org *
\********************************************************************/
extern "C"
{
#include "config.h"
#include <glib.h>
#include "qof.h"
#include "cashobjects.h"
}
extern void test_suite_gnc_backend_dbi ();
#define GNC_LIB_NAME "gncmod-backend-dbi"

View File

@@ -22,14 +22,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
extern "C"
{
#include "config.h"
#include "qof.h"
#include "cashobjects.h"
#include "test-engine-stuff.h"
#include "test-stuff.h"
#include "test-dbi-stuff.h"
#include "test-dbi-business-stuff.h"
#include <unittest-support.h>
#include "Account.h"
@@ -40,6 +39,10 @@
#include "gncInvoice.h"
#include "gncEmployee.h"
#include "gncVendor.h"
}
#include "test-dbi-stuff.h"
#include "test-dbi-business-stuff.h"
G_GNUC_UNUSED static QofLogModule log_module = "test-dbi";
@@ -188,4 +191,3 @@ compare_business_books( QofBook* book_1, QofBook* book_2 )
compare_jobs( book_1, book_2 );
compare_vendors( book_1, book_2 );
}

View File

@@ -37,10 +37,10 @@ extern "C"
#include <gnc-commodity.h>
#include <SX-book.h>
#include <gnc-lot.h>
#include "../gnc-backend-dbi-priv.h"
}
#include <kvp_frame.hpp>
#include "../gnc-backend-dbi-priv.h"
G_GNUC_UNUSED static QofLogModule log_module = "test-dbi";

View File

@@ -21,29 +21,29 @@ AM_CPPFLAGS = \
${BOOST_CPPFLAGS}
libgnc_backend_sql_la_SOURCES = \
gnc-backend-sql.c \
gnc-account-sql.c \
gnc-address-sql.c \
gnc-bill-term-sql.c \
gnc-book-sql.c \
gnc-budget-sql.c \
gnc-commodity-sql.c \
gnc-customer-sql.c \
gnc-employee-sql.c \
gnc-entry-sql.c \
gnc-invoice-sql.c \
gnc-job-sql.c \
gnc-lots-sql.c \
gnc-order-sql.c \
gnc-owner-sql.c \
gnc-price-sql.c \
gnc-recurrence-sql.c \
gnc-schedxaction-sql.c \
gnc-backend-sql.cpp \
gnc-account-sql.cpp \
gnc-address-sql.cpp \
gnc-bill-term-sql.cpp \
gnc-book-sql.cpp \
gnc-budget-sql.cpp \
gnc-commodity-sql.cpp \
gnc-customer-sql.cpp \
gnc-employee-sql.cpp \
gnc-entry-sql.cpp \
gnc-invoice-sql.cpp \
gnc-job-sql.cpp \
gnc-lots-sql.cpp \
gnc-order-sql.cpp \
gnc-owner-sql.cpp \
gnc-price-sql.cpp \
gnc-recurrence-sql.cpp \
gnc-schedxaction-sql.cpp \
gnc-slots-sql.cpp \
gnc-tax-table-sql.c \
gnc-transaction-sql.c \
gnc-vendor-sql.c \
escape.c
gnc-tax-table-sql.cpp \
gnc-transaction-sql.cpp \
gnc-vendor-sql.cpp \
escape.cpp
noinst_HEADERS = \
gnc-account-sql.h \

View File

@@ -93,7 +93,8 @@ sqlEscapeString (sqlEscape *b, const char *str)
/* get more space, if needed */
if (len >= b->esc_buflen)
{
b->escape = g_realloc(b->escape, len + 100);
b->escape = static_cast<decltype(b->escape)>(g_realloc(b->escape,
len + 100));
b->esc_buflen = len + 100;
}
@@ -137,7 +138,7 @@ sqlEscape_new (void)
{
sqlEscape *b = g_new (sqlEscape, 1);
b->escape = g_malloc (INITIAL_BUFSZ);
b->escape = static_cast<decltype(b->escape)>(g_malloc (INITIAL_BUFSZ));
b->esc_buflen = INITIAL_BUFSZ;
return (b);
}

View File

@@ -25,7 +25,8 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL db
*/
extern "C"
{
#include "config.h"
#include <glib.h>
@@ -35,6 +36,10 @@
#include "AccountP.h"
#include "gnc-commodity.h"
#if defined( S_SPLINT_S )
#include "splint-defs.h"
#endif
}
#include "gnc-backend-sql.h"
#include "gnc-account-sql.h"
@@ -42,10 +47,6 @@
#include "gnc-slots-sql.h"
#include "gnc-transaction-sql.h"
#if defined( S_SPLINT_S )
#include "splint-defs.h"
#endif
static QofLogModule log_module = G_LOG_DOMAIN;
#define TABLE_NAME "accounts"
@@ -184,7 +185,8 @@ load_single_account( GncSqlBackend* be, GncSqlRow* row,
if ( gnc_account_get_parent( pAccount ) == NULL
&& pAccount != gnc_book_get_root_account( be->book ) )
{
account_parent_guid_struct* s = g_malloc( (gsize)sizeof(account_parent_guid_struct) );
account_parent_guid_struct* s = static_cast<decltype(s)>(
g_malloc(sizeof(account_parent_guid_struct)));
g_assert( s != NULL );
s->pAccount = pAccount;
@@ -336,7 +338,7 @@ gnc_sql_save_account( GncSqlBackend* be, QofInstance* inst )
gboolean is_infant;
gboolean is_ok = FALSE;
gnc_commodity* commodity;
gint op;
E_DB_OPERATION op;
g_return_val_if_fail( be != NULL, FALSE );
g_return_val_if_fail( inst != NULL, FALSE );

View File

@@ -30,8 +30,10 @@
#define GNC_ACCOUNT_SQL_H
#include "gnc-backend-sql.h"
extern "C"
{
#include "qof.h"
}
void gnc_sql_init_account_handler( void );
gboolean gnc_sql_save_account( GncSqlBackend* be, QofInstance* inst );

View File

@@ -27,7 +27,8 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL database
*/
extern "C"
{
#include "config.h"
#include <glib.h>
@@ -37,7 +38,7 @@
#include "gnc-engine.h"
#include "gncAddress.h"
}
#include "gnc-backend-sql.h"
#include "gnc-address-sql.h"
@@ -205,7 +206,7 @@ add_gvalue_address_to_slist( const GncSqlBackend* be, QofIdTypeConst obj_name,
if ( G_VALUE_TYPE(&value) != 0 )
{
addr = g_value_get_object( &value );
addr = static_cast<decltype(addr)>(g_value_get_object(&value));
for ( subtable_row = col_table; subtable_row->col_name != NULL; subtable_row++ )
{
subfield_value = g_new0( GValue, 1 );

View File

@@ -25,7 +25,8 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL db
*/
extern "C"
{
#include <stdlib.h>
#include "config.h"
@@ -45,7 +46,14 @@
#include <gncBillTerm.h>
#include <gncTaxTable.h>
#include <gncInvoice.h>
#include "gnc-prefs.h"
#include "gnc-pricedb.h"
#if defined( S_SPLINT_S )
#include "splint-defs.h"
#endif
}
#include "gnc-backend-sql.h"
#include "gnc-account-sql.h"
@@ -54,7 +62,6 @@
#include "gnc-commodity-sql.h"
#include "gnc-lots-sql.h"
#include "gnc-price-sql.h"
#include "gnc-pricedb.h"
#include "gnc-recurrence-sql.h"
#include "gnc-schedxaction-sql.h"
#include "gnc-slots-sql.h"
@@ -72,12 +79,6 @@
#include "gnc-tax-table-sql.h"
#include "gnc-vendor-sql.h"
#include "gnc-prefs.h"
#if defined( S_SPLINT_S )
#include "splint-defs.h"
#endif
static void gnc_sql_init_object_handlers( void );
static void update_progress( GncSqlBackend* be );
static void finish_progress( GncSqlBackend* be );
@@ -151,8 +152,8 @@ gnc_sql_init( /*@ unused @*/ GncSqlBackend* be )
static void
create_tables_cb( const gchar* type, gpointer data_p, gpointer be_p )
{
GncSqlObjectBackend* pData = data_p;
GncSqlBackend* be = be_p;
GncSqlObjectBackend* pData = static_cast<decltype(pData)>(data_p);
GncSqlBackend* be = static_cast<decltype(be)>(be_p);
g_return_if_fail( type != NULL && data_p != NULL && be_p != NULL );
g_return_if_fail( pData->version == GNC_SQL_BACKEND_VERSION );
@@ -182,8 +183,8 @@ gnc_sql_set_load_order( const gchar** load_order )
static void
initial_load_cb( const gchar* type, gpointer data_p, gpointer be_p )
{
GncSqlObjectBackend* pData = data_p;
GncSqlBackend* be = be_p;
GncSqlObjectBackend* pData = static_cast<decltype(pData)>(data_p);
GncSqlBackend* be = static_cast<decltype(be)>(be_p);
gint i;
g_return_if_fail( type != NULL && data_p != NULL && be_p != NULL );
@@ -212,7 +213,7 @@ initial_load_cb( const gchar* type, gpointer data_p, gpointer be_p )
void
gnc_sql_push_commodity_for_postload_processing (GncSqlBackend *be,
gpointer *comm)
gpointer comm)
{
post_load_commodities = g_list_prepend(post_load_commodities, comm);
}
@@ -246,7 +247,9 @@ gnc_sql_load( GncSqlBackend* be, /*@ dependent @*/ QofBook *book, QofBackendLoad
/* Load any initial stuff. Some of this needs to happen in a certain order */
for ( i = 0; fixed_load_order[i] != NULL; i++ )
{
pData = qof_object_lookup_backend( fixed_load_order[i], GNC_SQL_BACKEND );
pData = static_cast<decltype(pData)>(qof_object_lookup_backend(
fixed_load_order[i],
GNC_SQL_BACKEND));
if ( pData->initial_load != NULL )
{
update_progress( be );
@@ -257,7 +260,10 @@ gnc_sql_load( GncSqlBackend* be, /*@ dependent @*/ QofBook *book, QofBackendLoad
{
for ( i = 0; other_load_order[i] != NULL; i++ )
{
pData = qof_object_lookup_backend( other_load_order[i], GNC_SQL_BACKEND );
pData =
static_cast<decltype(pData)>(qof_object_lookup_backend(
other_load_order[i],
GNC_SQL_BACKEND));
if ( pData->initial_load != NULL )
{
update_progress( be );
@@ -408,7 +414,7 @@ write_schedXactions( GncSqlBackend* be )
for ( ; schedXactions != NULL && is_ok; schedXactions = schedXactions->next )
{
tmpSX = schedXactions->data;
tmpSX = static_cast<decltype(tmpSX)>(schedXactions->data);
is_ok = gnc_sql_save_schedxaction( be, QOF_INSTANCE( tmpSX ) );
}
update_progress( be );
@@ -419,8 +425,8 @@ write_schedXactions( GncSqlBackend* be )
static void
write_cb( const gchar* type, gpointer data_p, gpointer be_p )
{
GncSqlObjectBackend* pData = data_p;
GncSqlBackend* be = (GncSqlBackend*)be_p;
GncSqlObjectBackend* pData = static_cast<decltype(pData)>(data_p);
GncSqlBackend* be = static_cast<decltype(be)>(be_p);
g_return_if_fail( type != NULL && data_p != NULL && be_p != NULL );
g_return_if_fail( pData->version == GNC_SQL_BACKEND_VERSION );
@@ -546,8 +552,8 @@ gnc_sql_rollback_edit( GncSqlBackend *be, QofInstance *inst )
static void
commit_cb( const gchar* type, gpointer data_p, gpointer be_data_p )
{
GncSqlObjectBackend* pData = data_p;
sql_backend* be_data = be_data_p;
GncSqlObjectBackend* pData = static_cast<decltype(pData)>(data_p);
sql_backend* be_data = static_cast<decltype(be_data)>(be_data_p);
g_return_if_fail( type != NULL && pData != NULL && be_data != NULL );
g_return_if_fail( pData->version == GNC_SQL_BACKEND_VERSION );
@@ -684,7 +690,7 @@ handle_and_term( QofQueryTerm* pTerm, GString* sql )
for ( name = pParamPath; name != NULL; name = name->next )
{
if ( name != pParamPath ) g_string_append( sql, "." );
g_string_append( sql, name->data );
g_string_append(sql, static_cast<char*>(name->data));
}
if ( guid_data->options == QOF_GUID_MATCH_ANY )
@@ -695,7 +701,8 @@ handle_and_term( QofQueryTerm* pTerm, GString* sql )
for ( guid_entry = guid_data->guids; guid_entry != NULL; guid_entry = guid_entry->next )
{
if ( guid_entry != guid_data->guids ) g_string_append( sql, "." );
(void)guid_to_string_buff( guid_entry->data, val );
(void)guid_to_string_buff(static_cast<GncGUID*>(guid_entry->data),
val);
g_string_append( sql, "'" );
g_string_append( sql, val );
g_string_append( sql, "'" );
@@ -715,7 +722,7 @@ handle_and_term( QofQueryTerm* pTerm, GString* sql )
for ( name = pParamPath; name != NULL; name = name->next )
{
if ( name != pParamPath ) g_string_append( sql, "." );
g_string_append( sql, name->data );
g_string_append(sql, static_cast<char*>(name->data) );
}
if ( pPredData->how == QOF_COMPARE_LT )
@@ -811,8 +818,8 @@ handle_and_term( QofQueryTerm* pTerm, GString* sql )
static void
compile_query_cb( const gchar* type, gpointer data_p, gpointer be_data_p )
{
GncSqlObjectBackend* pData = data_p;
sql_backend* be_data = be_data_p;
GncSqlObjectBackend* pData = static_cast<decltype(pData)>(data_p);
sql_backend* be_data = static_cast<decltype(be_data)>(be_data_p);
g_return_if_fail( type != NULL && pData != NULL && be_data != NULL );
g_return_if_fail( pData->version == GNC_SQL_BACKEND_VERSION );
@@ -849,7 +856,8 @@ gnc_sql_compile_query( QofBackend* pBEnd, QofQuery* pQuery )
//gnc_sql_compile_query_to_sql( be, pQuery );
searchObj = qof_query_get_search_for( pQuery );
pQueryInfo = g_malloc( (gsize)sizeof( gnc_sql_query_info ) );
pQueryInfo = static_cast<decltype(pQueryInfo)>(
g_malloc(sizeof(gnc_sql_query_info)));
g_assert( pQueryInfo != NULL );
pQueryInfo->pCompiledQuery = NULL;
pQueryInfo->searchObj = searchObj;
@@ -927,8 +935,8 @@ gnc_sql_compile_query_to_sql( GncSqlBackend* be, QofQuery* query )
static void
free_query_cb( const gchar* type, gpointer data_p, gpointer be_data_p )
{
GncSqlObjectBackend* pData = data_p;
sql_backend* be_data = be_data_p;
GncSqlObjectBackend* pData = static_cast<decltype(pData)>(data_p);
sql_backend* be_data = static_cast<decltype(be_data)>(be_data_p);
g_return_if_fail( type != NULL && pData != NULL && be_data != NULL );
g_return_if_fail( pData->version == GNC_SQL_BACKEND_VERSION );
@@ -980,8 +988,8 @@ gnc_sql_free_query( QofBackend* pBEnd, gpointer pQuery )
static void
run_query_cb( const gchar* type, gpointer data_p, gpointer be_data_p )
{
GncSqlObjectBackend* pData = data_p;
sql_backend* be_data = be_data_p;
GncSqlObjectBackend* pData = static_cast<decltype(pData)>(data_p);
sql_backend* be_data = static_cast<decltype(be_data)>(be_data_p);
g_return_if_fail( type != NULL && pData != NULL && be_data != NULL );
g_return_if_fail( pData->version == GNC_SQL_BACKEND_VERSION );
@@ -1125,14 +1133,14 @@ gnc_sql_get_integer_value( const GValue* value )
/* ----------------------------------------------------------------- */
/*@ null @*/ static gpointer
get_autoinc_id()
get_autoinc_id(void *object, const QofParam* param)
{
// Just need a 0 to force a new autoinc value
return (gpointer)0;
}
static void
set_autoinc_id()
set_autoinc_id(void* object, void *item)
{
// Nowhere to put the ID
}
@@ -1380,7 +1388,8 @@ add_gvalue_int_to_slist( const GncSqlBackend* be, QofIdTypeConst obj_name,
if ( table_row->gobj_param_name != NULL )
{
g_object_get_property( pObject, table_row->gobj_param_name, value );
g_object_get_property(G_OBJECT(pObject), table_row->gobj_param_name,
value );
}
else
{
@@ -1688,7 +1697,7 @@ add_gvalue_double_to_slist( const GncSqlBackend* be, QofIdTypeConst obj_name,
getter = gnc_sql_get_getter( obj_name, table_row );
if ( getter != NULL )
{
pDouble = (*getter)( pObject, NULL );
pDouble = static_cast<decltype(pDouble)>((*getter)(pObject, NULL ));
}
if ( pDouble != NULL )
{
@@ -1798,7 +1807,7 @@ add_gvalue_guid_to_slist( const GncSqlBackend* be, QofIdTypeConst obj_name,
getter = gnc_sql_get_getter( obj_name, table_row );
if ( getter != NULL )
{
guid = (*getter)( pObject, NULL );
guid = static_cast<decltype(guid)>((*getter)( pObject, NULL ));
}
}
(void)g_value_init( value, G_TYPE_STRING );
@@ -1848,7 +1857,7 @@ gnc_sql_add_gvalue_objectref_guid_to_slist( const GncSqlBackend* be, QofIdTypeCo
getter = gnc_sql_get_getter( obj_name, table_row );
if ( getter != NULL )
{
inst = (*getter)( pObject, NULL );
inst = static_cast<decltype(inst)>((*getter)( pObject, NULL ));
}
}
if ( inst != NULL )
@@ -2084,7 +2093,7 @@ load_date( const GncSqlBackend* be, GncSqlRow* row,
{
gchar buf[5];
GDateDay day;
guint month;
GDateMonth month;
GDateYear year;
strncpy( buf, &s[0], 4 );
@@ -2092,7 +2101,7 @@ load_date( const GncSqlBackend* be, GncSqlRow* row,
year = (GDateYear)atoi( buf );
strncpy( buf, &s[4], 2 );
buf[2] = '\0';
month = (guint)atoi( buf );
month = static_cast<decltype(month)>(atoi( buf ));
strncpy( buf, &s[6], 2 );
day = (GDateDay)atoi( buf );
@@ -2373,7 +2382,8 @@ get_handler( const GncSqlColumnTableEntry* table_row )
if ( g_columnTypeHash != NULL )
{
pHandler = g_hash_table_lookup( g_columnTypeHash, table_row->col_type );
pHandler = static_cast<decltype(pHandler)>(
g_hash_table_lookup(g_columnTypeHash, table_row->col_type));
g_assert( pHandler != NULL );
}
else
@@ -3049,7 +3059,7 @@ gnc_sql_commit_standard_item( GncSqlBackend* be, QofInstance* inst, const gchar*
{
const GncGUID* guid;
gboolean is_infant;
gint op;
E_DB_OPERATION op;
gboolean is_ok;
is_infant = qof_instance_get_infant( inst );

View File

@@ -38,11 +38,12 @@
#ifndef GNC_BACKEND_SQL_H
#define GNC_BACKEND_SQL_H
extern "C"
{
#include "qof.h"
#include "qofbackend-p.h"
#include <gmodule.h>
}
typedef struct GncSqlConnection GncSqlConnection;
/**
@@ -89,7 +90,7 @@ void gnc_sql_load( GncSqlBackend* be, /*@ dependent @*/ QofBook *book, QofBacken
* @param comm The commodity item to be committed.
*/
void gnc_sql_push_commodity_for_postload_processing (GncSqlBackend *be,
gpointer *comm);
gpointer comm);
/**
* Save the contents of a book to an SQL database.

View File

@@ -27,20 +27,22 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL database
*/
extern "C"
{
#include "config.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "gnc-backend-sql.h"
#include "gnc-slots-sql.h"
#include "gncBillTermP.h"
#include "gncInvoice.h"
#include "gnc-bill-term-sql.h"
#include "qof.h"
}
#include "gnc-backend-sql.h"
#include "gnc-slots-sql.h"
#include "gnc-bill-term-sql.h"
#define _GNC_MOD_NAME GNC_ID_BILLTERM
@@ -193,7 +195,8 @@ load_single_billterm( GncSqlBackend* be, GncSqlRow* row,
GncGUID so that after they are all loaded, the parents can be fixed up. */
if ( gncBillTermGetParent( pBillTerm ) == NULL )
{
billterm_parent_guid_struct* s = g_malloc( (gsize)sizeof(billterm_parent_guid_struct) );
billterm_parent_guid_struct* s = static_cast<decltype(s)>(
g_malloc(sizeof(billterm_parent_guid_struct)));
g_assert( s != NULL );
s->billterm = pBillTerm;

View File

@@ -31,8 +31,10 @@
#define GNC_BILLTERM_SQL_H
#include "gnc-backend-sql.h"
extern "C"
{
#include "qof.h"
}
#define CT_BILLTERMREF "billterm"
void gnc_billterm_sql_initialize( void );

View File

@@ -25,18 +25,14 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL db
*/
extern "C"
{
#include "config.h"
#include <glib.h>
#include "qof.h"
#include "gnc-backend-sql.h"
#include "gnc-book-sql.h"
#include "gnc-slots-sql.h"
#include "gnc-engine.h"
#include "SX-book.h"
#include "SX-book-p.h"
@@ -44,6 +40,11 @@
#if defined( S_SPLINT_S )
#include "splint-defs.h"
#endif
}
#include "gnc-backend-sql.h"
#include "gnc-book-sql.h"
#include "gnc-slots-sql.h"
#define BOOK_TABLE "books"
#define TABLE_VERSION 1

View File

@@ -30,8 +30,10 @@
#define GNC_BOOK_SQL_H
#include "gnc-backend-sql.h"
extern "C"
{
#include "qof.h"
}
void gnc_sql_init_book_handler( void );
gboolean gnc_sql_save_book( GncSqlBackend* be, QofInstance* inst );

View File

@@ -25,26 +25,24 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL db
*/
extern "C"
{
#include "config.h"
#include <glib.h>
#include "qof.h"
#include "gnc-backend-sql.h"
#include "Recurrence.h"
#include "gnc-budget-sql.h"
#include "gnc-slots-sql.h"
#include "gnc-recurrence-sql.h"
#include "gnc-budget.h"
#if defined( S_SPLINT_S )
#include "splint-defs.h"
#endif
}
#include "gnc-backend-sql.h"
#include "gnc-budget-sql.h"
#include "gnc-slots-sql.h"
#include "gnc-recurrence-sql.h"
#define BUDGET_TABLE "budgets"
#define TABLE_VERSION 1
@@ -394,7 +392,7 @@ save_budget( GncSqlBackend* be, QofInstance* inst )
{
GncBudget* pBudget = GNC_BUDGET(inst);
const GncGUID* guid;
gint op;
E_DB_OPERATION op;
gboolean is_infant;
gboolean is_ok;

View File

@@ -25,16 +25,17 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL db
*/
extern "C"
{
#include "config.h"
#include <glib.h>
#include "qof.h"
#include "gnc-commodity.h"
}
#include "gnc-backend-sql.h"
#include "gnc-commodity.h"
#include "gnc-commodity-sql.h"
#include "gnc-slots-sql.h"
@@ -189,7 +190,7 @@ do_commit_commodity( GncSqlBackend* be, QofInstance* inst, gboolean force_insert
{
const GncGUID* guid;
gboolean is_infant;
gint op;
E_DB_OPERATION op;
gboolean is_ok;
is_infant = qof_instance_get_infant( inst );

View File

@@ -30,8 +30,10 @@
#define GNC_COMMODITY_SQL_H
#include "gnc-backend-sql.h"
extern "C"
{
#include "gnc-commodity.h"
}
void gnc_sql_init_commodity_handler( void );
gboolean gnc_sql_save_commodity( GncSqlBackend* be, gnc_commodity* pCommodity );
void gnc_sql_commit_commodity (gnc_commodity* pCommodity);

View File

@@ -27,19 +27,21 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL database
*/
extern "C"
{
#include "config.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "gnc-backend-sql.h"
#include "gnc-slots-sql.h"
#include "gncBillTermP.h"
#include "gncCustomerP.h"
#include "gncTaxTableP.h"
}
#include "gnc-backend-sql.h"
#include "gnc-slots-sql.h"
#include "gnc-customer-sql.h"
#include "gnc-address-sql.h"
#include "gnc-bill-term-sql.h"

View File

@@ -27,7 +27,8 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL database
*/
extern "C"
{
#include "config.h"
#include <glib.h>
@@ -35,15 +36,16 @@
#include <string.h>
#include "gnc-commodity.h"
#include "gncEmployeeP.h"
}
#include "gnc-backend-sql.h"
#include "gnc-slots-sql.h"
#include "gnc-commodity-sql.h"
#include "gncEmployeeP.h"
#include "gnc-employee-sql.h"
#include "gnc-address-sql.h"
#define _GNC_MOD_NAME GNC_ID_EMPLOYEE
static QofLogModule log_module = G_LOG_DOMAIN;
@@ -158,7 +160,7 @@ save_employee( GncSqlBackend* be, QofInstance* inst )
{
GncEmployee* emp;
const GncGUID* guid;
gint op;
E_DB_OPERATION op;
gboolean is_infant;
gboolean is_ok = TRUE;

View File

@@ -27,20 +27,21 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL database
*/
extern "C"
{
#include "config.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "gnc-backend-sql.h"
#include "gnc-slots-sql.h"
#include "gncEntryP.h"
#include "gncOrderP.h"
#include "gncInvoiceP.h"
#include "gncTaxTableP.h"
}
#include "gnc-backend-sql.h"
#include "gnc-slots-sql.h"
#include "gnc-bill-term-sql.h"
#include "gnc-entry-sql.h"
#include "gnc-invoice-sql.h"

View File

@@ -27,7 +27,8 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL database
*/
extern "C"
{
#include "config.h"
#include <glib.h>
@@ -36,12 +37,12 @@
#include "gnc-commodity.h"
#include "gncBillTermP.h"
#include "gncInvoiceP.h"
}
#include "gnc-backend-sql.h"
#include "gnc-commodity-sql.h"
#include "gnc-slots-sql.h"
#include "gncBillTermP.h"
#include "gncInvoiceP.h"
#include "gnc-invoice-sql.h"
#include "gnc-owner-sql.h"
#include "gnc-bill-term-sql.h"
@@ -181,7 +182,7 @@ save_invoice( GncSqlBackend* be, QofInstance* inst )
{
const GncGUID* guid;
GncInvoice* invoice;
gint op;
E_DB_OPERATION op;
gboolean is_infant;
gboolean is_ok = TRUE;

View File

@@ -27,17 +27,19 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL database
*/
extern "C"
{
#include "config.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "gncJobP.h"
}
#include "gnc-backend-sql.h"
#include "gnc-slots-sql.h"
#include "gncJobP.h"
#include "gnc-job-sql.h"
#include "gnc-owner-sql.h"

View File

@@ -26,6 +26,8 @@
* restoring data to/from an SQL db
*/
extern "C"
{
#include "config.h"
#include <glib.h>
@@ -34,15 +36,15 @@
#include "Account.h"
#include "gnc-lot.h"
#if defined( S_SPLINT_S )
#include "splint-defs.h"
#endif
}
#include "gnc-backend-sql.h"
#include "gnc-slots-sql.h"
#include "gnc-lots-sql.h"
#if defined( S_SPLINT_S )
#include "splint-defs.h"
#endif
/*@ unused @*/ static QofLogModule log_module = G_LOG_DOMAIN;
#define TABLE_NAME "lots"

View File

@@ -28,17 +28,17 @@
* restoring data to/from an SQL database
*/
extern "C"
{
#include "config.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "gncOrderP.h"
}
#include "gnc-backend-sql.h"
#include "gnc-slots-sql.h"
#include "gncOrderP.h"
#include "gnc-order-sql.h"
#include "gnc-owner-sql.h"

View File

@@ -27,20 +27,20 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL database
*/
extern "C"
{
#include "config.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "gnc-backend-sql.h"
#include "gnc-owner-sql.h"
#include "gncCustomerP.h"
#include "gncJobP.h"
#include "gncEmployeeP.h"
#include "gncVendorP.h"
}
#include "gnc-backend-sql.h"
#include "gnc-owner-sql.h"
static QofLogModule log_module = G_LOG_DOMAIN;

View File

@@ -25,7 +25,8 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL db
*/
extern "C"
{
#include "config.h"
#include <glib.h>
@@ -33,15 +34,16 @@
#include "qof.h"
#include "gnc-pricedb.h"
#if defined( S_SPLINT_S )
#include "splint-defs.h"
#endif
}
#include "gnc-backend-sql.h"
#include "gnc-commodity-sql.h"
#include "gnc-price-sql.h"
#include "gnc-slots-sql.h"
#if defined( S_SPLINT_S )
#include "splint-defs.h"
#endif
/*@ unused @*/ static QofLogModule log_module = G_LOG_DOMAIN;
@@ -158,7 +160,7 @@ static gboolean
save_price( GncSqlBackend* be, QofInstance* inst )
{
GNCPrice* pPrice = GNC_PRICE(inst);
gint op;
E_DB_OPERATION op;
gboolean is_infant;
gboolean is_ok = TRUE;

View File

@@ -25,7 +25,8 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL db
*/
extern "C"
{
#include "config.h"
#include <glib.h>
@@ -34,13 +35,13 @@
#include "gnc-engine.h"
#include "Recurrence.h"
#include "gnc-backend-sql.h"
#include "gnc-recurrence-sql.h"
#if defined( S_SPLINT_S )
#include "splint-defs.h"
#endif
}
#include "gnc-backend-sql.h"
#include "gnc-recurrence-sql.h"
G_GNUC_UNUSED static QofLogModule log_module = G_LOG_DOMAIN;

View File

@@ -28,10 +28,12 @@
#ifndef GNC_RECURRENCE_SQL_H
#define GNC_RECURRENCE_SQL_H
extern "C"
{
#include <glib.h>
#include "Recurrence.h"
#include "guid.h"
}
#include "gnc-backend-sql.h"
gboolean gnc_sql_recurrence_save( GncSqlBackend* be, const GncGUID* guid, const Recurrence* pRecurrence );

View File

@@ -25,28 +25,28 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL db
*/
extern "C"
{
#include "config.h"
#include <glib.h>
#include "qof.h"
#include "gnc-backend-sql.h"
#include "gnc-schedxaction-sql.h"
#include "gnc-slots-sql.h"
#include "SchedXaction.h"
#include "SX-book.h"
#include "Recurrence.h"
#include "gnc-recurrence-sql.h"
#include "gnc-transaction-sql.h"
#ifdef S_SPLINT_S
#include "splint-defs.h"
#endif
}
#include "gnc-backend-sql.h"
#include "gnc-schedxaction-sql.h"
#include "gnc-slots-sql.h"
#include "gnc-recurrence-sql.h"
#include "gnc-transaction-sql.h"
#define SCHEDXACTION_TABLE "schedxactions"
#define TABLE_VERSION 1
@@ -167,7 +167,7 @@ gnc_sql_save_schedxaction( GncSqlBackend* be, QofInstance* inst )
{
SchedXaction* pSx;
const GncGUID* guid;
gint op;
E_DB_OPERATION op;
gboolean is_infant;
gboolean is_ok;

View File

@@ -28,8 +28,10 @@
#ifndef GNC_SCHEDXACTION_SQL_H
#define GNC_SCHEDXACTION_SQL_H
extern "C"
{
#include "qof.h"
}
#include "gnc-backend-sql.h"
void gnc_sql_init_schedxaction_handler( void );

View File

@@ -33,14 +33,13 @@ extern "C"
#include <qof.h>
#include <gnc-engine.h>
#include "gnc-backend-sql.h"
#include "gnc-slots-sql.h"
#ifdef S_SPLINT_S
#include "splint-defs.h"
#endif
}
#include "gnc-backend-sql.h"
#include "gnc-slots-sql.h"
#include <kvp_frame.hpp>

View File

@@ -28,14 +28,12 @@
#ifndef GNC_SLOTS_SQL_H
#define GNC_SLOTS_SQL_H
#ifdef __cplusplus
extern "C"
{
#endif
#include <glib.h>
#include "guid.h"
#include "qof.h"
}
#include "gnc-backend-sql.h"
/**
@@ -91,7 +89,4 @@ void gnc_sql_slots_load_for_sql_subquery( GncSqlBackend* be, const gchar* subque
void gnc_sql_init_slots_handler( void );
#ifdef __cplusplus
}
#endif
#endif /* GNC_SLOTS_SQL_H */

View File

@@ -27,19 +27,20 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL database
*/
extern "C"
{
#include "config.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "gnc-backend-sql.h"
#include "gnc-slots-sql.h"
#include "gncEntry.h"
#include "gncTaxTableP.h"
}
#include "gnc-backend-sql.h"
#include "gnc-slots-sql.h"
#include "gnc-tax-table-sql.h"
#define _GNC_MOD_NAME GNC_ID_TAXTABLE
@@ -274,7 +275,8 @@ load_single_taxtable( GncSqlBackend* be, GncSqlRow* row,
GncGUID so that after they are all loaded, the parents can be fixed up. */
if ( gncTaxTableGetParent( tt ) == NULL )
{
taxtable_parent_guid_struct* s = g_malloc( (gsize)sizeof(taxtable_parent_guid_struct) );
taxtable_parent_guid_struct* s = static_cast<decltype(s)>(
g_malloc(sizeof(taxtable_parent_guid_struct)));
g_assert( s != NULL );
s->tt = tt;
@@ -423,7 +425,7 @@ save_taxtable( GncSqlBackend* be, QofInstance* inst )
{
GncTaxTable* tt;
const GncGUID* guid;
gint op;
E_DB_OPERATION op;
gboolean is_infant;
gboolean is_ok;
@@ -565,4 +567,3 @@ gnc_taxtable_sql_initialize( void )
gnc_sql_register_col_type_handler( CT_TAXTABLEREF, &taxtable_guid_handler );
}
/* ========================== END OF FILE ===================== */

View File

@@ -25,7 +25,8 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL db
*/
extern "C"
{
#include "config.h"
#include <glib/gi18n.h>
@@ -38,13 +39,7 @@
#include "Transaction.h"
#include "gnc-lot.h"
#include "engine-helpers.h"
#include "gnc-backend-sql.h"
#include "gnc-transaction-sql.h"
#include "gnc-commodity.h"
#include "gnc-commodity-sql.h"
#include "gnc-slots-sql.h"
#include "gnc-engine.h"
#include "escape.h"
@@ -52,6 +47,12 @@
#ifdef S_SPLINT_S
#include "splint-defs.h"
#endif
}
#include "gnc-backend-sql.h"
#include "gnc-transaction-sql.h"
#include "gnc-commodity-sql.h"
#include "gnc-slots-sql.h"
#define SIMPLE_QUERY_COMPILATION 1
#define LOAD_TRANSACTIONS_AS_NEEDED 0
@@ -594,7 +595,7 @@ delete_splits( GncSqlBackend* be, Transaction* pTx )
static gboolean
commit_split( GncSqlBackend* be, QofInstance* inst )
{
gint op;
E_DB_OPERATION op;
gboolean is_infant;
gboolean is_ok;
GncGUID *guid = (GncGUID*)qof_instance_get_guid(inst);
@@ -670,11 +671,11 @@ static gboolean
save_transaction( GncSqlBackend* be, Transaction* pTx, gboolean do_save_splits )
{
const GncGUID* guid;
gint op;
E_DB_OPERATION op;
gboolean is_infant;
QofInstance* inst;
gboolean is_ok = TRUE;
gchar* err = NULL;
const char* err = NULL;
g_return_val_if_fail( be != NULL, FALSE );
g_return_val_if_fail( pTx != NULL, FALSE );
@@ -754,11 +755,11 @@ save_transaction( GncSqlBackend* be, Transaction* pTx, gboolean do_save_splits )
}
if (! is_ok )
{
G_GNUC_UNUSED gchar *message1 = "Transaction %s dated %s in account %s not saved due to %s.%s";
G_GNUC_UNUSED gchar *message2 = "\nDatabase may be corrupted, check your data carefully.";
Split* split = xaccTransGetSplit( pTx, 0);
Account *acc = xaccSplitGetAccount( split );
/* FIXME: This needs to be implemented
const char *message1 = "Transaction %s dated %s in account %s not saved due to %s.%s";
const char *message2 = "\nDatabase may be corrupted, check your data carefully.";
qof_error_format_secondary_text( GTK_MESSAGE_DIALOG( msg ),
message1,
xaccTransGetDescription( pTx ),
@@ -931,7 +932,8 @@ convert_query_term_to_sql( const GncSqlBackend* be, const gchar* fieldName, QofQ
gchar guid_buf[GUID_ENCODING_LENGTH+1];
if ( guid_entry != guid_data->guids ) g_string_append( sql, "," );
(void)guid_to_string_buff( guid_entry->data, guid_buf );
(void)guid_to_string_buff(static_cast<GncGUID*>(guid_entry->data),
guid_buf );
g_string_append_printf( sql, "'%s'", guid_buf );
}
g_string_append( sql, "))" );
@@ -1085,7 +1087,8 @@ compile_split_query( GncSqlBackend* be, QofQuery* query )
g_return_val_if_fail( be != NULL, NULL );
g_return_val_if_fail( query != NULL, NULL );
query_info = g_malloc( (gsize)sizeof(split_query_info_t) );
query_info = static_cast<decltype(query_info)>(
g_malloc(sizeof(split_query_info_t)));
g_assert( query_info != NULL );
query_info->has_been_run = FALSE;
@@ -1117,18 +1120,20 @@ compile_split_query( GncSqlBackend* be, QofQuery* query )
term = (QofQueryTerm*)andTerm->data;
paramPath = qof_query_term_get_param_path( term );
if ( strcmp( paramPath->data, QOF_PARAM_BOOK ) == 0 ) continue;
const char *path = static_cast<decltype(path)>(paramPath->data);
const char *next_path =
static_cast<decltype(next_path)>(paramPath->next->data);
if (strcmp(path, QOF_PARAM_BOOK) == 0) continue;
#if SIMPLE_QUERY_COMPILATION
if ( strcmp( paramPath->data, SPLIT_ACCOUNT ) != 0
|| strcmp( paramPath->next->data, QOF_PARAM_GUID ) != 0 ) continue;
if ( strcmp(path, SPLIT_ACCOUNT) != 0 ||
strcmp(next_path, QOF_PARAM_GUID) != 0 ) continue;
#endif
if ( need_AND ) g_string_append( sql, " AND " );
if ( strcmp( paramPath->data, SPLIT_ACCOUNT ) == 0
&& strcmp( paramPath->next->data, QOF_PARAM_GUID ) == 0 )
if ( strcmp(path, SPLIT_ACCOUNT) == 0 &&
strcmp(next_path, QOF_PARAM_GUID) == 0 )
{
convert_query_term_to_sql( be, "s.account_guid", term, sql );
#if SIMPLE_QUERY_COMPILATION
@@ -1136,12 +1141,12 @@ compile_split_query( GncSqlBackend* be, QofQuery* query )
#endif
}
else if ( strcmp( paramPath->data, SPLIT_RECONCILE ) == 0 )
else if ( strcmp(path, SPLIT_RECONCILE) == 0 )
{
convert_query_term_to_sql( be, "s.reconcile_state", term, sql );
}
else if ( strcmp( paramPath->data, SPLIT_TRANS ) == 0 )
else if ( strcmp(path, SPLIT_TRANS) == 0 )
{
#if TX_GUID_CHECK
if ( !has_tx_guid_check )
@@ -1150,11 +1155,11 @@ compile_split_query( GncSqlBackend* be, QofQuery* query )
has_tx_guid_check = TRUE;
}
#endif
if ( strcmp( paramPath->next->data, TRANS_DATE_POSTED ) == 0 )
if (strcmp(next_path, TRANS_DATE_POSTED) == 0 )
{
convert_query_term_to_sql( be, "t.post_date", term, sql );
}
else if ( strcmp( paramPath->next->data, TRANS_DESCRIPTION ) == 0 )
else if (strcmp(next_path, TRANS_DESCRIPTION) == 0 )
{
convert_query_term_to_sql( be, "t.description", term, sql );
}
@@ -1164,7 +1169,7 @@ compile_split_query( GncSqlBackend* be, QofQuery* query )
}
}
else if ( strcmp( paramPath->data, SPLIT_VALUE ) == 0 )
else if ( strcmp(path, SPLIT_VALUE) == 0 )
{
convert_query_term_to_sql( be, "s.value_num/s.value_denom", term, sql );
@@ -1180,7 +1185,7 @@ compile_split_query( GncSqlBackend* be, QofQuery* query )
while ( paramPath->next != NULL )
{
g_string_append( name, "." );
g_string_append( name, paramPath->next->data );
g_string_append( name, next_path );
paramPath = paramPath->next;
}
PERR( "Unknown SPLIT query field: %s\n", name->str );
@@ -1323,7 +1328,7 @@ load_single_acct_balances( const GncSqlBackend* be, GncSqlRow* row )
g_return_val_if_fail( be != NULL, NULL );
g_return_val_if_fail( row != NULL, NULL );
bal = g_malloc( (gsize)sizeof(single_acct_balance_t) );
bal = static_cast<decltype(bal)>(g_malloc(sizeof(single_acct_balance_t)));
g_assert( bal != NULL );
bal->be = be;

View File

@@ -30,10 +30,12 @@
#define GNC_TRANSACTION_SQL_H
#include "gnc-backend-sql.h"
extern "C"
{
#include "Transaction.h"
#include "qof.h"
#include "Account.h"
}
void gnc_sql_init_transaction_handler( void );
/**

View File

@@ -27,27 +27,27 @@
* This file implements the top-level QofBackend API for saving/
* restoring data to/from an SQL database
*/
extern "C"
{
#include "config.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "gnc-commodity.h"
#include "gnc-backend-sql.h"
#include "gnc-commodity-sql.h"
#include "gnc-slots-sql.h"
#include "gnc-commodity.h"
#include "gncBillTermP.h"
#include "gncVendorP.h"
#include "gncTaxTableP.h"
}
#include "gnc-vendor-sql.h"
#include "gnc-address-sql.h"
#include "gnc-bill-term-sql.h"
#include "gnc-tax-table-sql.h"
#include "gnc-backend-sql.h"
#include "gnc-commodity-sql.h"
#include "gnc-slots-sql.h"
#define _GNC_MOD_NAME GNC_ID_VENDOR
@@ -155,7 +155,7 @@ save_vendor( GncSqlBackend* be, QofInstance* inst )
{
GncVendor* v;
const GncGUID* guid;
gint op;
E_DB_OPERATION op;
gboolean is_infant;
gboolean is_ok = TRUE;

View File

@@ -4,7 +4,7 @@ include $(top_srcdir)/test-templates/Makefile.decl
MODULEPATH = src/backend/sql
test_column_types_SOURCES = \
test-column-types.c
test-column-types.cpp
check_PROGRAMS = \
test-column-types \
@@ -53,8 +53,8 @@ AM_CPPFLAGS += -DG_LOG_DOMAIN=\"gnc.backend.sql\"
#test_sqlbedir = ${top_srcdir}/${MODULEPATH}/test
test_sqlbe_SOURCES = \
test-sqlbe.c \
utest-gnc-backend-sql.c
test-sqlbe.cpp \
utest-gnc-backend-sql.cpp
#test_sqlbe_HEADERS = \
# $(top_srcdir)/$(MODULEPATH)/gnc-backend-sql.h

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* test-column-types.c
* test-column-types.cpp
*
* Tests the basic SQL column types
*
@@ -23,12 +23,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
extern "C"
{
#include "config.h"
#include "qof.h"
#include "cashobjects.h"
#include "test-stuff.h"
}
#include "gnc-backend-sql.h"
int main( int argc, char ** argv )

View File

@@ -20,11 +20,12 @@
* Boston, MA 02110-1301, USA gnu@gnu.org *
\********************************************************************/
extern "C"
{
#include "config.h"
#include <glib.h>
#include "qof.h"
}
extern void test_suite_gnc_backend_sql ();
int

View File

@@ -20,10 +20,13 @@
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
* Boston, MA 02110-1301, USA gnu@gnu.org *
********************************************************************/
extern "C"
{
#include "config.h"
#include <string.h>
#include <glib.h>
#include <unittest-support.h>
}
/* Add specific headers for this class */
#include "../gnc-backend-sql.h"
@@ -195,12 +198,14 @@ test_gnc_sql_commit_edit (void)
QofInstance *inst;
guint dirty_called = 0;
GncSqlConnection conn;
gchar *msg1 = "[gnc_sql_commit_edit()] gnc_sql_commit_edit(): Unknown object type 'null'\n";
gchar *msg2 = "[gnc_sql_commit_edit()] gnc_sql_commit_edit(): Unknown object type 'Book'\n";
guint loglevel = G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL;
gchar *logdomain = "gnc.backend.sql";
TestErrorStruct check1 = { loglevel, logdomain, msg1, 0 };
TestErrorStruct check2 = { loglevel, logdomain, msg2, 0 };
const char *msg1 = "[gnc_sql_commit_edit()] gnc_sql_commit_edit(): Unknown object type 'null'\n";
const char *msg2 = "[gnc_sql_commit_edit()] gnc_sql_commit_edit(): Unknown object type 'Book'\n";
GLogLevelFlags loglevel = static_cast<decltype(loglevel)>(G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL);
const char *logdomain = "gnc.backend.sql";
TestErrorStruct check1 = { loglevel, const_cast<char*>(logdomain),
const_cast<char*>(msg1), 0 };
TestErrorStruct check2 = { loglevel, const_cast<char*>(logdomain),
const_cast<char*>(msg2), 0 };
guint hdlr1;
test_add_error (&check1);
@@ -215,7 +220,7 @@ test_gnc_sql_commit_edit (void)
conn.beginTransaction = fake_connection_function;
conn.rollbackTransaction = fake_connection_function;
conn.commitTransaction = fake_connection_function;
inst = g_object_new (QOF_TYPE_INSTANCE, NULL);
inst = static_cast<decltype(inst)>(g_object_new (QOF_TYPE_INSTANCE, NULL));
qof_instance_init_data (inst, QOF_ID_NULL, be.book);
be.loading = FALSE;
qof_book_set_dirty_cb (be.book, test_dirty_cb, &dirty_called);
@@ -581,20 +586,20 @@ static void
test_gnc_sql_convert_timespec_to_string ()
{
GncSqlBackend be = {{
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
0, NULL, 0, "", NULL
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, ERR_BACKEND_NO_ERR, nullptr, 0, nullptr, nullptr
},
NULL, NULL, FALSE, FALSE, FALSE, 0, 0, NULL,
nullptr, nullptr, FALSE, FALSE, FALSE, 0, 0, nullptr,
"%4d-%02d-%02d %02d:%02d:%02d"
};
gchar *date[numtests] = {"1995-03-11 19:17:26",
"2001-04-20 11:44:07",
"1964-02-29 09:15:23",
"1959-04-02 00:00:00",
"2043-11-22 05:32:45",
"2153-12-18 01:15:30"
};
const char *date[numtests] = {"1995-03-11 19:17:26",
"2001-04-20 11:44:07",
"1964-02-29 09:15:23",
"1959-04-02 00:00:00",
"2043-11-22 05:32:45",
"2153-12-18 01:15:30"
};
int i;
for (i = 0; i < numtests; i++)
{
@@ -941,107 +946,107 @@ void
test_suite_gnc_backend_sql (void)
{
// GNC_TEST_ADD (suitename, "gnc sql init", Fixture, NULL, test_gnc_sql_init, teardown);
// GNC_TEST_ADD (suitename, "create tables cb", Fixture, NULL, test_create_tables_cb, teardown);
// GNC_TEST_ADD (suitename, "gnc sql set load order", Fixture, NULL, test_gnc_sql_set_load_order, teardown);
// GNC_TEST_ADD (suitename, "initial load cb", Fixture, NULL, test_initial_load_cb, teardown);
// GNC_TEST_ADD (suitename, "gnc sql load", Fixture, NULL, test_gnc_sql_load, teardown);
// GNC_TEST_ADD (suitename, "write account tree", Fixture, NULL, test_write_account_tree, teardown);
// GNC_TEST_ADD (suitename, "write accounts", Fixture, NULL, test_write_accounts, teardown);
// GNC_TEST_ADD (suitename, "write tx", Fixture, NULL, test_write_tx, teardown);
// GNC_TEST_ADD (suitename, "write transactions", Fixture, NULL, test_write_transactions, teardown);
// GNC_TEST_ADD (suitename, "write template transactions", Fixture, NULL, test_write_template_transactions, teardown);
// GNC_TEST_ADD (suitename, "write schedXactions", Fixture, NULL, test_write_schedXactions, teardown);
// GNC_TEST_ADD (suitename, "write cb", Fixture, NULL, test_write_cb, teardown);
// GNC_TEST_ADD (suitename, "update progress", Fixture, NULL, test_update_progress, teardown);
// GNC_TEST_ADD (suitename, "finish progress", Fixture, NULL, test_finish_progress, teardown);
// GNC_TEST_ADD (suitename, "gnc sql sync all", Fixture, NULL, test_gnc_sql_sync_all, teardown);
// GNC_TEST_ADD (suitename, "gnc sql begin edit", Fixture, NULL, test_gnc_sql_begin_edit, teardown);
// GNC_TEST_ADD (suitename, "gnc sql rollback edit", Fixture, NULL, test_gnc_sql_rollback_edit, teardown);
// GNC_TEST_ADD (suitename, "commit cb", Fixture, NULL, test_commit_cb, teardown);
// GNC_TEST_ADD (suitename, "gnc sql init", Fixture, nullptr, test_gnc_sql_init, teardown);
// GNC_TEST_ADD (suitename, "create tables cb", Fixture, nullptr, test_create_tables_cb, teardown);
// GNC_TEST_ADD (suitename, "gnc sql set load order", Fixture, nullptr, test_gnc_sql_set_load_order, teardown);
// GNC_TEST_ADD (suitename, "initial load cb", Fixture, nullptr, test_initial_load_cb, teardown);
// GNC_TEST_ADD (suitename, "gnc sql load", Fixture, nullptr, test_gnc_sql_load, teardown);
// GNC_TEST_ADD (suitename, "write account tree", Fixture, nullptr, test_write_account_tree, teardown);
// GNC_TEST_ADD (suitename, "write accounts", Fixture, nullptr, test_write_accounts, teardown);
// GNC_TEST_ADD (suitename, "write tx", Fixture, nullptr, test_write_tx, teardown);
// GNC_TEST_ADD (suitename, "write transactions", Fixture, nullptr, test_write_transactions, teardown);
// GNC_TEST_ADD (suitename, "write template transactions", Fixture, nullptr, test_write_template_transactions, teardown);
// GNC_TEST_ADD (suitename, "write schedXactions", Fixture, nullptr, test_write_schedXactions, teardown);
// GNC_TEST_ADD (suitename, "write cb", Fixture, nullptr, test_write_cb, teardown);
// GNC_TEST_ADD (suitename, "update progress", Fixture, nullptr, test_update_progress, teardown);
// GNC_TEST_ADD (suitename, "finish progress", Fixture, nullptr, test_finish_progress, teardown);
// GNC_TEST_ADD (suitename, "gnc sql sync all", Fixture, nullptr, test_gnc_sql_sync_all, teardown);
// GNC_TEST_ADD (suitename, "gnc sql begin edit", Fixture, nullptr, test_gnc_sql_begin_edit, teardown);
// GNC_TEST_ADD (suitename, "gnc sql rollback edit", Fixture, nullptr, test_gnc_sql_rollback_edit, teardown);
// GNC_TEST_ADD (suitename, "commit cb", Fixture, nullptr, test_commit_cb, teardown);
GNC_TEST_ADD_FUNC (suitename, "gnc sql commit edit", test_gnc_sql_commit_edit);
// GNC_TEST_ADD (suitename, "handle and term", Fixture, NULL, test_handle_and_term, teardown);
// GNC_TEST_ADD (suitename, "compile query cb", Fixture, NULL, test_compile_query_cb, teardown);
// GNC_TEST_ADD (suitename, "gnc sql compile query", Fixture, NULL, test_gnc_sql_compile_query, teardown);
// GNC_TEST_ADD (suitename, "convert search obj", Fixture, NULL, test_convert_search_obj, teardown);
// GNC_TEST_ADD (suitename, "gnc sql compile query to sql", Fixture, NULL, test_gnc_sql_compile_query_to_sql, teardown);
// GNC_TEST_ADD (suitename, "free query cb", Fixture, NULL, test_free_query_cb, teardown);
// GNC_TEST_ADD (suitename, "gnc sql free query", Fixture, NULL, test_gnc_sql_free_query, teardown);
// GNC_TEST_ADD (suitename, "run query cb", Fixture, NULL, test_run_query_cb, teardown);
// GNC_TEST_ADD (suitename, "gnc sql run query", Fixture, NULL, test_gnc_sql_run_query, teardown);
// GNC_TEST_ADD (suitename, "business core sql init", Fixture, NULL, test_business_core_sql_init, teardown);
// GNC_TEST_ADD (suitename, "gnc sql init object handlers", Fixture, NULL, test_gnc_sql_init_object_handlers, teardown);
// GNC_TEST_ADD (suitename, "gnc sql get integer value", Fixture, NULL, test_gnc_sql_get_integer_value, teardown);
// GNC_TEST_ADD (suitename, "get autoinc id", Fixture, NULL, test_get_autoinc_id, teardown);
// GNC_TEST_ADD (suitename, "set autoinc id", Fixture, NULL, test_set_autoinc_id, teardown);
// GNC_TEST_ADD (suitename, "gnc sql get getter", Fixture, NULL, test_gnc_sql_get_getter, teardown);
// GNC_TEST_ADD (suitename, "gnc sql add colname to list", Fixture, NULL, test_gnc_sql_add_colname_to_list, teardown);
// GNC_TEST_ADD (suitename, "gnc sql add subtable colnames to list", Fixture, NULL, test_gnc_sql_add_subtable_colnames_to_list, teardown);
// GNC_TEST_ADD (suitename, "create column info", Fixture, NULL, test_create_column_info, teardown);
// GNC_TEST_ADD (suitename, "load string", Fixture, NULL, test_load_string, teardown);
// GNC_TEST_ADD (suitename, "add string col info to list", Fixture, NULL, test_add_string_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue string to slist", Fixture, NULL, test_add_gvalue_string_to_slist, teardown);
// GNC_TEST_ADD (suitename, "load int", Fixture, NULL, test_load_int, teardown);
// GNC_TEST_ADD (suitename, "add int col info to list", Fixture, NULL, test_add_int_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue int to slist", Fixture, NULL, test_add_gvalue_int_to_slist, teardown);
// GNC_TEST_ADD (suitename, "load boolean", Fixture, NULL, test_load_boolean, teardown);
// GNC_TEST_ADD (suitename, "add boolean col info to list", Fixture, NULL, test_add_boolean_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue boolean to slist", Fixture, NULL, test_add_gvalue_boolean_to_slist, teardown);
// GNC_TEST_ADD (suitename, "load int64", Fixture, NULL, test_load_int64, teardown);
// GNC_TEST_ADD (suitename, "add int64 col info to list", Fixture, NULL, test_add_int64_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue int64 to slist", Fixture, NULL, test_add_gvalue_int64_to_slist, teardown);
// GNC_TEST_ADD (suitename, "load double", Fixture, NULL, test_load_double, teardown);
// GNC_TEST_ADD (suitename, "add double col info to list", Fixture, NULL, test_add_double_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue double to slist", Fixture, NULL, test_add_gvalue_double_to_slist, teardown);
// GNC_TEST_ADD (suitename, "load guid", Fixture, NULL, test_load_guid, teardown);
// GNC_TEST_ADD (suitename, "add guid col info to list", Fixture, NULL, test_add_guid_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue guid to slist", Fixture, NULL, test_add_gvalue_guid_to_slist, teardown);
// GNC_TEST_ADD (suitename, "gnc sql add gvalue objectref guid to slist", Fixture, NULL, test_gnc_sql_add_gvalue_objectref_guid_to_slist, teardown);
// GNC_TEST_ADD (suitename, "gnc sql add objectref guid col info to list", Fixture, NULL, test_gnc_sql_add_objectref_guid_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "handle and term", Fixture, nullptr, test_handle_and_term, teardown);
// GNC_TEST_ADD (suitename, "compile query cb", Fixture, nullptr, test_compile_query_cb, teardown);
// GNC_TEST_ADD (suitename, "gnc sql compile query", Fixture, nullptr, test_gnc_sql_compile_query, teardown);
// GNC_TEST_ADD (suitename, "convert search obj", Fixture, nullptr, test_convert_search_obj, teardown);
// GNC_TEST_ADD (suitename, "gnc sql compile query to sql", Fixture, nullptr, test_gnc_sql_compile_query_to_sql, teardown);
// GNC_TEST_ADD (suitename, "free query cb", Fixture, nullptr, test_free_query_cb, teardown);
// GNC_TEST_ADD (suitename, "gnc sql free query", Fixture, nullptr, test_gnc_sql_free_query, teardown);
// GNC_TEST_ADD (suitename, "run query cb", Fixture, nullptr, test_run_query_cb, teardown);
// GNC_TEST_ADD (suitename, "gnc sql run query", Fixture, nullptr, test_gnc_sql_run_query, teardown);
// GNC_TEST_ADD (suitename, "business core sql init", Fixture, nullptr, test_business_core_sql_init, teardown);
// GNC_TEST_ADD (suitename, "gnc sql init object handlers", Fixture, nullptr, test_gnc_sql_init_object_handlers, teardown);
// GNC_TEST_ADD (suitename, "gnc sql get integer value", Fixture, nullptr, test_gnc_sql_get_integer_value, teardown);
// GNC_TEST_ADD (suitename, "get autoinc id", Fixture, nullptr, test_get_autoinc_id, teardown);
// GNC_TEST_ADD (suitename, "set autoinc id", Fixture, nullptr, test_set_autoinc_id, teardown);
// GNC_TEST_ADD (suitename, "gnc sql get getter", Fixture, nullptr, test_gnc_sql_get_getter, teardown);
// GNC_TEST_ADD (suitename, "gnc sql add colname to list", Fixture, nullptr, test_gnc_sql_add_colname_to_list, teardown);
// GNC_TEST_ADD (suitename, "gnc sql add subtable colnames to list", Fixture, nullptr, test_gnc_sql_add_subtable_colnames_to_list, teardown);
// GNC_TEST_ADD (suitename, "create column info", Fixture, nullptr, test_create_column_info, teardown);
// GNC_TEST_ADD (suitename, "load string", Fixture, nullptr, test_load_string, teardown);
// GNC_TEST_ADD (suitename, "add string col info to list", Fixture, nullptr, test_add_string_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue string to slist", Fixture, nullptr, test_add_gvalue_string_to_slist, teardown);
// GNC_TEST_ADD (suitename, "load int", Fixture, nullptr, test_load_int, teardown);
// GNC_TEST_ADD (suitename, "add int col info to list", Fixture, nullptr, test_add_int_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue int to slist", Fixture, nullptr, test_add_gvalue_int_to_slist, teardown);
// GNC_TEST_ADD (suitename, "load boolean", Fixture, nullptr, test_load_boolean, teardown);
// GNC_TEST_ADD (suitename, "add boolean col info to list", Fixture, nullptr, test_add_boolean_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue boolean to slist", Fixture, nullptr, test_add_gvalue_boolean_to_slist, teardown);
// GNC_TEST_ADD (suitename, "load int64", Fixture, nullptr, test_load_int64, teardown);
// GNC_TEST_ADD (suitename, "add int64 col info to list", Fixture, nullptr, test_add_int64_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue int64 to slist", Fixture, nullptr, test_add_gvalue_int64_to_slist, teardown);
// GNC_TEST_ADD (suitename, "load double", Fixture, nullptr, test_load_double, teardown);
// GNC_TEST_ADD (suitename, "add double col info to list", Fixture, nullptr, test_add_double_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue double to slist", Fixture, nullptr, test_add_gvalue_double_to_slist, teardown);
// GNC_TEST_ADD (suitename, "load guid", Fixture, nullptr, test_load_guid, teardown);
// GNC_TEST_ADD (suitename, "add guid col info to list", Fixture, nullptr, test_add_guid_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue guid to slist", Fixture, nullptr, test_add_gvalue_guid_to_slist, teardown);
// GNC_TEST_ADD (suitename, "gnc sql add gvalue objectref guid to slist", Fixture, nullptr, test_gnc_sql_add_gvalue_objectref_guid_to_slist, teardown);
// GNC_TEST_ADD (suitename, "gnc sql add objectref guid col info to list", Fixture, nullptr, test_gnc_sql_add_objectref_guid_col_info_to_list, teardown);
GNC_TEST_ADD_FUNC (suitename, "gnc sql convert timespec to string", test_gnc_sql_convert_timespec_to_string);
// GNC_TEST_ADD (suitename, "load timespec", Fixture, NULL, test_load_timespec, teardown);
// GNC_TEST_ADD (suitename, "add timespec col info to list", Fixture, NULL, test_add_timespec_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue timespec to slist", Fixture, NULL, test_add_gvalue_timespec_to_slist, teardown);
// GNC_TEST_ADD (suitename, "load date", Fixture, NULL, test_load_date, teardown);
// GNC_TEST_ADD (suitename, "add date col info to list", Fixture, NULL, test_add_date_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue date to slist", Fixture, NULL, test_add_gvalue_date_to_slist, teardown);
// GNC_TEST_ADD (suitename, "load numeric", Fixture, NULL, test_load_numeric, teardown);
// GNC_TEST_ADD (suitename, "add numeric col info to list", Fixture, NULL, test_add_numeric_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add numeric colname to list", Fixture, NULL, test_add_numeric_colname_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue numeric to slist", Fixture, NULL, test_add_gvalue_numeric_to_slist, teardown);
// GNC_TEST_ADD (suitename, "get handler", Fixture, NULL, test_get_handler, teardown);
// GNC_TEST_ADD (suitename, "register standard col type handlers", Fixture, NULL, test_register_standard_col_type_handlers, teardown);
// GNC_TEST_ADD (suitename, " retrieve guid ", Fixture, NULL, test__retrieve_guid_, teardown);
// GNC_TEST_ADD (suitename, "gnc sql load guid", Fixture, NULL, test_gnc_sql_load_guid, teardown);
// GNC_TEST_ADD (suitename, "gnc sql load tx guid", Fixture, NULL, test_gnc_sql_load_tx_guid, teardown);
// GNC_TEST_ADD (suitename, "gnc sql load object", Fixture, NULL, test_gnc_sql_load_object, teardown);
// GNC_TEST_ADD (suitename, "gnc sql create select statement", Fixture, NULL, test_gnc_sql_create_select_statement, teardown);
// GNC_TEST_ADD (suitename, "create single col select statement", Fixture, NULL, test_create_single_col_select_statement, teardown);
// GNC_TEST_ADD (suitename, "gnc sql execute select statement", Fixture, NULL, test_gnc_sql_execute_select_statement, teardown);
// GNC_TEST_ADD (suitename, "gnc sql create statement from sql", Fixture, NULL, test_gnc_sql_create_statement_from_sql, teardown);
// GNC_TEST_ADD (suitename, "gnc sql execute select sql", Fixture, NULL, test_gnc_sql_execute_select_sql, teardown);
// GNC_TEST_ADD (suitename, "gnc sql execute nonselect sql", Fixture, NULL, test_gnc_sql_execute_nonselect_sql, teardown);
// GNC_TEST_ADD (suitename, "execute statement get count", Fixture, NULL, test_execute_statement_get_count, teardown);
// GNC_TEST_ADD (suitename, "gnc sql append guid list to sql", Fixture, NULL, test_gnc_sql_append_guid_list_to_sql, teardown);
// GNC_TEST_ADD (suitename, "gnc sql object is it in db", Fixture, NULL, test_gnc_sql_object_is_it_in_db, teardown);
// GNC_TEST_ADD (suitename, "gnc sql do db operation", Fixture, NULL, test_gnc_sql_do_db_operation, teardown);
// GNC_TEST_ADD (suitename, "create gslist from values", Fixture, NULL, test_create_gslist_from_values, teardown);
// GNC_TEST_ADD (suitename, "gnc sql get sql value", Fixture, NULL, test_gnc_sql_get_sql_value, teardown);
// GNC_TEST_ADD (suitename, "free gvalue list", Fixture, NULL, test_free_gvalue_list, teardown);
// GNC_TEST_ADD (suitename, "build insert statement", Fixture, NULL, test_build_insert_statement, teardown);
// GNC_TEST_ADD (suitename, "build update statement", Fixture, NULL, test_build_update_statement, teardown);
// GNC_TEST_ADD (suitename, "build delete statement", Fixture, NULL, test_build_delete_statement, teardown);
// GNC_TEST_ADD (suitename, "gnc sql commit standard item", Fixture, NULL, test_gnc_sql_commit_standard_item, teardown);
// GNC_TEST_ADD (suitename, "do create table", Fixture, NULL, test_do_create_table, teardown);
// GNC_TEST_ADD (suitename, "gnc sql create table", Fixture, NULL, test_gnc_sql_create_table, teardown);
// GNC_TEST_ADD (suitename, "gnc sql create temp table", Fixture, NULL, test_gnc_sql_create_temp_table, teardown);
// GNC_TEST_ADD (suitename, "gnc sql create index", Fixture, NULL, test_gnc_sql_create_index, teardown);
// GNC_TEST_ADD (suitename, "gnc sql get table version", Fixture, NULL, test_gnc_sql_get_table_version, teardown);
// GNC_TEST_ADD (suitename, "gnc sql upgrade table", Fixture, NULL, test_gnc_sql_upgrade_table, teardown);
// GNC_TEST_ADD (suitename, "gnc sql add columns to table", Fixture, NULL, test_gnc_sql_add_columns_to_table, teardown);
// GNC_TEST_ADD (suitename, "gnc sql init version info", Fixture, NULL, test_gnc_sql_init_version_info, teardown);
// GNC_TEST_ADD (suitename, "reset version info", Fixture, NULL, test_reset_version_info, teardown);
// GNC_TEST_ADD (suitename, "gnc sql finalize version info", Fixture, NULL, test_gnc_sql_finalize_version_info, teardown);
// GNC_TEST_ADD (suitename, "gnc sql set table version", Fixture, NULL, test_gnc_sql_set_table_version, teardown);
// GNC_TEST_ADD (suitename, "load timespec", Fixture, nullptr, test_load_timespec, teardown);
// GNC_TEST_ADD (suitename, "add timespec col info to list", Fixture, nullptr, test_add_timespec_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue timespec to slist", Fixture, nullptr, test_add_gvalue_timespec_to_slist, teardown);
// GNC_TEST_ADD (suitename, "load date", Fixture, nullptr, test_load_date, teardown);
// GNC_TEST_ADD (suitename, "add date col info to list", Fixture, nullptr, test_add_date_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue date to slist", Fixture, nullptr, test_add_gvalue_date_to_slist, teardown);
// GNC_TEST_ADD (suitename, "load numeric", Fixture, nullptr, test_load_numeric, teardown);
// GNC_TEST_ADD (suitename, "add numeric col info to list", Fixture, nullptr, test_add_numeric_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add numeric colname to list", Fixture, nullptr, test_add_numeric_colname_to_list, teardown);
// GNC_TEST_ADD (suitename, "add gvalue numeric to slist", Fixture, nullptr, test_add_gvalue_numeric_to_slist, teardown);
// GNC_TEST_ADD (suitename, "get handler", Fixture, nullptr, test_get_handler, teardown);
// GNC_TEST_ADD (suitename, "register standard col type handlers", Fixture, nullptr, test_register_standard_col_type_handlers, teardown);
// GNC_TEST_ADD (suitename, " retrieve guid ", Fixture, nullptr, test__retrieve_guid_, teardown);
// GNC_TEST_ADD (suitename, "gnc sql load guid", Fixture, nullptr, test_gnc_sql_load_guid, teardown);
// GNC_TEST_ADD (suitename, "gnc sql load tx guid", Fixture, nullptr, test_gnc_sql_load_tx_guid, teardown);
// GNC_TEST_ADD (suitename, "gnc sql load object", Fixture, nullptr, test_gnc_sql_load_object, teardown);
// GNC_TEST_ADD (suitename, "gnc sql create select statement", Fixture, nullptr, test_gnc_sql_create_select_statement, teardown);
// GNC_TEST_ADD (suitename, "create single col select statement", Fixture, nullptr, test_create_single_col_select_statement, teardown);
// GNC_TEST_ADD (suitename, "gnc sql execute select statement", Fixture, nullptr, test_gnc_sql_execute_select_statement, teardown);
// GNC_TEST_ADD (suitename, "gnc sql create statement from sql", Fixture, nullptr, test_gnc_sql_create_statement_from_sql, teardown);
// GNC_TEST_ADD (suitename, "gnc sql execute select sql", Fixture, nullptr, test_gnc_sql_execute_select_sql, teardown);
// GNC_TEST_ADD (suitename, "gnc sql execute nonselect sql", Fixture, nullptr, test_gnc_sql_execute_nonselect_sql, teardown);
// GNC_TEST_ADD (suitename, "execute statement get count", Fixture, nullptr, test_execute_statement_get_count, teardown);
// GNC_TEST_ADD (suitename, "gnc sql append guid list to sql", Fixture, nullptr, test_gnc_sql_append_guid_list_to_sql, teardown);
// GNC_TEST_ADD (suitename, "gnc sql object is it in db", Fixture, nullptr, test_gnc_sql_object_is_it_in_db, teardown);
// GNC_TEST_ADD (suitename, "gnc sql do db operation", Fixture, nullptr, test_gnc_sql_do_db_operation, teardown);
// GNC_TEST_ADD (suitename, "create gslist from values", Fixture, nullptr, test_create_gslist_from_values, teardown);
// GNC_TEST_ADD (suitename, "gnc sql get sql value", Fixture, nullptr, test_gnc_sql_get_sql_value, teardown);
// GNC_TEST_ADD (suitename, "free gvalue list", Fixture, nullptr, test_free_gvalue_list, teardown);
// GNC_TEST_ADD (suitename, "build insert statement", Fixture, nullptr, test_build_insert_statement, teardown);
// GNC_TEST_ADD (suitename, "build update statement", Fixture, nullptr, test_build_update_statement, teardown);
// GNC_TEST_ADD (suitename, "build delete statement", Fixture, nullptr, test_build_delete_statement, teardown);
// GNC_TEST_ADD (suitename, "gnc sql commit standard item", Fixture, nullptr, test_gnc_sql_commit_standard_item, teardown);
// GNC_TEST_ADD (suitename, "do create table", Fixture, nullptr, test_do_create_table, teardown);
// GNC_TEST_ADD (suitename, "gnc sql create table", Fixture, nullptr, test_gnc_sql_create_table, teardown);
// GNC_TEST_ADD (suitename, "gnc sql create temp table", Fixture, nullptr, test_gnc_sql_create_temp_table, teardown);
// GNC_TEST_ADD (suitename, "gnc sql create index", Fixture, nullptr, test_gnc_sql_create_index, teardown);
// GNC_TEST_ADD (suitename, "gnc sql get table version", Fixture, nullptr, test_gnc_sql_get_table_version, teardown);
// GNC_TEST_ADD (suitename, "gnc sql upgrade table", Fixture, nullptr, test_gnc_sql_upgrade_table, teardown);
// GNC_TEST_ADD (suitename, "gnc sql add columns to table", Fixture, nullptr, test_gnc_sql_add_columns_to_table, teardown);
// GNC_TEST_ADD (suitename, "gnc sql init version info", Fixture, nullptr, test_gnc_sql_init_version_info, teardown);
// GNC_TEST_ADD (suitename, "reset version info", Fixture, nullptr, test_reset_version_info, teardown);
// GNC_TEST_ADD (suitename, "gnc sql finalize version info", Fixture, nullptr, test_gnc_sql_finalize_version_info, teardown);
// GNC_TEST_ADD (suitename, "gnc sql set table version", Fixture, nullptr, test_gnc_sql_set_table_version, teardown);
}