mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Make the tests for growing commodity tables more accurate -
silences incorrect failures. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13738 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
0609d99045
commit
720f543e25
@ -128,8 +128,7 @@ test_commodity(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
int i;
|
int i, j, num_total = 0;
|
||||||
int j;
|
|
||||||
gnc_commodity_table *tbl;
|
gnc_commodity_table *tbl;
|
||||||
gnc_commodity *coms[20];
|
gnc_commodity *coms[20];
|
||||||
QofBook *book;
|
QofBook *book;
|
||||||
@ -144,14 +143,18 @@ test_commodity(void)
|
|||||||
{
|
{
|
||||||
coms[i] = get_random_commodity(book);
|
coms[i] = get_random_commodity(book);
|
||||||
|
|
||||||
|
if (!gnc_commodity_table_lookup(
|
||||||
|
tbl, gnc_commodity_get_namespace(coms[i]),
|
||||||
|
gnc_commodity_get_mnemonic(coms[i])))
|
||||||
|
num_total++;
|
||||||
do_test(
|
do_test(
|
||||||
gnc_commodity_table_insert(tbl, coms[i]) != NULL,
|
gnc_commodity_table_insert(tbl, coms[i]) != NULL,
|
||||||
"insert test");
|
"insert test");
|
||||||
|
|
||||||
do_test_args(
|
do_test_args(
|
||||||
(int)gnc_commodity_table_get_size(tbl) == i + 1,
|
(int)gnc_commodity_table_get_size(tbl) == num_total,
|
||||||
"test next size table", __FILE__, __LINE__,
|
"test next size table", __FILE__, __LINE__,
|
||||||
"should be %d and is %d", i + 1,
|
"should be %d and is %d", num_total,
|
||||||
gnc_commodity_table_get_size(tbl));
|
gnc_commodity_table_get_size(tbl));
|
||||||
|
|
||||||
for(j = 0; j <= i; j++)
|
for(j = 0; j <= i; j++)
|
||||||
@ -190,5 +193,5 @@ main (int argc, char **argv)
|
|||||||
qof_query_shutdown();
|
qof_query_shutdown();
|
||||||
guid_shutdown();
|
guid_shutdown();
|
||||||
qof_object_shutdown ();
|
qof_object_shutdown ();
|
||||||
return 0;
|
return get_rv();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user