[Gnucash-changes] removing Guile

Neil Williams codehelp at cvs.gnucash.org
Mon Aug 22 16:01:44 EDT 2005


Log Message:
-----------
removing Guile

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash/src/engine/test:
        test-commodities.c
        test-freq-spec.c
        test-numeric.c
        test-transaction-reversal.c
        test-transaction-voiding.c

Revision Data
-------------
Index: test-freq-spec.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/test/test-freq-spec.c,v
retrieving revision 1.6.4.3
retrieving revision 1.6.4.4
diff -Lsrc/engine/test/test-freq-spec.c -Lsrc/engine/test/test-freq-spec.c -u -r1.6.4.3 -r1.6.4.4
--- src/engine/test/test-freq-spec.c
+++ src/engine/test/test-freq-spec.c
@@ -1,20 +1,32 @@
-
 /*
  * Testing routine added by Ben Stanley bds02 at uow.edu.au 20010320
  * Try to test Joshua Sled's FreqSpec module.
  *
  */
+/*
+ *  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>
 #include <glib.h>
-#include <libguile.h>
-
+#include <qof.h>
+#include "cashobjects.h"
 #include "test-stuff.h"
 #include "FreqSpec.h"
 #include "gnc-engine.h"
-#include "gnc-module.h"
 #include "qofbook.h"
 
 static QofBook *book;
@@ -522,41 +534,24 @@
    xaccFreqSpecFree(fs);
 }
 
-static void
-guile_main ( void *closure, int argc, char* argv[] )
+int
+main (int argc, char **argv)
 {
-   gnc_module_load("gnucash/engine", 0);
-
-   g_log_set_always_fatal( G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING );
-
-#if 0
-   set_success_print(TRUE);
-#endif
-
-   book = qof_book_new ();
+	QofSession *session;
 
+	qof_init();
+	g_return_val_if_fail(cashobjects_register(), -1);
+	session = qof_session_new ();
+	book = qof_session_get_book(session);
+	qof_session_begin(session, QOF_STDOUT, TRUE, FALSE);
    test_once();
-
    test_daily();
-
    test_weekly();
-
    test_monthly();
-
    test_month_relative();
-
    test_composite();
-
-   qof_book_destroy (book);
-
    print_test_results();
-   exit (get_rv());
-}
-
-
-int
-main (int argc, char **argv)
-{
-  scm_boot_guile (argc, argv, guile_main, NULL);
+	qof_session_end(session);
+	qof_close();
   return 0;
 }
Index: test-transaction-voiding.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/test/test-transaction-voiding.c,v
retrieving revision 1.9.4.1
retrieving revision 1.9.4.2
diff -Lsrc/engine/test/test-transaction-voiding.c -Lsrc/engine/test/test-transaction-voiding.c -u -r1.9.4.1 -r1.9.4.2
--- src/engine/test/test-transaction-voiding.c
+++ src/engine/test/test-transaction-voiding.c
@@ -1,18 +1,35 @@
+/***************************************************************************
+ *            test-transaction-voiding.c
+ *
+ *  Modified to run without Guile: Mon Aug 22 11:24:44 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 <glib.h>
-#include <libguile.h>
 #include <string.h>
-
+#include <qof.h>
+#include "cashobjects.h"
 #include "Account.h"
 #include "TransLog.h"
-#include "Transaction.h"
-#include "gnc-engine.h"
-#include "gnc-module.h"
 #include "test-engine-stuff.h"
 #include "test-stuff.h"
 #include "Transaction.h"
-#include "guid.h"
-
-
 
 #define print_gnc_numeric(num) fprintf(stderr, "%s\n", gnc_numeric_to_string(num))
 
@@ -172,24 +189,17 @@
   return;
 }
 
-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("transaction voiding seems OK");
-
   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-numeric.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/test/test-numeric.c,v
retrieving revision 1.18.2.4
retrieving revision 1.18.2.5
diff -Lsrc/engine/test/test-numeric.c -Lsrc/engine/test/test-numeric.c -u -r1.18.2.4 -r1.18.2.5
--- src/engine/test/test-numeric.c
+++ src/engine/test/test-numeric.c
@@ -4,13 +4,28 @@
  * of vairous operations.
  *
  * June 2004
- * License: GPL
  */
+/*
+ *  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 <ctype.h>
 #include <glib.h>
-
-#include "gnc-module.h"
+#include <qof.h>
+#include "cashobjects.h"
 #include "test-stuff.h"
 #include "test-engine-stuff.h"
 #include "gnc-numeric.h"
@@ -744,22 +759,15 @@
 	check_mult_div ();
 }
 
-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");
-
-  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()) {
+		run_test ();
+		print_test_results();
+	}
+	qof_close();
   return 0;
 }
 
Index: test-commodities.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/test/test-commodities.c,v
retrieving revision 1.7.4.4
retrieving revision 1.7.4.5
diff -Lsrc/engine/test/test-commodities.c -Lsrc/engine/test/test-commodities.c -u -r1.7.4.4 -r1.7.4.5
--- src/engine/test/test-commodities.c
+++ src/engine/test/test-commodities.c
@@ -1,16 +1,34 @@
-#include <glib.h>
-#include <libguile.h>
+/***************************************************************************
+ *            test-commodities.c
+ *
+ *  Mon Aug 22 09:08:32 2005
+ *  Original authors: Derek Atkins, Linas Vepstas.
+ *  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 "gnc-engine-util.h"
+#include <glib.h>
 
 #include "gnc-commodity.h"
-#include "gnc-engine.h"
-#include "gnc-module.h"
-#include "qofbook.h"
+#include "qof.h"
 #include "test-engine-stuff.h"
 #include "test-stuff.h"
 
-
 static void
 test_commodity(void)
 {
@@ -158,18 +176,20 @@
     
 }
 
-static void
-main_helper (void *closure, int argc, char **argv)
-{
-  gnc_module_load("gnucash/engine", 0);
-  test_commodity();
-  print_test_results();
-  exit(get_rv());
-}
-
 int
 main (int argc, char **argv)
 {
-  scm_boot_guile (argc, argv, main_helper, NULL);
+	gnc_engine_get_string_cache ();
+	guid_init ();
+	qof_object_initialize ();
+	qof_query_init ();
+	qof_book_register ();
+	gnc_commodity_table_register();
+	test_commodity();
+	print_test_results();
+	qof_query_shutdown();
+	guid_shutdown();
+	qof_object_shutdown ();
+	gnc_engine_string_cache_destroy();
   return 0;
 }
Index: test-transaction-reversal.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/test/test-transaction-reversal.c,v
retrieving revision 1.3.4.4
retrieving revision 1.3.4.5
diff -Lsrc/engine/test/test-transaction-reversal.c -Lsrc/engine/test/test-transaction-reversal.c -u -r1.3.4.4 -r1.3.4.5
--- src/engine/test/test-transaction-reversal.c
+++ src/engine/test/test-transaction-reversal.c
@@ -1,19 +1,35 @@
+/***************************************************************************
+ *            test-transaction-reversal.c
+ *
+ *  Modified to run without Guile: Mon Aug 22 11:19:56 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 <glib.h>
-#include <libguile.h>
 #include <string.h>
-
+#include <qof.h>
+#include "cashobjects.h"
+#include "Transaction.h"
 #include "Account.h"
 #include "TransLog.h"
-#include "Transaction.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"
-
-
 
 #define print_gnc_numeric(num) fprintf(stderr, "%s\n", gnc_numeric_to_string(num))
 
@@ -101,25 +117,16 @@
   return;
 }
 
-static void
-main_helper (void *closure, int argc, char **argv)
+int
+main (int argc, char **argv)
 {
-  gnc_module_load("gnucash/engine", 0);
-
-  xaccLogDisable ();
+	qof_init();
+	if(cashobjects_register()) {
   set_success_print (TRUE);
-
   run_test ();
-
   success("transaction voiding seems OK");
-
   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