27 #include "cashobjects.h"
32 #include "test-stuff.h"
37 GList *children, *node;
40 return (book == NULL);
42 if (gnc_account_get_book(parent) != book)
46 for (node = children; node; node = node->next)
48 if (!account_tree_has_book (node->data, book))
51 g_list_free(children);
69 failure(
"book not created");
73 root1 = get_random_account (book);
76 failure(
"root1 not created");
80 if (!account_tree_has_book (root1, book))
82 failure(
"new root has wrong book");
92 gnc_book_set_root_account (book, root1);
93 if (!account_tree_has_book (root1, book))
95 failure(
"gnc_book_set_root_account didn't take");
99 root2 = get_random_account (book);
102 failure(
"root2 not created");
106 gnc_book_set_root_account (book, root2);
110 if (!account_tree_has_book (root1, NULL))
112 failure(
"gnc_book_set_root_account didn't clear old");
117 if (!account_tree_has_book (root2, book))
119 failure(
"gnc_book_set_root_account didn't take");
123 account1 = get_random_account (book);
126 failure(
"account1 not created");
133 failure(
"group insert account didn't work");
137 account2 = get_random_account (book);
140 failure(
"account2 not created");
147 failure(
"account2 has wrong book");
154 failure(
"remove group didn't take");
160 main (
int argc,
char **argv)
164 if (cashobjects_register())
167 for (i = 0; i < 10; i++)
171 success (
"group/book stuff seems to work");
172 print_test_results();
Account * gnc_account_get_parent(const Account *acc)
void gnc_account_append_child(Account *new_parent, Account *child)
void xaccLogDisable(void)
QofBook * qof_book_new(void)
void gnc_account_remove_child(Account *parent, Account *child)
Account handling public routines.
All type declarations for the whole Gnucash engine.
API for the transaction logger.
void qof_close(void)
Safely close down the Query Object Framework.
GList * gnc_account_get_children(const Account *account)
void qof_init(void)
Initialise the Query Object Framework.