John Ralls
df878c6a3d
Merge Maarten Bosmans's 'memleak-fixes' into stable.
3 years ago
Maarten Bosmans
6be682b645
Store allocated temporaries in a variable so they can be freed
...
If a function that returns an allocated pointer is passed directly into
something that does not take ownership of the pointer, the allocation is
leaked. This can be fixed by assigning the pointer to a new variable
and freeing it after operation on the memory.
3 years ago
John Ralls
8481f062d4
Create obsolete features list with first member book_currency.
...
Obsolete features set in the book will be removed from the book's
KVP and ignored. Note the warning in the comment!
3 years ago
Maarten Bosmans
0d86be6d2a
[test] Properly destroy resources on end of tests
...
This fixes memory leaks that are only present in testing code.
Not very useful on itself, but it does make it easier to fix memory
leaks and other AddressSanitizer problems in actual gnucash code later.
3 years ago
Maarten Bosmans
ed3fe00880
[test] Use test fixture to initialize and destroy resources
3 years ago
Maarten Bosmans
35aeed45ec
[engine] Remove two replace functions from KvpValue
...
These were not used outside a test.
And that test was not leak free, as a result of the functions not doing
what they are supposed to do when the current value is not of the type
that is expected. (NULL is returned, but the value is not replaced)
3 years ago
John Ralls
83829e6513
Merge branch 'maint'
3 years ago
John Ralls
1020bde89c
Fix crashes in test-engine on Arch Linux.
...
Root cause is mutating a list while it's iterating. We're able to
protect it in two cases, have to copy it in xaccTransScrubGainsDate.
3 years ago
John Ralls
f735c64cac
Merge Richard Cohen's 'extern-c-part2' into master.
3 years ago
Richard Cohen
7b47c07f8e
Don't use extern "C" around #includes
...
Some I missed the first time. Some are new.
3 years ago
John Ralls
bbfa378783
Don't crash and do pass tests.
3 years ago
Richard Cohen
9f06859390
Remove references to old boost versions
...
we already require 1.67
3 years ago
Richard Cohen
bddb4468fa
Import GLIB2 as a target, and use it to simplify the CMakeLists
3 years ago
Robert Fewell
ec7cc27d6d
Add tests for default invoice report book property
3 years ago
Richard Cohen
9c6ad222a9
[-Wunused-function] - remove
3 years ago
Richard Cohen
d4dfe4e279
[-Wunused-local-typedef] - remove
...
libgnucash/engine/test/utest-Account.cpp:2414:11: warning: typedef ‘using AcctTypeType = struct std::underlying_type<GNCAccountType>’ locally defined but not used [-Wunused-local-typedefs]
2414 | using AcctTypeType = std::underlying_type<GNCAccountType>;
| ^~~~~~~~~~~~
3 years ago
Richard Cohen
78ec20515b
Remove some unused variables - and the initialization
...
- checked that any side effects were irrelevant
3 years ago
Richard Cohen
c819b03a17
Remove some unused variables - leave the side effect
3 years ago
Richard Cohen
ea2d3be217
Remove some unused variables with obviously no side effects
3 years ago
Geert Janssens
99506d331a
Reduce GncImportMatchMap to just the account
...
There is no added value in storing the book and account together
The book is easily retrieved from the account (as was
illustrated in the gnc_account_imap_new function).
I looked through the commit history to understand why this struct
was originally created and a long time ago it also had
a reference to a kvp frame.
3 years ago
John Ralls
f6919e60a7
Merge Richard Cohen's 'cleanup' into master.
3 years ago
Richard Cohen
6927535a0a
Remove unused test function get_object_is_initialized in qofobject.cpp
3 years ago
Richard Cohen
e83c91050c
Remove unneeded dummy.cpp
3 years ago
John Ralls
046e4a156e
Silence Clang deprecation warnings about sprintf.
3 years ago
Richard Cohen
1cec0cb3f3
Use internal extern "C" { ... } for C++
...
- removes warnings compiling swig engine
...
[ 10%] Generating swig-engine.cpp
.../libgnucash/engine/engine-helpers.h:31: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gnc-date.h:83: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/qofquery.h:90: Warning 302: Identifier 'QofQuery' redefined (ignored),
.../libgnucash/engine/gnc-option.hpp:55: Warning 302: previous definition of 'QofQuery'.
.../libgnucash/engine/gnc-commodity.h:56: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gncBusiness.h:40: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gncEntry.h:37: Warning 313: Unrecognized extern type "C++".
3 years ago
Richard Cohen
19bbde7000
Fix some typos
3 years ago
Christopher Lam
fd007a0af1
Merge branch 'maint'
3 years ago
Robert Fewell
6df866f876
Add tests for the reconcile account functions
3 years ago
John Ralls
fb9947b7b6
Rename GncDateTime's ymd to gnc_ymd to avoid a name conflict with Carbon.
3 years ago
Robert Fewell
3be25ff0a9
Add some tests for the account functions
3 years ago
Christopher Lam
bfc325f63c
Merge branch 'maint'
3 years ago
Christopher Lam
3d8a28898d
[gnc-budget] gnc_budget_get_account_period_note returns a const
...
to harmonize with all other char getters
3 years ago
Christopher Lam
3e5fcc8709
Merge branch 'maint'
3 years ago
Christopher Lam
6f80c548e6
[gtest-qofevent.cpp] comprehensive tests for qofevent
3 years ago
Christopher Lam
b87aa004f9
[test-qofbook] add tests for unknown features
...
tests that gnc_features_test_unknown returns a suitable error message
3 years ago
Christopher Lam
fc94b41c81
Merge branch 'maint'
3 years ago
Christopher Lam
4716af24e4
Merge branch 'maint'
3 years ago
Christopher Lam
f2354d6b2a
[test-qofbook.c] add test for gnc_features_set_unused
3 years ago
John Ralls
cf088f2a70
Merge John Ralls's 'Bug798614' into maint.
3 years ago
Christopher Lam
6f6d2fef48
[test-qofbook] basic features test
...
sets a feature and tests it's set. it's impossible to design a book
with unknown features using the API.
3 years ago
John Ralls
d8417c3cfa
Move gnc-euro.[ch] to engine and unit test it.
4 years ago
John Ralls
3949821da6
Merge branch 'maint'
4 years ago
John Ralls
2505955ab9
Fix test failure from Bug 798616 fix.
4 years ago
Christopher Lam
161b07b241
Merge branch 'maint'
4 years ago
luz paz
ba94730a23
Fix various typos
...
Found via `codespell`
4 years ago
John Ralls
95361ad060
[options] Move gnc-options test to engine/test/CMakeLists.txt.
4 years ago
John Ralls
4ae17d12c7
[options] Move options from app-utils to engine.
...
Options is required for book options that are stored as part of the data
file and so belongs in engine.
4 years ago
Christopher Lam
0b5a4cd298
Merge branch 'maint'
4 years ago
Christopher Lam
ec3e996f92
tests xaccTransGetTxnType heuristics
...
tests TXN_TYPE_NONE in utest-Transaction.c
testing TXN_TYPE_INVOICE, TXN_TYPE_PAYMENT, and TXN_TYPE_LINK will
require valid posted invoices, so, are best tested in utest-Invoice.c
4 years ago
Christopher Lam
fd12d3900c
[Transaction.c] use heuristics to determine txn->txn_type
4 years ago