gnucash master: Revert changes to test-gnc-ui-util.c until I can get my system to test them.

J.Alex Aycinena alex.aycinena at code.gnucash.org
Tue Jul 11 12:09:54 EDT 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/f3858fcd (commit)
	from  https://github.com/Gnucash/gnucash/commit/0bb51ffa (commit)



commit f3858fcd48ddf9af9efba0ef93f914c9637acd16
Author: Alex Aycinena <alex.aycinena at gmail.com>
Date:   Tue Jul 11 09:09:19 2017 -0700

    Revert changes to test-gnc-ui-util.c until I can get my system to test them.

diff --git a/src/app-utils/test/test-gnc-ui-util.c b/src/app-utils/test/test-gnc-ui-util.c
index 8236200..f6c3c36 100644
--- a/src/app-utils/test/test-gnc-ui-util.c
+++ b/src/app-utils/test/test-gnc-ui-util.c
@@ -65,8 +65,6 @@ test_book_use_book_currency( Fixture *fixture, gconstpointer pData )
     const gchar *cur;
     const gchar *pol;
     Account *acct, *acc;
-    gnc_commodity *com = gnc_commodity_new(fixture-> book, "US Dollar",
-                                                "CURRENCY", "USD", "0", 100);
 
     g_test_message( "Testing with no currency accounting method selected" );
     cur = gnc_book_get_book_currency_name( fixture-> book );
@@ -235,7 +233,7 @@ test_book_use_book_currency( Fixture *fixture, gconstpointer pData )
     qof_book_destroy( fixture->book );
     fixture->book = qof_book_new();
 
-     g_test_message( "Testing with book-currency and default-gains-policy set to valid values but default-gain-loss-account-guid set to valid but placeholder account and no trading accounts flag" );
+     g_test_message( "Testing with book-currency, default-gains-policy and default-gain-loss-account-guid set to valid values and no trading accounts flag" );
     qof_book_begin_edit (fixture->book);
     qof_instance_set (QOF_INSTANCE (fixture->book),
 		      "book-currency", "USD",
@@ -243,133 +241,6 @@ test_book_use_book_currency( Fixture *fixture, gconstpointer pData )
     qof_instance_set (QOF_INSTANCE (fixture->book),
 		      "default-gains-policy", "fifo",
 		      NULL);
-    acc = get_random_account( fixture-> book );
-    xaccAccountBeginEdit (acc);
-    xaccAccountSetType (acc, ACCT_TYPE_INCOME);
-    xaccAccountSetCommodity (acc, com);
-    xaccAccountSetPlaceholder (acc, TRUE);
-    xaccAccountSetHidden (acc, FALSE);
-    xaccAccountCommitEdit (acc);
-    qof_instance_set (QOF_INSTANCE (fixture->book),
-		      "default-gain-loss-account-guid", qof_entity_get_guid(QOF_INSTANCE(acc)),
-		      NULL);
-    cur = gnc_book_get_book_currency_name( fixture-> book );
-    g_assert_cmpstr( cur, == , "USD" );
-    pol = gnc_book_get_default_gains_policy( fixture-> book );
-    g_assert_cmpstr( pol, == , "fifo" );
-    acct = gnc_book_get_default_gain_loss_acct ( fixture-> book );
-    g_assert (acct == NULL );
-    g_assert( gnc_book_use_book_currency ( fixture-> book ));
-    qof_book_commit_edit (fixture->book);
-
-    qof_book_destroy( fixture->book );
-    fixture->book = qof_book_new();
-
-     g_test_message( "Testing with book-currency and default-gains-policy set to valid values but default-gain-loss-account-guid set to valid but hidden account and no trading accounts flag" );
-    qof_book_begin_edit (fixture->book);
-    qof_instance_set (QOF_INSTANCE (fixture->book),
-		      "book-currency", "USD",
-		      NULL);
-    qof_instance_set (QOF_INSTANCE (fixture->book),
-		      "default-gains-policy", "fifo",
-		      NULL);
-    acc = get_random_account( fixture-> book );
-    xaccAccountBeginEdit (acc);
-    xaccAccountSetType (acc, ACCT_TYPE_INCOME);
-    xaccAccountSetCommodity (acc, com);
-    xaccAccountSetPlaceholder (acc, FALSE);
-    xaccAccountSetHidden (acc, TRUE);
-    xaccAccountCommitEdit (acc);
-    qof_instance_set (QOF_INSTANCE (fixture->book),
-		      "default-gain-loss-account-guid", qof_entity_get_guid(QOF_INSTANCE(acc)),
-		      NULL);
-    cur = gnc_book_get_book_currency_name( fixture-> book );
-    g_assert_cmpstr( cur, == , "USD" );
-    pol = gnc_book_get_default_gains_policy( fixture-> book );
-    g_assert_cmpstr( pol, == , "fifo" );
-    acct = gnc_book_get_default_gain_loss_acct ( fixture-> book );
-    g_assert (acct == NULL );
-    g_assert( gnc_book_use_book_currency ( fixture-> book ));
-    qof_book_commit_edit (fixture->book);
-
-    qof_book_destroy( fixture->book );
-    fixture->book = qof_book_new();
-
-     g_test_message( "Testing with book-currency and default-gains-policy set to valid values but default-gain-loss-account-guid set to valid but asset account and no trading accounts flag" );
-    qof_book_begin_edit (fixture->book);
-    qof_instance_set (QOF_INSTANCE (fixture->book),
-		      "book-currency", "USD",
-		      NULL);
-    qof_instance_set (QOF_INSTANCE (fixture->book),
-		      "default-gains-policy", "fifo",
-		      NULL);
-    acc = get_random_account( fixture-> book );
-    xaccAccountBeginEdit (acc);
-    xaccAccountSetType (acc, ACCT_TYPE_ASSET);
-    xaccAccountSetCommodity (acc, com);
-    xaccAccountSetPlaceholder (acc, FALSE);
-    xaccAccountSetHidden (acc, FALSE);
-    xaccAccountCommitEdit (acc);
-    qof_instance_set (QOF_INSTANCE (fixture->book),
-		      "default-gain-loss-account-guid", qof_entity_get_guid(QOF_INSTANCE(acc)),
-		      NULL);
-    cur = gnc_book_get_book_currency_name( fixture-> book );
-    g_assert_cmpstr( cur, == , "USD" );
-    pol = gnc_book_get_default_gains_policy( fixture-> book );
-    g_assert_cmpstr( pol, == , "fifo" );
-    acct = gnc_book_get_default_gain_loss_acct ( fixture-> book );
-    g_assert (acct == NULL );
-    g_assert( gnc_book_use_book_currency ( fixture-> book ));
-    qof_book_commit_edit (fixture->book);
-
-    qof_book_destroy( fixture->book );
-    fixture->book = qof_book_new();
-
-     g_test_message( "Testing with book-currency and default-gains-policy set to valid values but default-gain-loss-account-guid set to valid but not book-currency account and no trading accounts flag" );
-    qof_book_begin_edit (fixture->book);
-    qof_instance_set (QOF_INSTANCE (fixture->book),
-		      "book-currency", "GBP",
-		      NULL);
-    qof_instance_set (QOF_INSTANCE (fixture->book),
-		      "default-gains-policy", "fifo",
-		      NULL);
-    acc = get_random_account( fixture-> book );
-    xaccAccountBeginEdit (acc);
-    xaccAccountSetType (acc, ACCT_TYPE_ASSET);
-    xaccAccountSetCommodity (acc, com);
-    xaccAccountSetPlaceholder (acc, FALSE);
-    xaccAccountSetHidden (acc, FALSE);
-    xaccAccountCommitEdit (acc);
-    qof_instance_set (QOF_INSTANCE (fixture->book),
-		      "default-gain-loss-account-guid", qof_entity_get_guid(QOF_INSTANCE(acc)),
-		      NULL);
-    cur = gnc_book_get_book_currency_name( fixture-> book );
-    g_assert_cmpstr( cur, == , "GBP" );
-    pol = gnc_book_get_default_gains_policy( fixture-> book );
-    g_assert_cmpstr( pol, == , "fifo" );
-    acct = gnc_book_get_default_gain_loss_acct ( fixture-> book );
-    g_assert (acct == NULL );
-    g_assert( gnc_book_use_book_currency ( fixture-> book ));
-    qof_book_commit_edit (fixture->book);
-
-    qof_book_destroy( fixture->book );
-    fixture->book = qof_book_new();
-
-   g_test_message( "Testing with book-currency, default-gains-policy and default-gain-loss-account-guid set to valid values and no trading accounts flag" );
-    qof_book_begin_edit (fixture->book);
-    qof_instance_set (QOF_INSTANCE (fixture->book),
-		      "book-currency", "USD",
-		      NULL);
-    qof_instance_set (QOF_INSTANCE (fixture->book),
-		      "default-gains-policy", "fifo",
-		      NULL);
-    acc = get_random_account( fixture-> book );
-    xaccAccountBeginEdit (acc);
-    xaccAccountSetType (acc, ACCT_TYPE_INCOME);
-    xaccAccountSetCommodity (acc, com);
-    xaccAccountSetPlaceholder (acc, FALSE);
-    xaccAccountSetHidden (acc, FALSE);
-    xaccAccountCommitEdit (acc);
     qof_instance_set (QOF_INSTANCE (fixture->book),
 		      "default-gain-loss-account-guid", qof_entity_get_guid(QOF_INSTANCE(acc)),
 		      NULL);



Summary of changes:
 src/app-utils/test/test-gnc-ui-util.c | 131 +---------------------------------
 1 file changed, 1 insertion(+), 130 deletions(-)



More information about the gnucash-changes mailing list