- better fix for #accounts

- don't g_list_free the account_list



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13127 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins 2006-02-05 21:10:19 +00:00
parent fc0a9336ec
commit e9e033f60e
2 changed files with 6 additions and 6 deletions

View File

@ -14,6 +14,10 @@
have at least two accounts.
- free the results of xaccGroupGetSubAccounts().
* src/engine/test/test-engine-stuff.c:
- better fix for #accounts
- don't g_list_free the account_list
2006-02-05 Neil Williams <linux@codehelp.co.uk>
* lib/libqof/qof/qoflog.c :

View File

@ -863,6 +863,7 @@ make_random_group_depth (QofBook *book, AccountGroup *group, int depth)
Account *account = get_random_account (book);
xaccGroupInsertAccount (group, account);
total_num_accounts++;
account_add_subaccounts (book, account, depth - 1);
}
@ -872,7 +873,6 @@ static void
make_random_group (QofBook *book, AccountGroup *group)
{
int depth;
GList *account_list;
g_return_if_fail (book);
g_return_if_fail (group);
@ -883,10 +883,8 @@ make_random_group (QofBook *book, AccountGroup *group)
make_random_group_depth (book, group, depth);
/* Make sure we have at least two accounts! */
account_list = xaccGroupGetSubAccounts (xaccGetAccountGroup (book));
if (1 >= g_list_length (account_list))
if (total_num_accounts <= 1)
make_random_group_depth (book, group, 1);
g_list_free(account_list);
}
AccountGroup *
@ -1408,7 +1406,6 @@ get_random_transaction_with_currency(QofBook *book,
if (1 >= g_list_length (account_list)) {
failure_args("engine-stuff", __FILE__, __LINE__,
"get_random_transaction_with_currency: account_list too short");
g_list_free(account_list);
return NULL;
}
@ -1432,7 +1429,6 @@ get_random_transaction_with_currency(QofBook *book,
xaccTransSetSlots_nc(trans, f);
add_random_splits(book, trans, account_list);
g_list_free(account_list);
if (get_random_int_in_range (1, 10) == 1)
{