Skip to content

Commit

Permalink
[utest-Account] add more balance limit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed Jun 24, 2024
1 parent 43bda21 commit a6463f9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions libgnucash/engine/test/utest-Account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,16 @@ test_gnc_account_kvp_setters_getters (Fixture *fixture, gconstpointer pData)

xaccAccountSetIncludeSubAccountBalances (account, false);

// try setting invalid numbers: these are ignored
xaccAccountSetHigherBalanceLimit (account, gnc_numeric_create (1, 0));
xaccAccountSetLowerBalanceLimit (account, gnc_numeric_create (0, 0));

g_assert_true (xaccAccountGetHigherBalanceLimit (account, &balance_limit) == true);
g_assert_cmpint (gnc_numeric_compare (h_balance, balance_limit), ==, 0);

g_assert_true (xaccAccountGetLowerBalanceLimit (account, &balance_limit) == true);
g_assert_cmpint (gnc_numeric_compare (l_balance, balance_limit), ==, 0);

xaccAccountClearHigherBalanceLimit (account);
xaccAccountClearLowerBalanceLimit (account);

Expand Down

0 comments on commit a6463f9

Please sign in to comment.