Fix gncInvoice test failure.

test_suite_gncInvoice sets up the test suite. It's not part of the test
runtime, so stack variables in it have gone out of scope by the time the
tests are actually run. Making invoiceData static makes it permanent so
it exists at runtime.
This commit is contained in:
John Ralls
2018-08-06 14:49:07 -07:00
parent d87fa3a5be
commit 78ab26cc2b

View File

@@ -205,7 +205,7 @@ test_invoice_posted_trans ( Fixture *fixture, gconstpointer pData )
void
test_suite_gncInvoice ( void )
{
InvoiceData pData = { FALSE, FALSE, { 1000, 100 }, { 2000, 100 } }; // Vendor bill
static InvoiceData pData = { FALSE, FALSE, { 1000, 100 }, { 2000, 100 } }; // Vendor bill
GNC_TEST_ADD( suitename, "post/unpost", Fixture, &pData, setup, test_invoice_post, teardown );
GNC_TEST_ADD( suitename, "post trans - vendor bill", Fixture, &pData, setup_with_invoice, test_invoice_posted_trans, teardown_with_invoice );