28 #include <glib/gstdio.h>
32 #include "gnc-xml-helper.h"
34 #include "cashobjects.h"
38 #include "sixtp-parsers.h"
39 #include "sixtp-dom-parsers.h"
41 #include "test-stuff.h"
43 #include "test-file-stuff.h"
50 test_add_pricedb (
const char *tag, gpointer globaldata, gpointer data)
56 "gnc_pricedb_sixtp_parser_create",
57 __FILE__, __LINE__,
"%d", iter);
70 test_node = gnc_pricedb_dom_tree_create (db);
74 failure_args (
"pricedb_xml", __FILE__, __LINE__,
75 "gnc_pricedb_dom_tree_create returned NULL");
82 filename1 = g_strdup_printf (
"test_file_XXXXXX");
84 fd = g_mkstemp (filename1);
86 write_dom_node_to_file (test_node, fd);
93 sixtp_gdv2 data = {book, lc, NULL, NULL, FALSE};
95 parser = sixtp_new ();
97 if (!sixtp_add_some_sub_parsers
99 "gnc:pricedb", gnc_pricedb_sixtp_parser_create(),
102 failure_args (
"sixtp_add_some_sub_parsers failed",
103 __FILE__, __LINE__,
"%d", iter);
105 else if (!gnc_xml_parse_file (parser, filename1, test_add_pricedb,
109 failure_args (
"gnc_xml_parse_file returned FALSE",
110 __FILE__, __LINE__,
"%d", iter);
114 g_unlink (filename1);
116 xmlFreeNode (test_node);
120 test_generation (
void)
122 for (iter = 0; iter < 20; iter++)
125 g_message(
"iter=%d", iter);
126 session = qof_session_new();
130 failure_args (
"gnc_random_price_db returned NULL",
131 __FILE__, __LINE__,
"%d", iter);
143 main (
int argc,
char ** argv)
146 cashobjects_register();
150 session = qof_session_new ();
152 print_test_results ();
QofBook * qof_instance_get_book(gconstpointer)
a simple price database for gnucash
gboolean gnc_pricedb_equal(GNCPriceDB *db1, GNCPriceDB *db2)
GNCPriceDB * gnc_pricedb_get_db(QofBook *book)
QofBook * qof_session_get_book(const QofSession *session)
api for GnuCash version 2 XML-based file format
void gnc_pricedb_destroy(GNCPriceDB *db)
guint gnc_pricedb_get_num_prices(GNCPriceDB *db)
All type declarations for the whole Gnucash engine.
void qof_close(void)
Safely close down the Query Object Framework.
void qof_session_end(QofSession *session)
void qof_init(void)
Initialise the Query Object Framework.