[Gnucash-changes] r13273 - gnucash/trunk - Fix test (init) failure.

Joshua Sled jsled at cvs.gnucash.org
Wed Feb 15 22:35:00 EST 2006


Author: jsled
Date: 2006-02-15 22:34:59 -0500 (Wed, 15 Feb 2006)
New Revision: 13273
Trac: http://svn.gnucash.org/trac/changeset/13273

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/backend/file/gnc-backend-file.c
   gnucash/trunk/src/backend/file/test/test-load-xml2.c
Log:
Fix test (init) failure.

Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-02-15 23:20:31 UTC (rev 13272)
+++ gnucash/trunk/ChangeLog	2006-02-16 03:34:59 UTC (rev 13273)
@@ -1,3 +1,9 @@
+2006-02-15  Joshua Sled  <jsled at asynchronous.org>
+
+	* src/backend/file/test/test-load-xml2.c (main): Initialize
+	g_types before we can expect gconf (via the gnc file backend) to
+	work, as per the gconf API docs.
+
 2006-02-15  Derek Atkins  <derek at ihtfp.com>
 
 	* src/business/business-core/business-core.scm: 

Modified: gnucash/trunk/src/backend/file/gnc-backend-file.c
===================================================================
--- gnucash/trunk/src/backend/file/gnc-backend-file.c	2006-02-15 23:20:31 UTC (rev 13272)
+++ gnucash/trunk/src/backend/file/gnc-backend-file.c	2006-02-16 03:34:59 UTC (rev 13273)
@@ -971,7 +971,7 @@
 
         gnc_be->file_retention_days = (int)gnc_gconf_get_float("general", "retain_days", NULL);
         gnc_be->file_compression = gnc_gconf_get_bool("general", "file_compression", NULL);
-          
+
         gnc_gconf_general_register_cb("retain_days", retain_changed_cb, be);
         gnc_gconf_general_register_cb("file_compression", compression_changed_cb, be);
 

Modified: gnucash/trunk/src/backend/file/test/test-load-xml2.c
===================================================================
--- gnucash/trunk/src/backend/file/test/test-load-xml2.c	2006-02-15 23:20:31 UTC (rev 13272)
+++ gnucash/trunk/src/backend/file/test/test-load-xml2.c	2006-02-16 03:34:59 UTC (rev 13273)
@@ -26,7 +26,6 @@
  * @brief test the loading of a version-2 gnucash XML file
  */
 
-#include <glib.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <sys/types.h>
@@ -34,6 +33,9 @@
 #include <unistd.h>
 #include <dirent.h>
 #include <string.h>
+#include <glib.h>
+#include <glib-object.h>
+
 #include "cashobjects.h"
 #include "Group.h"
 #include "TransLog.h"
@@ -107,12 +109,14 @@
     const char *location = getenv("GNC_TEST_FILES");
     DIR *xml2_dir;
 
-	qof_init();
-	cashobjects_register();
-	do_test(
-		qof_load_backend_library ("../", GNC_LIB_NAME, GNC_LIB_INIT),
-		" loading gnc-backend-file GModule failed");
+    g_type_init();
 
+    qof_init();
+    cashobjects_register();
+    do_test(
+            qof_load_backend_library ("../", GNC_LIB_NAME, GNC_LIB_INIT),
+            " loading gnc-backend-file GModule failed");
+
     if (!location)
     {
         location = "test-files/xml2";



More information about the gnucash-changes mailing list