[Gnucash-changes] Remove guile - cashutil sync.

Neil Williams codehelp at cvs.gnucash.org
Sat Oct 1 13:49:43 EDT 2005


Log Message:
-----------
Remove guile - cashutil sync.

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash/src/engine/test:
        test-group-vs-book.c
        test-guid.c
        test-load-engine.c
        test-object.c
        test-query.c
        test-querynew.c
        test-resolve-file-path.c
        test-split-vs-account.c

Revision Data
-------------
Index: test-querynew.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/test/test-querynew.c,v
retrieving revision 1.2.4.3
retrieving revision 1.2.4.4
diff -Lsrc/engine/test/test-querynew.c -Lsrc/engine/test/test-querynew.c -u -r1.2.4.3 -r1.2.4.4
--- src/engine/test/test-querynew.c
+++ src/engine/test/test-querynew.c
@@ -1,17 +1,32 @@
+/***************************************************************************
+ *            test-querynew.c
+ *
+ *  Tue Sep 27 19:18:57 2005
+ *  Copyright  2005  GnuCash team
+ ****************************************************************************/
+/*
+ *  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 <glib.h>
-#include <libguile.h>
 #include <stdio.h>
-
+#include "qof.h"
 #include "guid.h"
-#include "gnc-module.h"
 #include "gnc-engine-util.h"
 #include "messages.h"
-
-#include "qofclass-p.h"
-#include "qofquery.h"
-#include "qofquerycore.h"
-#include "qofquerycore-p.h"
-
+#include "cashobjects.h"
 #include "test-stuff.h"
 
 #define TEST_MODULE_NAME	"TestModuleName"
@@ -60,10 +75,10 @@
 						     TEST_PARAM),
 			TEST_CORE) == 0, "qof_class_get_parameter_type");
 
-  do_test (qof_class_get_default_sort (TEST_MODULE_NAME) == test_sort,
+/*  do_test (qof_class_get_default_sort (TEST_MODULE_NAME) == test_sort,
 	   "qof_class_get_default_sort");
   do_test (qof_class_get_default_sort (NULL) == NULL,
-	   "qof_class_get_default_sort (NULL)");
+	   "qof_class_get_default_sort (NULL)");*/
 }
 
 static void test_query_core (void)
@@ -75,20 +90,16 @@
 {
 }
 
-static void
-main_helper (void *closure, int argc, char **argv)
+int
+main (int argc, char **argv)
 {
-  gnc_module_load("gnucash/engine", 0);
+	qof_init();
+	if(cashobjects_register()) {
   test_query_core();
   test_class();
   test_querynew();
+	}
+	qof_close();
   print_test_results();
-  exit(get_rv());
-}
-
-int
-main (int argc, char **argv)
-{
-  scm_boot_guile (argc, argv, main_helper, NULL);
   return 0;
 }
Index: test-guid.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/test/test-guid.c,v
retrieving revision 1.2.4.1
retrieving revision 1.2.4.2
diff -Lsrc/engine/test/test-guid.c -Lsrc/engine/test/test-guid.c -u -r1.2.4.1 -r1.2.4.2
--- src/engine/test/test-guid.c
+++ src/engine/test/test-guid.c
@@ -1,22 +1,36 @@
+/***************************************************************************
+ *            test-guid.c
+ *
+ *  October 2003
+ *  Copyright  2003 Linas Vepstas <linas at linas.org
+ ****************************************************************************/
+/*
+ *  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.
+ */
 
 /* Test file created by Linas Vepstas <linas at linas.org>
  * Try to create duplicate GUID's, which should never happen.
  *
- * October 2003
- * License: GPL
  */
 
 #include <ctype.h>
 #include <glib.h>
-
-#include "gnc-module.h"
+#include "cashobjects.h"
 #include "test-stuff.h"
 #include "test-engine-stuff.h"
-#include "qofbook.h"
-#include "qofid.h"
-#include "qofid-p.h"
-#include "qofsession.h"
-#include "guid.h"
+#include "qof.h"
 
 static void test_null_guid(void)
 {
@@ -64,22 +78,15 @@
   qof_session_destroy(sess);
 }
 
-static void
-main_helper (void *closure, int argc, char **argv)
-{
-  g_log_set_always_fatal( G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING );
-  do_test((NULL!=gnc_module_load("gnucash/engine", 0)), "couldn't load engine");
-
-  test_null_guid();
-  run_test();
-
-  print_test_results();
-  exit(get_rv());
-}
-
 int
 main (int argc, char **argv)
 {
-  scm_boot_guile(argc, argv, main_helper, NULL);
+	qof_init();
+	if(cashobjects_register()) {
+		test_null_guid();
+		run_test ();
+		print_test_results();
+	}
+	qof_close();
   return 0;
 }
Index: test-group-vs-book.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/test/test-group-vs-book.c,v
retrieving revision 1.11.4.1
retrieving revision 1.11.4.2
diff -Lsrc/engine/test/test-group-vs-book.c -Lsrc/engine/test/test-group-vs-book.c -u -r1.11.4.1 -r1.11.4.2
--- src/engine/test/test-group-vs-book.c
+++ src/engine/test/test-group-vs-book.c
@@ -1,17 +1,34 @@
+/***************************************************************************
+ *            test-group-vs-book.c
+ *
+ *  Tue Sep 27 19:32:31 2005
+ *  Copyright  2005  Gnucash team
+ ****************************************************************************/
+/*
+ *  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 <glib.h>
-#include <libguile.h>
-
+#include "qof.h"
+#include "cashobjects.h"
 #include "Group.h"
 #include "GroupP.h"
 #include "TransLog.h"
 #include "gnc-engine.h"
-#include "gnc-module.h"
 #include "test-engine-stuff.h"
 #include "test-stuff.h"
-#include "qofbook.h"
-#include "qofbook-p.h"
-
 
 static gboolean
 group_has_book (AccountGroup *group, QofBook *book)
@@ -139,43 +156,22 @@
     failure("remove group didn't take");
     exit(get_rv());
   }
-
-#if 0
-  /* a group cannot have a 'null' book; this test is nonsense. */
-  if (!group_has_book (xaccAccountGetParent (account2), NULL))
-  {
-    failure("remove group didn't clear book");
-    exit(get_rv());
-  }
-#endif
 }
 
-static void
-main_helper (void *closure, int argc, char **argv)
+int
+main (int argc, char **argv)
 {
-  int i;
-
-  gnc_module_system_init();
-
-  if(!gnc_module_load("gnucash/engine", 0))
-  {
-    failure("couldn't load gnucash/engine");
-    exit(get_rv());
-  }
-
+	gint i;
+	qof_init();
+	if(cashobjects_register()) {
   xaccLogDisable ();
-
   for (i = 0; i < 10; i++)
+		{
     run_test ();
-
+		}
   success ("group/book stuff seems to work");
   print_test_results();
-  exit(get_rv());
-}
-
-int
-main (int argc, char **argv)
-{
-  scm_boot_guile (argc, argv, main_helper, NULL);
+	}
+	qof_close();
   return 0;
 }
Index: test-resolve-file-path.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/test/test-resolve-file-path.c,v
retrieving revision 1.3.6.2
retrieving revision 1.3.6.3
diff -Lsrc/engine/test/test-resolve-file-path.c -Lsrc/engine/test/test-resolve-file-path.c -u -r1.3.6.2 -r1.3.6.3
--- src/engine/test/test-resolve-file-path.c
+++ src/engine/test/test-resolve-file-path.c
@@ -1,12 +1,32 @@
+/***************************************************************************
+ *            test-resolve-file-path.c
+ *
+ *  Thu Sep 29 22:48:57 2005
+ *  Copyright  2005  GnuCash team
+ ****************************************************************************/
+/*
+ *  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 <stdlib.h>
 #include <string.h>
 
 #include <glib.h>
-
+#include "qof.h"
 #include "test-stuff.h"
-#include "gnc-engine-util.h"
 #include "gnc-filepath-utils.h"
-#include "qofsession.h"
 
 struct test_strings_struct
 {
@@ -72,4 +92,3 @@
     print_test_results();
     return get_rv();
 }
-
Index: test-load-engine.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/test/test-load-engine.c,v
retrieving revision 1.1.6.1
retrieving revision 1.1.6.2
diff -Lsrc/engine/test/test-load-engine.c -Lsrc/engine/test/test-load-engine.c -u -r1.1.6.1 -r1.1.6.2
--- src/engine/test/test-load-engine.c
+++ src/engine/test/test-load-engine.c
@@ -1,36 +1,45 @@
+/***************************************************************************
+ *            test-load-engine.c
+ *
+ *  Tue Sep 27 19:35:28 2005
+ *  Copyright  2005  GnuCash team
+ ****************************************************************************/
+/*
+ *  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 <stdio.h>
 #include <stdlib.h>
-#include <libguile.h>
-
-#include "gnc-module.h"
+#include "qof.h"
+#include "cashobjects.h"
+#include "test-stuff.h"
 
 static void
-guile_main (void *closure, int argc, char ** argv)
+run_test(void)
 {
-  GNCModule engine;
-
-  printf("  test-load-engine.c: loading/unloading engine module ... ");
-
-  gnc_module_system_init();
-  engine = gnc_module_load("gnucash/engine", 0);
-  
-  if(!engine) {
-    printf("  Failed to load engine\n");
-    exit(-1);
-  }
-  
-  if(!gnc_module_unload(engine)) {
-    printf("  Failed to unload engine\n");
-    exit(-1);
-  }
-  printf(" successful.\n");
-
-  exit(0);
+	do_test(TRUE, "test engine loaded OK");
 }
 
 int
 main (int argc, char ** argv)
 {
-  scm_boot_guile(argc, argv, guile_main, NULL);
+	qof_init();
+	if(cashobjects_register()) {
+		run_test ();
+		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.2
retrieving revision 1.8.4.3
diff -Lsrc/engine/test/test-split-vs-account.c -Lsrc/engine/test/test-split-vs-account.c -u -r1.8.4.2 -r1.8.4.3
--- src/engine/test/test-split-vs-account.c
+++ src/engine/test/test-split-vs-account.c
@@ -1,17 +1,35 @@
+/***************************************************************************
+ *            test-split-vs-account.c
+ *
+ *  Tue Sep 27 19:44:50 2005
+ *  Copyright  2005  GnuCash team
+ *  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 <glib.h>
-#include <libguile.h>
-
+#include "qof.h"
+#include "cashobjects.h"
 #include "AccountP.h"
 #include "TransLog.h"
 #include "gnc-engine.h"
-#include "gnc-module.h"
-#include "qofsession.h"
 #include "test-engine-stuff.h"
 #include "test-stuff.h"
 #include "Transaction.h"
-#include "guid.h"
-
 
 static void
 run_test (void)
@@ -31,27 +49,27 @@
         failure("act1 not created");
         return;
     }
-    
+    success("act1 created");
     act2 = get_random_account(book);
     if(!act2)
     {
         failure("act2 not created");
         return;
     }
-
+	success("act2 created");
     spl = get_random_split(book, act1);
     if(!spl)
     {
         failure("spl not created");
         return;
     }
-
+	success("random split created");
     if(act1 != xaccSplitGetAccount(spl))
     {
         failure("xaccAccountInsertSplit is broken");
         return;
     }
-
+	success("xaccAccountInsertSplit works");
     /* this is weird -- we are testing an engine private function.
      * is this really what is intended here ??? */
     xaccAccountRemoveSplit (act1, spl);
@@ -62,26 +80,18 @@
 		     __FILE__, __LINE__, "account not NULL");
         return;
     }
+	success("xaccSplitGetAccount works");
 }
 
-static void
-main_helper (void *closure, int argc, char **argv)
+int
+main (int argc, char **argv)
 {
-  gnc_module_load("gnucash/engine", 0);
-
+	qof_init();
+	if(cashobjects_register()) {
   xaccLogDisable ();
-
   run_test ();
-
-  success("split account crap seems to work");
-
   print_test_results();
-  exit(get_rv());
-}
-
-int
-main (int argc, char **argv)
-{
-  scm_boot_guile (argc, argv, main_helper, NULL);
+	}
+	qof_close();
   return 0;
 }
Index: test-object.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/test/test-object.c,v
retrieving revision 1.3.4.3
retrieving revision 1.3.4.4
diff -Lsrc/engine/test/test-object.c -Lsrc/engine/test/test-object.c -u -r1.3.4.3 -r1.3.4.4
--- src/engine/test/test-object.c
+++ src/engine/test/test-object.c
@@ -1,16 +1,31 @@
+/***************************************************************************
+ *            test-object.c
+ *
+ *  Tue Sep 27 19:37:28 2005
+ *  Copyright  2005  GnuCash team
+ ****************************************************************************/
 /*
+ *  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.
+ */
+ /*
  * Lightly test the QofObject infrastructure.
  */
 #include <glib.h>
-#include <libguile.h>
-
-#include "guid.h"
-#include "gnc-module.h"
-#include "gnc-engine-util.h"
+#include "qof.h"
+#include "cashobjects.h"
 #include "messages.h"
-#include "qofbook.h"
-#include "qofobject.h"
-
 #include "test-stuff.h"
 
 #define TEST_MODULE_NAME "object-test"
@@ -128,18 +143,14 @@
   do_test (res != NULL, "object: Printable: mod_name, object");
 }
 
-static void
-main_helper (void *closure, int argc, char **argv)
-{
-  gnc_module_load("gnucash/engine", 0);
-  test_object();
-  print_test_results();
-  exit(get_rv());
-}
-
 int
 main (int argc, char **argv)
 {
-  scm_boot_guile (argc, argv, main_helper, NULL);
+	qof_init();
+	if(cashobjects_register()) {
+		test_object();
+		print_test_results();
+	}
+	qof_close();
   return 0;
 }
Index: test-query.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/test/test-query.c,v
retrieving revision 1.6.4.3
retrieving revision 1.6.4.4
diff -Lsrc/engine/test/test-query.c -Lsrc/engine/test/test-query.c -u -r1.6.4.3 -r1.6.4.4
--- src/engine/test/test-query.c
+++ src/engine/test/test-query.c
@@ -1,13 +1,32 @@
+/***************************************************************************
+ *            test-query.c
+ *
+ *  Tue Sep 27 19:12:41 2005
+ *  Copyright  2005 GnuCash team
+ ****************************************************************************/
+/*
+ *  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 <glib.h>
-#include <libguile.h>
-
+#include "qof.h"
+#include "cashobjects.h"
 #include "Group.h"
 #include "Transaction.h"
 #include "TransLog.h"
 #include "gnc-engine.h"
-#include "gnc-module.h"
-#include "gnc-session.h"
 #include "test-engine-stuff.h"
 #include "test-stuff.h"
 
@@ -60,36 +79,29 @@
 
   xaccGroupForEachTransaction (group, test_trans_query, book);
 
-  qof_session_destroy (session);
+  qof_session_end (session);
 }
 
-static void
-main_helper (void *closure, int argc, char **argv)
+int
+main (int argc, char **argv)
 {
   int i;
 
-  gnc_module_load("gnucash/engine", 0);
-
+	qof_init();
   g_log_set_always_fatal( G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING );
 
   xaccLogDisable ();
 
   /* Always start from the same random seed so we fail consistently */
   srand(0);
-
+	if(cashobjects_register()) {
   /* Loop the test. */
   for (i=0; i < 10; i++)
+		{
     run_test ();
-
+		}
+	}
   success("queries seem to work");
-
-  print_test_results();
-  exit(get_rv());
-}
-
-int
-main (int argc, char **argv)
-{
-  scm_boot_guile (argc, argv, main_helper, NULL);
+	qof_close();
   return 0;
 }


More information about the gnucash-changes mailing list