27 #include "cashobjects.h"
32 #include "test-stuff.h"
35 test_trans_query (
Transaction *trans, gpointer data)
41 q = make_trans_query (trans, ALL_QT);
44 list = xaccQueryGetTransactions (q, QUERY_TXN_MATCH_ANY);
45 if (g_list_length (list) != 1)
47 failure_args (
"test number returned", __FILE__, __LINE__,
48 "number of matching transactions %d not 1",
49 g_list_length (list));
54 if (list->data != trans)
56 failure (
"matching transaction is wrong");
61 success (
"found right transaction");
75 session = get_random_session ();
77 root = gnc_book_get_root_account (book);
79 add_random_transactions_to_book (book, 20);
87 main (
int argc,
char **argv)
92 g_log_set_always_fatal( G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING );
98 if (!cashobjects_register())
100 failure(
"can't register cashbojects");
105 for (i = 0; i < 10; i++)
109 success(
"queries seem to work");
int xaccAccountTreeForEachTransaction(Account *acc, TransactionCallback proc, void *data)
void xaccLogDisable(void)
struct _QofQuery QofQuery
QofBook * qof_session_get_book(const QofSession *session)
void qof_query_destroy(QofQuery *q)
void qof_query_set_book(QofQuery *q, QofBook *book)
All type declarations for the whole Gnucash engine.
API for the transaction logger.
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.
API for Transactions and Splits (journal entries)