Skip to content

Commit

Permalink
[Bug 666329] Empty database after a little while
Browse files Browse the repository at this point in the history
Create failing test for gnc_sql_commit_edit() showing that it doesn't call book->dirty_cb when the instance gnc_sql_commit_edit() is called on the book itself.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21824 57a11ea4-9604-0410-9ed3-97b8803252fd
  • Loading branch information
jralls committed Jan 7, 2012
1 parent e0e4994 commit e8a9591
Show file tree
Hide file tree
Showing 5 changed files with 1,080 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/backend/sql/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
include $(top_srcdir)/test-templates/Makefile.decl
SUBDIRS = . test
TEST_SUBDIRS = test

# Now a shared library AND a GModule
lib_LTLIBRARIES = libgnc-backend-sql.la
Expand Down
32 changes: 30 additions & 2 deletions src/backend/sql/test/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
SUBDIRS = .

include $(top_srcdir)/test-templates/Makefile.decl
MODULEPATH = src/backend/sql

test_column_types_SOURCES = \
test-column-types.c

Expand All @@ -20,8 +23,7 @@ TESTS_ENVIRONMENT = \
SRCDIR=${srcdir} \
$(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})

check_PROGRAMS = \
test-column-types
check_PROGRAMS = $(TESTS)

#noinst_HEADERS = test-file-stuff.h

Expand Down Expand Up @@ -49,3 +51,29 @@ AM_CFLAGS = \
${GCONF_CFLAGS}

INCLUDES = -DG_LOG_DOMAIN=\"gnc.backend.sql\"

TEST_PROGS += test-sqlbe
test_sqlbedir = ${top_srcdir}/${MODULEPATH}/test

noinst_PROGRAMS = $(TESTS) $(TEST_PROGS)

test_sqlbe_SOURCES = \
test-sqlbe.c \
utest-gnc-backend-sql.c

test_sqlbe_HEADERS = \
$(top_srcdir)/$(MODULEPATH)/gnc-backend-sql.h

test_sqlbe_LDADD = \
$(top_builddir)/$(MODULEPATH)/libgnc-backend-sql.la \
$(top_builddir)/src/libqof/qof/libgnc-qof.la \
$(top_builddir)/src/test-core/libtest-core.la

test_sqlbe_CFLAGS = \
-DTESTPROG=test_sqlbe \
$(DEFAULT_INCLUDES) \
-I$(top_srcdir)/$(MODULEPATH)/ \
-I$(top_srcdir)/src/backend/dbi/ \
-I$(top_srcdir)/src/libqof/qof/ \
-I$(top_srcdir)/src/test-core/ \
$(GLIB_CFLAGS)
42 changes: 42 additions & 0 deletions src/backend/sql/test/test-sqlbe.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/********************************************************************
* testmain.c: GLib g_test test execution file. *
* Copyright 2011 John Ralls <[email protected]> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License*
* along with this program; if not, contact: *
* *
* Free Software Foundation Voice: +1-617-542-5942 *
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
* Boston, MA 02110-1301, USA [email protected] *
\********************************************************************/


#include "config.h"
#include <glib.h>
#include "qof.h"

extern void test_suite_gnc_backend_sql ();

int
main (int argc,
char *argv[])
{
g_type_init(); /* Initialize the GObject system */
g_test_init ( &argc, &argv, NULL ); /* initialize test program */
qof_log_init_filename_special("stderr"); /* Init the log system */
g_test_bug_base("https://bugzilla.gnome.org/show_bug.cgi?id="); /* init the bugzilla URL */

test_suite_gnc_backend_sql ();

return g_test_run( );
}
Loading

0 comments on commit e8a9591

Please sign in to comment.