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:
Brent McBride committed 2026-10-02 20:57:00 -07:00
1 parent 5a4115d370
commit 22e9ff9a49
1 file changed
+2 -2
+2 -2
View File
@@ -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);
}