Commit Graph

38 Commits

Author SHA1 Message Date
Marco Scardovi
6fe2028bca
Fix test
Signed-off-by: Marco Scardovi <mscardovi@icloud.com>
2022-11-24 23:20:07 +01:00
Christopher Lam
d82bb7b8a2 [Transaction.c] use is_unset static to denote uncached readonly_reason
tests in 128c8d6f88
2021-09-26 09:40:32 +08:00
jean
4e9fe0a4d1 Add missing function to mock account 2021-09-05 17:52:34 -07:00
Dong Lin
75209c024f Update price database for imported transactions
When a transaction is added from the ledger, price database is updated properly.
But if the transaction is imported, there is no price db update.

This change adds the proper pricedb update in the import path (qfx/ofx/qif).
Tested with make check
2021-03-09 10:39:56 -08:00
John Ralls
2ff3bf5877 Echo into CMakeLists.txt rename of gmock-qofqury to fake-qofquery. 2020-12-13 11:52:32 -08:00
John Ralls
e09a26ba3a Merge Christian Gruber's 'test_import_backend' into maint. 2020-11-08 14:27:26 -08:00
Christian Gruber
6394b6491b fixup! Simplify type checking for GObject mockups 2020-10-05 22:48:52 +02:00
Christian Gruber
feba64624c Fix xaccTransSetNotes()
This is a bugfix for commit 954ce9577f
2020-10-05 22:20:02 +02:00
Christian Gruber
e44cf9c61f Add missing C linkage statements 2020-09-23 19:59:40 +02:00
Christian Gruber
63969e8628 Remove unecessary include 2020-09-22 22:52:37 +02:00
Christian Gruber
d673c32e35 Mock methods should not neccessarily return mock objects 2020-09-22 22:52:37 +02:00
Christian Gruber
0e634c5446 Relax runtime type checks
Runtime type checks should only check for the mock up type, if
neccessary. If objects of another class than the mocked object itself
are processed, runtime type check should only check for the base-class
type. It should be possible to use mockup objects and non-mockup objects
within the same application.

The included headers are adapted accordingly.
2020-09-22 22:52:37 +02:00
Christian Gruber
99256c385b Add missing _get_type() functions of all mocked GObject classes
If a GObject is replaced by a mock up, its _get_type() function has to
be replaced as well. The replaced _get_type() functions have to return
the type of the mock up now.
2020-09-22 22:07:21 +02:00
Christian Gruber
833edd0b29 Add missing comment 2020-09-21 00:50:24 +02:00
Christian Gruber
bc80bbb325 Simplify type checking for GObject mockups
A type conversion function is introduced for each GObject mockup. This
function does a runtime type check and generates a GoogleTest failure in
case of any type error. This avoids checking GObject type twice.
2020-09-21 00:47:53 +02:00
Christian Gruber
b0906b5e2a Use MOCK_CONST_METHODn() macro instead of MOCK_METHODn() macro if necessary 2020-09-20 23:36:34 +02:00
Christian Gruber
5408854c28 Rename GObject type names of mock classes
According to a remark in PR #738 the lower case type name is changed.
Underscores should only be used between namespace and type name and
between type name and suffixes.
2020-09-20 22:33:51 +02:00
Christian Gruber
41c147a918 Use /* ... */ for multi-line comments 2020-08-24 23:31:08 +02:00
Christian Gruber
df6621f2b5 Add doxygen documentation to QofFakeQuery and QofFakeQueryPool 2020-08-24 23:13:23 +02:00
jean
a9f79cf79c Add a flag to the account structure to defer balance computation 2020-08-01 21:10:19 -07:00
Christian Gruber
861a2482fe Add a comment on using empty ctor for mock classes derived from GObjects 2020-07-10 23:03:01 +02:00
Christian Gruber
3d92d53917 Rename all class methods using snake_case instead of camelCase 2020-07-09 22:03:05 +02:00
Christian Gruber
1fa90a5429 Cleanup some comments 2020-07-09 22:00:18 +02:00
Christian Gruber
1e2236afdc Use typed queries 2020-07-09 22:00:18 +02:00
Christian Gruber
fa82a8bcce Replace query factory by a query pool
Query factory was implemented using a public global variable
qof_query_factory.

Furthermore a query pool is easier to handle than a factory, since the
whole management can be hidden from the user.
2020-07-09 22:00:14 +02:00
Christian Gruber
2639cdefdf Remove unnecessary inclusion of qofquery-p.h 2020-07-09 21:58:48 +02:00
Christian Gruber
841111e37e Rename class QofMockQuery to QofFakeQuery 2020-07-09 21:58:48 +02:00
Christian Gruber
bbfc30d70b Rename gmock-qofquery to fake-qofquery 2020-07-09 21:58:48 +02:00
Christian Gruber
8ac640d5fa Fix typo 2020-06-15 22:57:13 +02:00
Christian Gruber
610bbda23f Add glib-object.h to includes 2020-06-15 22:57:13 +02:00
Christian Gruber
53c294f9e8 Remove unnecessary type check 2020-06-15 22:57:13 +02:00
Christian Gruber
bb0088c43c Replace g_return_if_fail() and g_return_val_if_fail() by ASSERT_TRUE and EXPECT_TRUE 2020-06-15 22:57:13 +02:00
Christian Gruber
967cf0b430 Pass std::vector arguments by reference instead of by value 2020-06-15 22:57:12 +02:00
Christian Gruber
d084279891 State comment on unused GObject instance init function more precisely 2020-06-15 22:57:12 +02:00
Christian Gruber
67f63053fb Remove todo comments on replacement of std::vector by std::list
Replacing std::vector by std::list wouldn't have any advantage
2020-06-15 22:57:12 +02:00
Christian Gruber
a9d85e8f8e Use std::vector of const char* instead of std::string where meaningful
This avoids additional string allocation
2020-06-15 22:57:12 +02:00
Geert Janssens
a124e647db Add files omitted in previous commit 2020-05-29 17:35:04 +02:00
John Ralls
f2a13ecac7 Merge Christian Gruber's 'test_import_backend' into master. 2020-05-21 12:39:57 -07:00