[Gnucash-changes] Test fixes

Neil Williams codehelp at cvs.gnucash.org
Thu Oct 13 08:38:06 EDT 2005


Log Message:
-----------
Test fixes

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash/src/backend/file/test:
        test-dom-converters1.c
        test-string-converters.c
        test-xml-account.c
        test-xml-pricedb.c
        test-xml-transaction.c
    gnucash/src/bin/test:
        test-version
    gnucash/src/engine/test-core:
        test-engine-stuff.c
        test-engine-stuff.h
    gnucash/src/engine/test:
        test-split-vs-account.c

Added Files:
-----------
    gnucash/src/backend/file/test:
        test-load-backend.c
    gnucash/src/backend/postgres/test:
        test-load-backend.c

Revision Data
-------------
Index: test-xml-pricedb.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/file/test/test-xml-pricedb.c,v
retrieving revision 1.6.4.2
retrieving revision 1.6.4.3
diff -Lsrc/backend/file/test/test-xml-pricedb.c -Lsrc/backend/file/test/test-xml-pricedb.c -u -r1.6.4.2 -r1.6.4.3
--- src/backend/file/test/test-xml-pricedb.c
+++ src/backend/file/test/test-xml-pricedb.c
@@ -1,15 +1,36 @@
+/***************************************************************************
+ *            test-xml-pricedb.c
+ *
+ *  Fri Oct  7 21:24:15 2005
+ *  Copyright  2005  Neil Williams
+ *  linux at codehelp.co.uk
+ ****************************************************************************/
+/*
+ *  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, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+ 
 #include "config.h"
 
 #include <glib.h>
-#include <libguile.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 
-#include "gnc-module.h"
 #include "gnc-xml-helper.h"
 #include "gnc-xml.h"
-#include "gnc-engine-util.h"
+#include "cashobjects.h"
 #include "gnc-engine.h"
 #include "gnc-pricedb.h"
 
@@ -20,8 +41,6 @@
 #include "test-engine-stuff.h"
 #include "test-file-stuff.h"
 
-#include "qofbook.h"
-
 static QofSession *session;
 
 struct pricedb_data_struct
@@ -109,7 +128,8 @@
   for (i = 0; i < 20; i++)
   {
     GNCPriceDB *db;
-
+    g_message("i=%d", i);
+    session = qof_session_new();
     db = get_random_pricedb (qof_session_get_book (session));
     if (!db) {
       failure_args ("gnc_random_price_db returned NULL",
@@ -120,26 +140,21 @@
       test_db (i, db);
 
     gnc_pricedb_destroy (db);
+    qof_session_end(session);
   }
 }
 
-static void
-guile_main (void *closure, int argc, char **argv)
+int
+main (int argc, char ** argv)
 {
-  gnc_module_system_init();
-  gnc_module_load("gnucash/engine", 0);
-
+   qof_init();
+   cashobjects_register();
+   qof_log_init_filename("/tmp/gnctest.trace");
+   qof_log_set_default(GNC_LOG_DETAIL);
+   gnc_set_log_level(GNC_MOD_PRICE, GNC_LOG_DETAIL);
   session = qof_session_new ();
-
   test_generation ();
-
   print_test_results ();
-  exit (get_rv ());
-}
-
-int
-main (int argc, char ** argv)
-{
-  scm_boot_guile (argc, argv, guile_main, NULL);
+   qof_close();
   return 0;
 }
Index: test-xml-account.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/file/test/test-xml-account.c,v
retrieving revision 1.10.4.3
retrieving revision 1.10.4.4
diff -Lsrc/backend/file/test/test-xml-account.c -Lsrc/backend/file/test/test-xml-account.c -u -r1.10.4.3 -r1.10.4.4
--- src/backend/file/test/test-xml-account.c
+++ src/backend/file/test/test-xml-account.c
@@ -1,17 +1,37 @@
+/***************************************************************************
+ *            test-xml-account.c
+ *
+ *  Sun Oct  9 15:37:26 2005
+ *  Copyright  2005  Neil Williams
+ *  linux at codehelp.co.uk
+ ****************************************************************************/
+/*
+ *  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, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+ 
 #include "config.h"
 
 #include <glib.h>
-#include <libguile.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 
-#include "gnc-module.h"
 #include "gnc-xml-helper.h"
 #include "gnc-xml.h"
-#include "gnc-engine-util.h"
 #include "gnc-engine.h"
-
+#include "cashobjects.h"
 #include "sixtp-parsers.h"
 #include "sixtp-dom-parsers.h"
 
@@ -22,9 +42,8 @@
 #include "Account.h"
 #include "Group.h"
 #include "Scrub.h"
-#include "gnc-book.h"
 
-static GNCBook *book;
+static QofBook *sixbook;
 
 static gchar*
 node_and_account_equal(xmlNodePtr node, Account *act)
@@ -32,7 +51,9 @@
     xmlNodePtr mark;
 
     while (safe_strcmp ((char*)node->name, "text") == 0)
+	{
       node = node->next;
+	}
 
     if(!check_dom_tree_version(node, "2.0.0"))
     {
@@ -173,16 +194,15 @@
 
     com = xaccAccountGetCommodity (account);
 
-    t = gnc_book_get_commodity_table (book);
+    t = gnc_book_get_commodity_table (sixbook);
 
     new_com = gnc_commodity_table_lookup (t,
                                           gnc_commodity_get_namespace (com),
                                           gnc_commodity_get_mnemonic (com));
 
-    if (new_com)
-      xaccAccountSetCommodity (account, new_com);
+    if (new_com) { xaccAccountSetCommodity (account, new_com); }
 
-    do_test_args(xaccAccountEqual((Account*)data, (Account*)(gdata->act),
+    do_test_args(xaccAccountEqual((Account*)account, (Account*)(gdata->act),
                                   TRUE),
                         "gnc_account_sixtp_parser_create", 
                  __FILE__, __LINE__, "%d", gdata->value );
@@ -240,7 +260,7 @@
         parser = gnc_account_sixtp_parser_create();
             
         if(!gnc_xml_parse_file(parser, filename1, test_add_account,
-                               &data, book))
+                               &data, sixbook))
         {
             failure_args("gnc_xml_parse_file returned FALSE",
                          __FILE__, __LINE__, "%d", i);
@@ -257,7 +277,7 @@
 }
 
 static void
-test_generation(void)
+test_generation()
 {
     int i;
 
@@ -265,7 +285,7 @@
     {
         Account *ran_act;
 
-        ran_act = get_random_account(book);
+        ran_act = get_random_account(sixbook);
 
         test_account(i, ran_act);
 
@@ -276,7 +296,7 @@
         /* empty some things. */
         Account *act;
 
-        act = get_random_account(book);
+        act = get_random_account(sixbook);
 
         xaccAccountSetCode(act, "");
         xaccAccountSetDescription(act, "");
@@ -313,7 +333,7 @@
 
     if(!xaccAccountGetParent(act))
     {
-        xaccGroupInsertAccount(xaccGetAccountGroup(book), act);
+        xaccGroupInsertAccount(xaccGetAccountGroup(sixbook), act);
     }
 
     msg = node_and_account_equal((xmlNodePtr)global_data, act);
@@ -324,19 +344,20 @@
     return TRUE;
 }
 
-static void
-guile_main (void *closure, int argc, char **argv)
+int
+main (int argc, char ** argv)
 {
-    gnc_module_system_init();
-    gnc_module_load("gnucash/engine", 0);
-
-    book = gnc_book_new ();
+    QofSession *session;
 
+    qof_init();
+    cashobjects_register();
+    session = qof_session_new();
+    sixbook = qof_session_get_book (session);
     if(argc > 1)
     {
         test_files_in_dir(argc, argv, test_real_account, 
                           gnc_account_sixtp_parser_create(),
-                          "gnc:account", book);
+                          "gnc:account", sixbook);
     }
     else
     {
@@ -344,12 +365,6 @@
     }
         
     print_test_results();
-    exit(get_rv());
-}
-
-int
-main (int argc, char ** argv)
-{
-  scm_boot_guile (argc, argv, guile_main, NULL);
+    qof_close();
   return 0;
 }
Index: test-dom-converters1.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/file/test/test-dom-converters1.c,v
retrieving revision 1.4.4.6
retrieving revision 1.4.4.7
diff -Lsrc/backend/file/test/test-dom-converters1.c -Lsrc/backend/file/test/test-dom-converters1.c -u -r1.4.4.6 -r1.4.4.7
--- src/backend/file/test/test-dom-converters1.c
+++ src/backend/file/test/test-dom-converters1.c
@@ -1,3 +1,26 @@
+/***************************************************************************
+ *            test-dom-converters1.c
+ *
+ *  Fri Oct  7 20:51:06 2005
+ *  Copyright  2005  Neil Williams
+ *  linux at codehelp.co.uk
+ ****************************************************************************/
+/*
+ *  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, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+ 
 #include "config.h"
 
 #include <stdlib.h>
@@ -8,7 +31,7 @@
 #include "test-stuff.h"
 #include "test-engine-stuff.h"
 #include "test-file-stuff.h"
-
+#include "cashobjects.h"
 #include "gnc-xml-helper.h"
 #include "gnc-engine.h"
 #include "sixtp.h"
@@ -41,7 +64,7 @@
         test_com1 = gnc_commodity_new(book, NULL, test_str1, test_str2, NULL, 0);
         test_node = commodity_ref_to_dom_tree("test-com", test_com1);
 
-        test_com2 = dom_tree_to_commodity_ref_no_engine(test_node, NULL);
+        test_com2 = dom_tree_to_commodity_ref_no_engine(test_node, book);
 
         do_test(gnc_commodity_equiv(test_com1, test_com2),
                             "dom_tree_to_commodity_ref_no_engine");
@@ -245,6 +268,8 @@
 int
 main(int argc, char **argv)
 {
+     qof_init();
+     cashobjects_register();
     test_dom_tree_to_guid();
     fflush(stdout);
     test_dom_tree_to_commodity_ref();
@@ -256,5 +281,6 @@
     test_dom_tree_to_gnc_numeric();
     fflush(stdout);
     print_test_results();
+     qof_close();
     exit(get_rv());
 }
Index: test-xml-transaction.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/file/test/test-xml-transaction.c,v
retrieving revision 1.17.4.6
retrieving revision 1.17.4.7
diff -Lsrc/backend/file/test/test-xml-transaction.c -Lsrc/backend/file/test/test-xml-transaction.c -u -r1.17.4.6 -r1.17.4.7
--- src/backend/file/test/test-xml-transaction.c
+++ src/backend/file/test/test-xml-transaction.c
@@ -1,7 +1,29 @@
+/***************************************************************************
+ *            test-xml-transaction.c
+ *
+ *  Fri Oct  7 21:26:59 2005
+ *  Copyright  2005  Neil Williams
+ *  linux at codehelp.co.uk
+ ****************************************************************************/
+/*
+ *  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, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+ 
 #include "config.h"
 
 #include <glib.h>
-#include <libguile.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -10,12 +32,10 @@
 #include <dirent.h>
 #include <sys/stat.h>
 
-#include "gnc-module.h"
 #include "gnc-xml-helper.h"
 #include "gnc-xml.h"
-#include "gnc-engine-util.h"
 #include "gnc-engine.h"
-
+#include "cashobjects.h"
 #include "sixtp-parsers.h"
 
 #include "sixtp-dom-parsers.h"
@@ -344,12 +364,14 @@
     for(i = 0; i < 50; i++)
     {
         Transaction *ran_trn;
+        AccountGroup *grp;
         xmlNodePtr test_node;
         gnc_commodity *com;
         gchar *compare_msg;
         gchar *filename1;
         int fd;
 
+        grp = get_random_group(book);
         ran_trn = get_random_transaction(book);
         if(!ran_trn)
         {
@@ -470,12 +492,11 @@
     return TRUE;
 }
 
-static void
-guile_main (void *closure, int argc, char **argv)
+int
+main (int argc, char ** argv)
 {
-    gnc_module_system_init();
-    gnc_module_load("gnucash/engine", 0);
-
+    qof_init();
+    cashobjects_register();
     xaccLogDisable();
 
     gnc_transaction_xml_v2_testing = TRUE;
@@ -494,12 +515,6 @@
     }
 
     print_test_results();
-    exit(get_rv());
-}
-
-int
-main (int argc, char ** argv)
-{
-  scm_boot_guile (argc, argv, guile_main, NULL);
+    qof_close();
   return 0;
 }
--- /dev/null
+++ src/backend/file/test/test-load-backend.c
@@ -0,0 +1,44 @@
+/***************************************************************************
+ *            test-load-backend.c
+ *
+ *  Replaces the guile version to test the GModule file backend loading.
+ *
+ *  Sun Oct  9 18:58:47 2005
+ *  Copyright  2005  Neil Williams
+ *  linux at codehelp.co.uk
+ ****************************************************************************/
+
+/*
+ *  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, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+ 
+#include "qof.h"
+#include "cashobjects.h"
+#include "test-stuff.h"
+
+#define GNC_LIB_NAME "libgnc-backend-file.la"
+#define GNC_LIB_INIT "gnc_provider_init"
+
+int main (int argc, char ** argv)
+{
+	qof_init();
+	cashobjects_register();
+	do_test(
+		qof_load_backend_library ("../", GNC_LIB_NAME, GNC_LIB_INIT),
+		" loading gnc-backend-file GModule failed");
+    print_test_results();
+	qof_close();
+	return 0;
+}
Index: test-string-converters.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/file/test/test-string-converters.c,v
retrieving revision 1.2.6.4
retrieving revision 1.2.6.5
diff -Lsrc/backend/file/test/test-string-converters.c -Lsrc/backend/file/test/test-string-converters.c -u -r1.2.6.4 -r1.2.6.5
--- src/backend/file/test/test-string-converters.c
+++ src/backend/file/test/test-string-converters.c
@@ -5,16 +5,12 @@
 #include "sixtp-dom-parsers.h"
 #include "sixtp-dom-generators.h"
 
-#include "gnc-engine-util.h"
+#include "gnc-engine.h"
 
 #include "test-stuff.h"
 #include "test-engine-stuff.h"
 #include "test-file-stuff.h"
 
-#include "gnc-date.h"
-#include "gnc-numeric.h"
-#include "guid.h"
-
 static void
 test_binary()
 {
Index: test-version
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/bin/test/test-version,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -Lsrc/bin/test/test-version -Lsrc/bin/test/test-version -u -r1.1 -r1.1.4.1
--- src/bin/test/test-version
+++ src/bin/test/test-version
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-exec gnucash --version
+exec ../gnucash --version
Index: test-engine-stuff.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/test-core/test-engine-stuff.c,v
retrieving revision 1.52.4.14
retrieving revision 1.52.4.15
diff -Lsrc/engine/test-core/test-engine-stuff.c -Lsrc/engine/test-core/test-engine-stuff.c -u -r1.52.4.14 -r1.52.4.15
--- src/engine/test-core/test-engine-stuff.c
+++ src/engine/test-core/test-engine-stuff.c
@@ -31,12 +31,9 @@
 #include "AccountP.h"
 #include "Group.h"
 #include "GroupP.h"
-#include "gnc-date.h"
 #include "gnc-engine.h"
-#include "gnc-engine-util.h"
 #include "Transaction.h"
 #include "TransactionP.h"
-#include "qofquerycore.h"
 
 #include "test-engine-stuff.h"
 #include "test-stuff.h"
@@ -689,17 +686,18 @@
   return p;
 }
 
-void
+gboolean
 make_random_pricedb (QofBook *book, GNCPriceDB *db)
 {
   int num_prices;
+   gboolean check;
 
   num_prices = get_random_int_in_range (1, 41);
   if(num_prices < 1) /* should be impossible */
   {
       failure_args("engine-stuff", __FILE__, __LINE__,
                    "get_random_int_in_range failed");
-      return;
+        return FALSE;
   }
 
   while (num_prices-- > 0)
@@ -711,13 +709,15 @@
     {
         failure_args("engine-stuff", __FILE__, __LINE__,
                      "get_random_price failed");
-        return;
+                return FALSE;
     }
 
-    gnc_pricedb_add_price (db, p);
+        check = gnc_pricedb_add_price (db, p);
+        if(!check) { return check; }
 
     gnc_price_unref (p);
   }
+	return TRUE;
 }
 
 GNCPriceDB *
@@ -725,7 +725,6 @@
 {
   GNCPriceDB *db;
 
-  //db = gnc_pricedb_create (book);
   db = gnc_pricedb_get_db (book);
   if(!db)
   {
@@ -733,7 +732,7 @@
                    "gnc_pricedb_get_db failed");
       return NULL;
   }
-  make_random_pricedb (book, db);
+  if(!make_random_pricedb (book, db)) { return NULL; }
 
   return db;
 }
@@ -916,8 +915,7 @@
     if (!do_bork()) num = gnc_numeric_convert (num, scu, GNC_HOW_RND_ROUND);
 
     acc = get_random_list_element (account_list);
-    s = get_random_split(book, acc);
-    xaccTransAppendSplit(trn, s);
+    s = get_random_split(book, acc, trn);
     xaccSplitSetValue(s, num);
 
     /* If the currencies are the same, the split amount should equal
@@ -944,8 +942,7 @@
       }
     }
 
-    s = get_random_split(book, bcc);
-    xaccTransAppendSplit(trn, s);
+    s = get_random_split(book, bcc, trn);
 
     /* Other split should have equal and opposite value */
     if (do_bork()) 
@@ -1267,7 +1264,7 @@
 static char possible_chars[] = { NREC, CREC, YREC, FREC };
 
 Split*
-get_random_split(QofBook *book, Account *acct)
+get_random_split(QofBook *book, Account *acct, Transaction *trn)
 {
     Split *ret;
     gnc_numeric num;
@@ -1282,6 +1279,8 @@
     xaccSplitSetDateReconciledTS(ret, get_random_timespec());
 
     /* Split must be in an account before we can set an amount */
+    /* and in a transaction before it can be added to an account. */
+    xaccTransAppendSplit(trn, ret);
     xaccAccountInsertSplit (acct, ret);
     num = get_random_gnc_numeric ();
     xaccSplitSetAmount(ret, num);
@@ -1326,10 +1325,13 @@
                        void(*func)(Transaction *act, const gchar*str))
 {
     gchar *tmp_str = get_random_string();
+    if(!trn || !(&trn->inst)) { return; }
     if(tmp_str)
     {
+        xaccTransBeginEdit(trn);
         (func)(trn, tmp_str);
         g_free(tmp_str);
+        xaccTransCommitEdit(trn);
     }
 }
 
Index: test-engine-stuff.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/test-core/test-engine-stuff.h,v
retrieving revision 1.22.4.2
retrieving revision 1.22.4.3
diff -Lsrc/engine/test-core/test-engine-stuff.h -Lsrc/engine/test-core/test-engine-stuff.h -u -r1.22.4.2 -r1.22.4.3
--- src/engine/test-core/test-engine-stuff.h
+++ src/engine/test-core/test-engine-stuff.h
@@ -43,11 +43,11 @@
 void set_max_group_accounts (gint max_group_accounts);
 
 GNCPrice * get_random_price(QofBook *book);
-void make_random_pricedb (QofBook *book, GNCPriceDB *pdb);
+gboolean make_random_pricedb (QofBook *book, GNCPriceDB *pdb);
 GNCPriceDB * get_random_pricedb(QofBook *book);
 AccountGroup * get_random_group(QofBook * book);
 Account* get_random_account(QofBook * book);
-Split* get_random_split(QofBook *book, Account *account);
+Split* get_random_split(QofBook *book, Account *account, Transaction *trn);
 Transaction* get_random_transaction(QofBook *book);
 Transaction* get_random_transaction_with_currency(QofBook *book,
                                                   gnc_commodity *currency,
--- /dev/null
+++ src/backend/postgres/test/test-load-backend.c
@@ -0,0 +1,44 @@
+/***************************************************************************
+ *            test-load-backend.c
+ *
+ *  Replaces the guile version to test the GModule file backend loading.
+ *
+ *  Sun Oct  9 18:58:47 2005
+ *  Copyright  2005  Neil Williams
+ *  linux at codehelp.co.uk
+ ****************************************************************************/
+
+/*
+ *  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, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+ 
+#include "qof.h"
+#include "cashobjects.h"
+#include "test-stuff.h"
+
+#define PG_LIB_NAME "libgnc-backend-postgres.la"
+#define PG_LIB_INIT "pgend_provider_init"
+
+int main (int argc, char ** argv)
+{
+	qof_init();
+	cashobjects_register();
+	do_test(
+		qof_load_backend_library (QOF_LIB_DIR, PG_LIB_NAME, PG_LIB_INIT),
+		" loading gnc-backend-postgres GModule failed");
+	print_test_results();
+	qof_close();
+	return 0;
+}
Index: test-split-vs-account.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/test/test-split-vs-account.c,v
retrieving revision 1.8.4.3
retrieving revision 1.8.4.4
diff -Lsrc/engine/test/test-split-vs-account.c -Lsrc/engine/test/test-split-vs-account.c -u -r1.8.4.3 -r1.8.4.4
--- src/engine/test/test-split-vs-account.c
+++ src/engine/test/test-split-vs-account.c
@@ -57,7 +57,10 @@
         return;
     }
 	success("act2 created");
-    spl = get_random_split(book, act1);
+	/* if we use a trans here, the scrub routines
+	 will add a pointer to a newly created Orphan-...
+	account. */
+    spl = get_random_split(book, act1, NULL);
     if(!spl)
     {
         failure("spl not created");


More information about the gnucash-changes mailing list