static void run_test (void) { QofSession *sess; QofBook *book; Account *root; /* --------------------------------------------------------- */ /* In the first test, we will merely try to see if we can run * without crashing. We don't check to see if data is good. */ sess = get_random_session (); book = qof_session_get_book (sess); do_test ((NULL != book), "create random data"); add_random_transactions_to_book (book, transaction_num); root = gnc_book_get_root_account (book); xaccAccountTreeScrubLots (root); /* --------------------------------------------------------- */ /* In the second test, we create an account with unrealized gains, * and see if that gets fixed correctly, with the correct balances, * and etc. * XXX not implemented */ success ("automatic lot scrubbing lightly tested and seem to work"); qof_session_end (sess); }
static void run_test (void) { QofSession *session; Account *root; QofBook *book; session = get_random_session (); book = qof_session_get_book (session); root = gnc_book_get_root_account (book); add_random_transactions_to_book (book, 20); xaccAccountTreeForEachTransaction (root, test_trans_query, book); qof_session_end (session); }