Merge Richard Cohen's 'fix-test-engine-crash' into stable.

This commit is contained in:
John Ralls 2023-05-17 21:20:44 -05:00
commit 8ccc6da87e
3 changed files with 17 additions and 15 deletions

View File

@ -760,12 +760,13 @@ void gncInvoiceSortEntries (GncInvoice *invoice)
void gncInvoiceRemoveEntries (GncInvoice *invoice) void gncInvoiceRemoveEntries (GncInvoice *invoice)
{ {
GList *node;
if (!invoice) return; if (!invoice) return;
for (node = invoice->entries; node; node = node->next) // gnc{Bill,Invoice}RemoveEntry free the "entry" node.
// Make sure to save "next" first.
for (GList *next, *node = invoice->entries; node; node = next)
{ {
next = node->next;
GncEntry *entry = node->data; GncEntry *entry = node->data;
switch (gncInvoiceGetOwnerType (invoice)) switch (gncInvoiceGetOwnerType (invoice))

View File

@ -142,7 +142,7 @@ test_account_kvp_properties (Fixture *fixture, gconstpointer pData)
gchar *ab_acct_id = "1234-5678-9087"; gchar *ab_acct_id = "1234-5678-9087";
gchar *ab_bank_code = "0032340"; gchar *ab_bank_code = "0032340";
gchar *online_id_r, *ab_acct_id_r, *ab_bank_code_r; gchar *online_id_r, *ab_acct_id_r, *ab_bank_code_r;
GncGUID *ofx_income_acct = guid_malloc (); GncGUID *ofx_income_acct = guid_new ();
GncGUID *ofx_income_acct_r; GncGUID *ofx_income_acct_r;
Time64 trans_retr = {gnc_time(NULL)}; Time64 trans_retr = {gnc_time(NULL)};
Time64 *trans_retr_r; Time64 *trans_retr_r;
@ -186,8 +186,8 @@ test_account_kvp_properties (Fixture *fixture, gconstpointer pData)
static void static void
test_trans_kvp_properties (Fixture *fixture, gconstpointer pData) test_trans_kvp_properties (Fixture *fixture, gconstpointer pData)
{ {
GncGUID *invoice = guid_malloc (); GncGUID *invoice = guid_new ();
GncGUID *from_sx = guid_malloc (); GncGUID *from_sx = guid_new ();
GncGUID *invoice_r, *from_sx_r; GncGUID *invoice_r, *from_sx_r;
gchar *online_id = "my online id"; gchar *online_id = "my online id";
gchar *online_id_r; gchar *online_id_r;
@ -227,7 +227,7 @@ test_split_kvp_properties (Fixture *fixture, gconstpointer pData)
gchar *online_id = "my_online_id"; gchar *online_id = "my_online_id";
gchar *debit_formula_r, *credit_formula_r, *sx_shares_r; gchar *debit_formula_r, *credit_formula_r, *sx_shares_r;
gchar *online_id_r; gchar *online_id_r;
GncGUID *sx_account = guid_malloc (); GncGUID *sx_account = guid_new ();
GncGUID *sx_account_r; GncGUID *sx_account_r;
gnc_numeric debit_numeric = gnc_numeric_create (123, 456); gnc_numeric debit_numeric = gnc_numeric_create (123, 456);
gnc_numeric credit_numeric = gnc_numeric_create (789, 456); gnc_numeric credit_numeric = gnc_numeric_create (789, 456);
@ -285,11 +285,11 @@ test_split_kvp_properties (Fixture *fixture, gconstpointer pData)
static void static void
test_lot_kvp_properties (Fixture *fixture, gconstpointer pData) test_lot_kvp_properties (Fixture *fixture, gconstpointer pData)
{ {
GncGUID *invoice = guid_malloc (); GncGUID *invoice = guid_new ();
GncGUID *invoice_r; GncGUID *invoice_r;
gint64 owner_type = 47; gint64 owner_type = 47;
gint64 owner_type_r; gint64 owner_type_r;
GncGUID *owner = guid_malloc (); GncGUID *owner = guid_new ();
GncGUID *owner_r; GncGUID *owner_r;
qof_begin_edit (QOF_INSTANCE (fixture->lot)); qof_begin_edit (QOF_INSTANCE (fixture->lot));
@ -322,8 +322,8 @@ test_customer_kvp_properties (Fixture *fixture, gconstpointer pData)
{ {
gchar *pdf_dir = "/foo/bar/baz"; gchar *pdf_dir = "/foo/bar/baz";
gchar *pdf_dir_r; gchar *pdf_dir_r;
GncGUID *inv_acct = guid_malloc (); GncGUID *inv_acct = guid_new ();
GncGUID *pmt_acct = guid_malloc (); GncGUID *pmt_acct = guid_new ();
GncGUID *inv_acct_r, *pmt_acct_r; GncGUID *inv_acct_r, *pmt_acct_r;
qof_begin_edit (QOF_INSTANCE (fixture->cust)); qof_begin_edit (QOF_INSTANCE (fixture->cust));
@ -358,8 +358,8 @@ test_employee_kvp_properties (Fixture *fixture, gconstpointer pData)
{ {
gchar *pdf_dir = "/foo/bar/baz"; gchar *pdf_dir = "/foo/bar/baz";
gchar *pdf_dir_r; gchar *pdf_dir_r;
GncGUID *inv_acct = guid_malloc (); GncGUID *inv_acct = guid_new ();
GncGUID *pmt_acct = guid_malloc (); GncGUID *pmt_acct = guid_new ();
GncGUID *inv_acct_r, *pmt_acct_r; GncGUID *inv_acct_r, *pmt_acct_r;
qof_begin_edit (QOF_INSTANCE (fixture->emp)); qof_begin_edit (QOF_INSTANCE (fixture->emp));
@ -417,8 +417,8 @@ test_vendor_kvp_properties (Fixture *fixture, gconstpointer pData)
{ {
gchar *pdf_dir = "/foo/bar/baz"; gchar *pdf_dir = "/foo/bar/baz";
gchar *pdf_dir_r; gchar *pdf_dir_r;
GncGUID *inv_acct = guid_malloc (); GncGUID *inv_acct = guid_new ();
GncGUID *pmt_acct = guid_malloc (); GncGUID *pmt_acct = guid_new ();
GncGUID *inv_acct_r, *pmt_acct_r; GncGUID *inv_acct_r, *pmt_acct_r;
qof_begin_edit (QOF_INSTANCE (fixture->vend)); qof_begin_edit (QOF_INSTANCE (fixture->vend));

View File

@ -881,6 +881,7 @@ test_xaccTransEqual (Fixture *fixture, gconstpointer pData)
frame->set({"qux", "quux", "corge"}, new KvpValue(123.456)); frame->set({"qux", "quux", "corge"}, new KvpValue(123.456));
xaccTransCommitEdit (clone); xaccTransCommitEdit (clone);
g_free (cleanup->msg); g_free (cleanup->msg);
cleanup->msg = NULL;
g_free (check->msg); g_free (check->msg);
check->msg = g_strdup ("[xaccSplitEqual] GUIDs differ"); check->msg = g_strdup ("[xaccSplitEqual] GUIDs differ");
auto split1 = xaccTransGetSplit (clone, 0); auto split1 = xaccTransGetSplit (clone, 0);