mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix make check after commit 673888dee7
- Update the lot list of the lot's account only when the account itself is not being destroyed - Fix the test cases to accept the new (improved) lot destruction handling
This commit is contained in:
parent
ecb43e7d72
commit
1339c1161f
@ -227,7 +227,7 @@ gnc_lot_free(GNCLot* lot)
|
||||
}
|
||||
g_list_free (priv->splits);
|
||||
|
||||
if (priv->account)
|
||||
if (priv->account && !qof_instance_get_destroying(priv->account))
|
||||
xaccAccountRemoveLot (priv->account, lot);
|
||||
|
||||
priv->account = NULL;
|
||||
|
@ -1274,15 +1274,11 @@ test_xaccAccountInsertRemoveLot (Fixture *fixture, gconstpointer pData)
|
||||
g_assert_cmpuint (g_list_length (p_priv->lots), == , 1);
|
||||
g_assert (gnc_lot_get_account (lot) == parent);
|
||||
gnc_lot_destroy (lot);
|
||||
/* Destroying the lot should remove it from the account; Not Happening. */
|
||||
g_assert_cmpuint (g_list_length (p_priv->lots), != , 0);
|
||||
/* Destroying the lot should remove it from the account. */
|
||||
g_assert_cmpuint (g_list_length (p_priv->lots), == , 0);
|
||||
test_signal_assert_hits (sig1, 3);
|
||||
/* We get a modify only on the insert, since there is no remove when
|
||||
* the lot is destroyed. */
|
||||
test_signal_assert_hits (sig4, 3);
|
||||
/* Same thing: There should be a "removed" signal on the lot, but
|
||||
* since it isn't removed, no signal. */
|
||||
test_signal_assert_hits (sig3, 1);
|
||||
test_signal_assert_hits (sig3, 2);
|
||||
test_signal_assert_hits (sig4, 4);
|
||||
test_signal_free (sig1);
|
||||
test_signal_free (sig2);
|
||||
test_signal_free (sig3);
|
||||
|
Loading…
Reference in New Issue
Block a user