mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-10-15 02:42:00 -05:00
Use xaccAccountGetSplitsSize in cap-gains regression test
Per review: faster than g_list_length(xaccAccountGetSplitList()) and avoids leaking the returned list.
This commit is contained in:
1 parent
5a4115d370
commit
22e9ff9a49
1 file changed
+2
-2
@@ -2188,13 +2188,13 @@ test_xaccSplitComputeCapGains_unresolved_source (void)
|
||||
marker->gains = GAINS_STATUS_UNKNOWN; marker->gains_split = nullptr;
|
||||
gain_inc->gains = GAINS_STATUS_UNKNOWN; gain_inc->gains_split = nullptr;
|
||||
|
||||
g_assert_cmpint (g_list_length (xaccAccountGetSplitList (gains_acc)), ==, 1);
|
||||
g_assert_cmpint (xaccAccountGetSplitsSize (gains_acc), ==, 1);
|
||||
|
||||
/* Process the marker first, with the source still unresolved. */
|
||||
xaccSplitComputeCapGains (marker, gains_acc);
|
||||
|
||||
/* The existing gains split must be reused, not duplicated/orphaned. */
|
||||
g_assert_cmpint (g_list_length (xaccAccountGetSplitList (gains_acc)), ==, 1);
|
||||
g_assert_cmpint (xaccAccountGetSplitsSize (gains_acc), ==, 1);
|
||||
|
||||
qof_book_destroy (book);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user