deprecate xaccAccountCountSplits with include_children = FALSE

whereby xaccAccountCountSplits is called with with_children = FALSE,
test xaccAccountGetSplitList against NULL.
This commit is contained in:
Christopher Lam
2020-09-30 09:49:07 +08:00
parent 1b31c06b29
commit e6486e9d95
3 changed files with 11 additions and 5 deletions

View File

@@ -175,6 +175,12 @@ test_invoice_post ( Fixture *fixture, gconstpointer pData )
g_assert(!gncInvoiceIsPosted(fixture->invoice));
}
static gboolean account_has_one_split (const Account *acc)
{
GList *splits = xaccAccountGetSplitList (acc);
return (splits && !(splits->next));
}
static void
test_invoice_posted_trans ( Fixture *fixture, gconstpointer pData )
{
@@ -183,8 +189,8 @@ test_invoice_posted_trans ( Fixture *fixture, gconstpointer pData )
gnc_numeric total = gncInvoiceGetTotal(fixture->invoice);
gnc_numeric acct_balance, acct2_balance;
g_assert (1 == xaccAccountCountSplits (fixture->account, FALSE));
g_assert (1 == xaccAccountCountSplits (fixture->account2, FALSE));
g_assert (account_has_one_split (fixture->account));
g_assert (account_has_one_split (fixture->account2));
acct_balance = xaccAccountGetBalance(fixture->account);
acct2_balance = xaccAccountGetBalance(fixture->account2);