Christopher Lam
c8a53c54f2
[account.cpp] refactor gnc_account_get_map_entry
...
Have comprehensive tests in a5d101d1b
2021-09-19 11:28:25 +08:00
Christopher Lam
4309469730
[utest-Account] test old dxaccAccount* functions
...
dxaccAccountGetPriceSrc and dxaccAccountGetQuoteTZ.
DxaccAccountSetCurrency remains untested - unsure how to retrieve an
ISO4217 currency to use as parameter.
2021-09-19 11:27:03 +08:00
Christopher Lam
a5d101d1be
[utest-Account] test gnc_account_get_map_entry
2021-09-15 21:09:01 +08:00
Christopher Lam
aa0668f9e6
Revert "[account.cpp] deprecate old dxacc* functions"
...
This reverts commit d290c3c45d
. These
functions are not deprecated after all.
2021-09-15 21:09:00 +08:00
Christopher Lam
d290c3c45d
[account.cpp] deprecate old dxacc* functions
2021-09-15 09:20:04 +08:00
Christopher Lam
374443747d
[account.cpp] new static: get/set_kvp_string_path
...
exactly the same as set_kvp_string_tag but will accept the full kvp
path.
2021-09-15 09:19:17 +08:00
John Ralls
824b515430
Fix qoflog's comments to reflect a preference for the macros over GLib functions.
2021-09-14 15:59:01 -07:00
John Ralls
74d0630867
Bug 798237 - Logging during XML file loading degrades performance...
...
significantly
Modify the DEBUG and PINFO macros to return unless qof_log_check is
true. Replace almost all direct calls to g_debug and g_message with
DEBUG and PINFO respectively.
Track the highest logging level sent to qof_log_set_level to provide a
short-circuit return in qof_log_check. Remove setting GNC_MOD_TESTS to
QOF_LOG_DEBUG so that the short-circuit threshold isn't defeated by
always being DEBUG.
Net result: 33% improvement in xml load times.
2021-09-14 15:15:11 -07:00
Christopher Lam
15852031d4
[utest-account.cpp] increase test coverage
...
adds getter/setter tests for
xaccAccountSetLastNum
xaccAccountSetTaxUSCode
xaccAccountSetTaxUSPayerNameSource
2021-09-14 07:12:15 +08:00
John Ralls
8ab8642e76
Fix leak of trading_splits list in xaccTransClearTradingSplits
2021-09-09 16:32:43 -07:00
John Ralls
1387d5f960
Fix unchecked ptr dereference.
...
First crash in Bug 798225.
2021-09-09 16:32:43 -07:00
John Ralls
ab24c34660
Merge Simon Arlott's 'free-template-root' into maint.
2021-09-07 12:14:41 -07:00
Simon Arlott
4a8acf3fb2
Free template root accounts on book end
...
The template root should be unset so that it's destroyed when the book is
ending. This is required to free all the template accounts and referenced
strings.
The scheduled transactions themselves need to be freed first so reverse
the order that SXRegister and gnc_sxtt_register are called in
cashobjects_register: The list resulting from that function is traversed
from the bottom up.
2021-09-07 12:11:05 -07:00
John Ralls
079a900300
Bug 798298 - Re-imported transactions no longer ignored
...
Merges Jean Laroche's '798298_reimport_ofx' into maint.
2021-09-06 13:51:26 -07:00
Mike Alexander
068a5d2fa8
Fix xaccSplitGetOtherSplit which was broken by 028bf9826
, don't
...
count splits that aren't really in the transaction.
The rewrite left out one test. This was most obvious in the dummy
transaction used to enter a new transaction into an account.
xaccSplitGetOtherSplit never returned an "other split" for this
transaction. It turns out the old code was broken too, but
it worked for this case by coincidence.
2021-09-06 02:45:37 -04:00
jean
4e9fe0a4d1
Add missing function to mock account
2021-09-05 17:52:34 -07:00
Christopher Lam
1eb6709331
[test-lots.cpp] add kvp getter/setter changes
2021-08-31 23:16:43 +08:00
Christopher Lam
323182c9f7
[utest-Account.cpp] add kvp getter/setter changes
2021-08-31 23:16:43 +08:00
Christopher Lam
8a37c4c019
[utest-Invoice.c] add kvp getter/setter tests
2021-08-31 23:16:43 +08:00
Christopher Lam
9ec670f828
[test-commodities.cpp] add kvp setter/getter test
2021-08-31 23:16:42 +08:00
Christopher Lam
d4c8b36f9f
[utest-Transaction.cpp] add kvp setter/getter tests
...
wasn't tested before
2021-08-31 23:16:42 +08:00
Christopher Lam
c3b50f0b58
[gnc-lot.c] fix - cache value properly
2021-08-31 23:16:42 +08:00
Christopher Lam
595e126a34
[account.cpp] modify set_kvp_string_tag to accept strstrip or nullptr
...
- will remove a second call to g_strstrip (g_strdup (str))
2021-08-31 23:16:42 +08:00
Christopher Lam
c5a6383b43
[account.cpp] fix - incomplete #1117
...
- init struct members properly to: is_unset and TriState::Unset
- test acct kvp "equity-type" for "opening-balance" instead of "true"
- cached account->color/sort_order/notes/filter gets strstripped
similarly to previous behavior
2021-08-31 23:16:42 +08:00
Christopher Lam
001b34616f
[Transaction.c] GValue string must be unset
2021-08-29 15:38:16 +08:00
Christopher Lam
a47bee97d6
[Split.c] GValue string must be unset
2021-08-29 15:38:16 +08:00
Christopher Lam
0ecbcb4ef1
[gnc-lot.c] GValue string must be unset
2021-08-29 15:38:16 +08:00
Christopher Lam
ac2afc7e13
[gncInvoice.c] GValue string must be unset
2021-08-29 15:38:16 +08:00
Christopher Lam
3bf49ed8d7
[Account.cpp] GValue string must be unset
2021-08-29 15:38:16 +08:00
Christopher Lam
e3af2f22f9
[gnc-commodity.c] cache user_symbol into commodity struct
...
Continuation of ff2ceb111
which introduced issue whereby user_symbol
returned could become stale, leading to invalid read fixed with
c398bef59
. There are likely other user_symbol pointers becoming stale
without this commit.
This change will save the user_symbol into the commodity struct,
avoids gchar* becoming stale.
2021-08-29 15:38:16 +08:00
John Ralls
57f73d70c7
Merge Yordan Miladinov's denom_lcd into maint.
2021-08-27 12:34:07 -07:00
Christopher Lam
c55ab50349
[gnc-budget.c] gnc_budget_get_account_period_note to be freed by the caller
2021-08-24 23:02:15 +08:00
Yordan Miladinov
6cb509ea7d
fix an uncaught exception: denom_lcd may throw an overflow exception if casting lcm to int64_t fails
2021-08-24 00:58:31 +03:00
Christopher Lam
7e41efc232
Merge branch 'maint-speedup-and-leaks' into maint #1109
...
Speedup xaccSplitGetOtherSplit
2021-08-20 21:23:35 +08:00
Christopher Lam
ff2ceb111d
[gnc-commodity] GValue must be unset
2021-08-20 17:02:58 +08:00
Christopher Lam
028bf9826b
[Split] xaccSplitGetOtherSplit don't test book trading-accts
...
don't test trading-acct property when finding other split.
2021-08-17 13:04:34 +08:00
Christopher Lam
6bf5a618de
qof_instance_get gchar* must be freed
...
A call to qof_instance_get expecting a gchar* receives a newly
allocated string which must be freed.
2021-08-15 09:49:06 +08:00
Christopher Lam
e4d808e674
[qofbook] qof_book_use_split_action_for_num_field: free a char*
...
qof_instance_get allocates a new char* which must be freed.
2021-08-13 08:58:07 +08:00
Christopher Lam
40d886fa9d
gnc_account_list_name_violations elements must be freed
2021-08-12 09:39:08 +08:00
Christopher Lam
4c37f6d4ef
[account.cpp] gnc_g_list_stringjoin instead of repeated allocations
2021-08-12 09:19:34 +08:00
Christopher Lam
bedc85afa3
Merge branch 'maint-leaks' into maint #1101
2021-08-06 19:30:01 +08:00
Christopher Lam
0420ae6a66
[account.cpp] refactor gnc_account_list_name_violations
2021-08-06 17:31:36 +08:00
Christopher Lam
67bd513514
[account.cpp] rewrite gnc_account_foreach_descendant_until in C++
2021-08-06 17:31:36 +08:00
Christopher Lam
17953441cb
[account.cpp] refactor gnc_account_foreach_descendant
2021-08-06 17:31:36 +08:00
Christopher Lam
5698b67bf5
[account.cpp] refactor gnc_account_lookup_by_code
2021-08-06 17:31:36 +08:00
Christopher Lam
09e2e7613c
[account.cpp] refactor gnc_account_lookup_by_name
2021-08-06 17:31:36 +08:00
Christopher Lam
bebc366e88
[account.cpp] refactor gnc_account_n_descendants
2021-08-06 17:31:35 +08:00
John Ralls
f0926d66c1
Merge Simon Arlott's 'qof-instance-dispose' into maint.
2021-08-05 11:45:14 -07:00
Christopher Lam
e6c33a39bc
[account.cpp] refactor gnc_account_get_descendants{_sorted}
2021-08-06 00:23:12 +08:00
Christopher Lam
d2db43019c
[account.cpp] internal function account_foreach_descendant
...
fast and efficient
2021-08-06 00:23:12 +08:00