Christopher Lam
2e3fd090ff
[gnc-autoclear.cpp] restore abort explanation message
4 months ago
Christopher Lam
e4d61b3073
[test-autoclear] add some more tests
...
- worst case scenario 2^N amounts with 2^N theoretical paths
- amounts with mixed signs
- off-by-1 target amounts
- amounts include zero
5 months ago
Christopher Lam
03af620442
[gnc-autoclear] upgrade - improve Subset Sum Problem
...
- still O(2^n) runtime but uses O(n) stack size, and *much* less memory
- a runtime monitor, limiting time (default 1s)
5 months ago
John Ralls
54664359dc
Fix building tests on Win32.
...
They don't pass, but at least they build and sort of run.
8 months ago
John Ralls
71939be5fa
[test gnc-quotes] Allow quote time and now time to differ slightly.
...
Prevents the occasional spurious test failure.
10 months ago
John Ralls
3770cb8131
Wrap include of gtest.h and gmock.h with a warning-silencing pragma.
...
See https://github.com/google/googletest/issues/4701
The warnings cause the Arch Linux CI to fail because of -Werror.
11 months ago
David Seifert
c06bc18dc4
Add missing `#include <cstdint>`
...
* GCC 15 has reduced transitive dependencies between headers.
Bug: https://bugs.gentoo.org/939856
1 year ago
John Ralls
6aeca0040e
Bug 799419 - Intermittent quote price issue
...
Track quote source in Finance::Quote return json so that duplicate symbols in
different namespaces can be kept separate.
2 years ago
Christopher Lam
47791734bb
[SX-ttinfo.cpp] tidier, using c++ stl and algo
2 years ago
Christopher Lam
6c7abb487d
[SX-ttinfo.hpp] convert to c++ header
2 years ago
Christopher Lam
346499ae04
[gnc-commodity.cpp] gnc_quote_source_set_fq_installed takes a StrVec
...
instead of a GList* of strdup'd chars
2 years ago
Christopher Lam
a81bc72fb1
[test-sx] plug some leaks
3 years ago
Christopher Lam
94211c2e57
[test-sx] plug some leaks
3 years ago
Christopher Lam
14622e7db6
[test-print-parse-amount] plug leaks
3 years ago
John Ralls
583446ade5
Merge Richard Cohen's 'declare-type-app-utils' into stable.
3 years ago
John Ralls
c405ba2cc0
Merge Richard Cohen's 'filter-online-test' into stable.
3 years ago
John Ralls
6b1941f0ed
Replace yahoo_json with alphavantage in test-gnc-quotes.
...
Alas, poor yahoo_json. After months of valiant struggle to keep up
with Yahoo!'s moving their API around the Finance::Quote team has
abandoned it, replacing it with a screen saver. Those tend to be
unstable so use alphavantage for testing.
3 years ago
John Ralls
a4e651ebc6
Fix test-gnc-quotes.
...
Forgot to change the test's date-time to neutral time.
3 years ago
Richard Cohen
9713683ee3
Refactor: define and use api for GncSxInstanceModel
3 years ago
Richard Cohen
b3e3eb3166
By default, filter out online_wiggle in test-gnc-quotes
...
The test relies on a lot of external dependencies
- installed finance-quote-wrapper
- alpha vantage key
- network
- working remote server
Running ./bin/test-gnc-quotes from the command line
will still include online_wiggle
3 years ago
Maarten Bosmans
71802b5627
[test] Fix memory leak in test-gnc-quotes
...
When the commodity table is registered, the current book will get
a default table assigned. When later setting the table explicitly
using qof_book_set_data() the exisiting table gets overwritten and
is thus leaked.
There is no way of removing or freeing a currency table from a book,
so the best we can do here is to set our own table on the book before
calling gnc_commodity_table_register().
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
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
Richard Cohen
78ec20515b
Remove some unused variables - and the initialization
...
- checked that any side effects were irrelevant
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
John Ralls
7f2a09a69f
[price-quotes] Handle short error strings from finance-quote-wrapper.
...
This keeps the translation work in GnuCash and improves the error
signalling in gnc-quotes.
4 years ago
John Ralls
70c9d4c9e3
[price-quotes] Fix version retrieval.
...
Plus there's no need for a "not found" version string because GncQuotes
construction will throw if Finance::Quote isn't correctly installed. No
object, nothing to call version() on.
4 years ago
John Ralls
97e730b8d8
[price-quotes] Reformat test quote response strings to one line per quote.
4 years ago
John Ralls
d97ea77762
[price quotes] Add report member function to display quote information to stdout.
...
Instead of creating price instances in the database.
4 years ago
John Ralls
4c47e91180
[price-quotes] Implement error codes for currency and quote failures.
4 years ago
John Ralls
29ce925646
[price-quotes] Test the other fetch overloads and quote values.
4 years ago
John Ralls
734fb6ce2a
[price-quotes] Switch error handling to exceptions.
...
Allows for cleaner code with less state, less coupling of the GncQuotes
class, and better transfer of error messages to client code.
Also translates some error messages for presentation to users.
4 years ago
John Ralls
d307295076
[price-quotes] Paramaterize GncMockQuoteSource construction.
...
So we can have different results passed back for different tests.
4 years ago
John Ralls
b8642e55d9
[price-quotes] Implement mock quote source.
...
Note that because the non-default constructor exists only on GncQuotesImpl
we must use that directly and violate the pimpl.
4 years ago
John Ralls
4dd3922871
[price-quotes] Make wiggle test conditional on F::Q being installed.
4 years ago
John Ralls
e9577b7996
[price-quotes] Basic wiggle test.
4 years ago
John Ralls
283a5b7ce9
Fix dist, files moved
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
3e02859277
Merge branch 'maint'
4 years ago
John Ralls
410db42df0
Test case where the template txn doesn't have a set currency.
4 years ago
John Ralls
229f6f5e85
Fix gdate adjustments.
4 years ago
Simon Arlott
4c1fc1d555
Bug 798262 - Add test case for basic scheduled transactions
...
Test these scheduled transactions:
* 2 splits with fixed amounts "123"
* 2 splits with fixed amounts "0"
* 2 splits with empty amounts ""
Verify that automatically created scheduled transactions exist.
4 years ago
John Ralls
cf2870b71a
[options] Change RelativeDate and Multichoice index type to uint16_t.
...
From size_t because clang thinks that std::is_same_v<size_t, time64> is
true and we need to differentiate the handling of the two.
4 years ago
John Ralls
0b2d14ee72
Fix distribution for expressions target.
4 years ago
John Ralls
f4c27d4494
Move gnc_ui_account_get_tax_info_string to gnc-locale-tax.c
...
To prevent a circular dependency between libgnc-app-utils and
libgnucash-guile.
4 years ago
John Ralls
3e2f7bc66a
Create separate shared library for expression parser and SX instance model.
...
These functions depend on both libgnc-app-utils and libgnucash-guile,
creating a circular dependency when the app-utils bindings are added to
libgnucash-guile.
4 years ago
John Ralls
47904a858e
Fix distcheck in master.
...
Several gnc-optiondb dependencies left out of tarball.
4 years ago
John Ralls
1a186b953e
[C++options] Correct handling of multichoice scheme option types.
...
Includes tests for save-to-scheme for each type.
4 years ago