Commit Graph

19076 Commits

Author SHA1 Message Date
lmat
d9eebd332b Renaming functions to get rid of temporary name
_var_ was used to make sure I caught all references, but isn't intended
as a permanent name.
2017-12-21 07:39:33 -05:00
lmat
5636afc4a2 Kvp no longer parses entries looking for delimiters 2017-12-21 07:39:32 -05:00
lmat
2cda65e012 Added test for and corrected get_bayes_info 2017-12-21 07:39:32 -05:00
lmat
9d7ec35ce5 Removed qof_instance_set_kvp, qof_instance_get_kvp
And replaced them with versions that take lists of key path elements.
This is in an effort to eliminate the parsing of kvp keys.
2017-12-21 07:39:32 -05:00
lmat
eb6dad86e3 Fixed conversion problem
The conversion assumed there were only three levels to bayes import
map kvp: IMAP token, user-supplied token, GUID/account name. In
actuality, since user-supplied tokens could have the delimiter in them,
there could be several. This fix takes that into account like so:
IMAP token, potentially several user-supplied tokens, GUID/account name.

The import map is undergoing two conversions at the same time: account names
to guids and an hierarchical representation to a flat representation in KVP.
2017-12-21 07:39:32 -05:00
lmat
b3667c76fc Implement flat bayes kvp
The bayes data are stored in the KVP store. Before this commit, they are
stored under /import-map-bayes/<token>/<account guid>/count (where count
is the datum that "matters" in bayes matching).

The problem with this is that any token including the kvp delimiter
(currently '/') gets divided, and is not found correctly during bayes
kvp searching. The quickest solution to this is to replace all "/"
characters with some other character. That has been done, along with a
re-structuring of the bayes matching code to take advantage of c++
features to make the code more concise and readable.

Also modified some test functions to fix leaks and double-frees: the
same kvp value can't be in the kvp tree twice.

Also, when I added code to clean up after the tests, some things started
breaking due to double-delete. Apparently const_cast was hiding some
programming errors. Really? You don't say? When giving a GUID* to KvpValue,
the latter takes ownership of the former.
2017-12-21 07:39:32 -05:00
lmat
08aa0104ef Change kvp string representation
The nested representation was very noisy. Now, the string representation
shows one line per value with the full prefix which is also more
expressive than the old version.
2017-12-21 07:39:32 -05:00
lmat
34e0d6cfa0 kvp frame to template and correcting failure macro
The template avoids the need to cast to and from void*, and adds flexibility to
the targeted function's signature.

test-stuff.h defines a macro, "failure" which is used as an identifier
in the standard IO library, so I moved any inclusion of test-stuff.h to
the last include position so that "failure" wouldn't be defined before
the IO library was included.
2017-12-21 07:39:32 -05:00
lmat
eb6c741bf9 Account.c to Account.cpp
Since Account.c is now Account.cpp, the function signatures look a bit
different internally. The tests rely on function signatures in error
messages. Instead of trying to figure out what the exact
function signature might be, I use a substring matching strategy to
ensure that the correct error was issued.
2017-12-21 07:39:32 -05:00
Geert Janssens
318f7ebc4f Force build order on report system support files
Guile 2.2 is more picky about this than guile 2.0 was.
2017-12-20 14:55:40 +01:00
Geert Janssens
723b51a06d Add unit test for rewritten scheme error handlers 2017-12-20 14:55:40 +01:00
Geert Janssens
3d910ad2b1 Drop guile 1.8 support
And with it all quirks we still had in the code to support that version.
2017-12-20 14:55:40 +01:00
Geert Janssens
a784dd5784 Add support for guile 2.2 2017-12-20 14:55:40 +01:00
John Ralls
a28bcdf19b Merge Chris Lam's Bug 790526 fix into maint. 2017-12-19 22:04:18 -08:00
christopherlam
a847d441f1
fix silly mistake 2017-12-20 11:57:35 +08:00
christopherlam
9af6f184ef
fix unit test again 2017-12-20 10:01:32 +08:00
John Ralls
302d1e73e8 Add test-date-utilities to CMakeLists.txt and Makefile.am. 2017-12-19 17:47:07 -08:00
John Ralls
98fcf1b08e Fix duplicate test-case name. 2017-12-19 16:54:01 -08:00
christopherlam
3f408a885b
typo 2017-12-20 08:15:26 +08:00
christopherlam
b6ec61fa45
add unittest for bugzilla 790526 2017-12-20 07:58:03 +08:00
christopherlam
76921b5e28 Fix -DWITH_SQL=OFF Build. 2017-12-19 15:40:33 -08:00
Robert Fewell
0186bc1c0c Change the relative path to a full one for rpath 2017-12-19 15:40:33 -08:00
John Ralls
7c57ad18cd Fix date offset error in datetime test. 2017-12-19 14:34:10 -08:00
John Ralls
baad2097a7 Add tests for GMT and GMT+7 timezones. 2017-12-18 10:15:05 -08:00
John Ralls
5af21dfad8 Fix timezone constructor crash when zone file has no transitions. 2017-12-18 09:48:17 -08:00
John Ralls
0026b10851 Merge branch 'maint' into unstable 2017-12-17 13:00:00 -08:00
John Ralls
c1b5e6c8df Release 2.6.19 2017-12-16 15:28:56 -08:00
John Ralls
70fe66c9fd Fix python tests when building from tarball. 2017-12-16 15:11:14 -08:00
John Ralls
5da9e2f4c9 Update Dutch and Serbian translations from the Translation project. 2017-12-16 11:28:24 -08:00
John Ralls
8efc0e7bdc Merge Rob Gowin's Partial Fix for Bug 787497 into maint. 2017-12-16 10:54:03 -08:00
John Ralls
51fab91ffe Add test-flat-bayes to autotools build. 2017-12-16 10:38:07 -08:00
John Ralls
4ce47b898d Add minimum version to feature and fix copy-paste error in test-flat-bayes.
As recommended by Geert Janssens.
2017-12-16 10:35:07 -08:00
John Ralls
e1d3385428 Handle mid-pacific timezones in date-sensitive tests. 2017-12-15 10:13:41 -08:00
John Ralls
ac0d335c4f Revert post-construction adjustment of ldt for DST.
It was incorrect.\nMake corresponding adjustment to far eastern offset in neutral time adjustment.
2017-12-15 10:12:01 -08:00
Robert Fewell
5aa84e13d6 Change the way the import settings are handled 2017-12-14 20:37:12 +00:00
John Ralls
a5134f91e1 Fix neutral time for consistent dates in mid-pacific time zones.
Echoes a change made some time ago in 2.6 where the time is adjusted from 10:59Z in time zones where that won't be the same date.
2017-12-12 21:02:11 -08:00
John Ralls
aeb2e65ff1 Fix posted-date scrub incrementing the day in central pacific timezones. 2017-12-12 21:02:11 -08:00
John Ralls
1c8c53a861 Remove (unused because of an error) parse-to-tm string timespec construction. 2017-12-12 21:02:11 -08:00
John Ralls
6db0820771 Fix offset handling in GncDateTime struct tm ctor, gnc_mktime, & gnc_timegm.
Tests now pass in all TZa from Honolulu to New Zealand.
2017-12-12 21:02:11 -08:00
Geert Janssens
de4d1e9859 Add infrastructure to handle preference schema migrations and use it to replace one preference
The preference schema migration collects all schema mutations that can occur
when upgrading to a newer gnucash version. The old gconf to gsettings conversion is
integrated in this system as well. Newer schema mutations will happen based on version
number upgrades though.

The preference that got replaced is "use-theme-colors". Based on discussion in bug 746163
(https://bugzilla.gnome.org/show_bug.cgi?id=746163) and gnucash-docs PR#105
(https://github.com/Gnucash/gnucash-docs/pull/105) this has been replaced with
"use-gnucash-color-theme" with inverted meaning. The old option is kept around for one or
two major release cycles to allow seamless conversion.
2017-12-11 21:56:23 +01:00
Robert Fewell
ba5ca5bd55 Remove surplus statement 2017-12-11 09:53:20 +00:00
John Ralls
9dc66c0b7d Fix the Mac install_name_dir to point at CMAKE_INSTALL_FULL_LIBDIR.
Instead of CMAKE_INSTALL_LIBDIR; it needs to be an absolute path.
2017-12-10 13:01:32 -08:00
John Ralls
c0659c8e2b Bug 791422 - gnucash 2.7 no longer opens sqlite3...
as it doesn't load proper backend.
The cause was that the libdbi-driver path in CMakeLists.txt was wrong
and GNC_DBD_DIR was being set unconditionally in etc/gnucash/environment
with an invalid path.
2017-12-10 12:51:24 -08:00
Robert Fewell
0534ba4f8b Update file with changes for transient dialog changes 2017-12-10 11:59:40 +00:00
Robert Fewell
8ee6783b4b Replace magic numbers used in std::get... with values from enum 2017-12-10 11:58:09 +00:00
Robert Fewell
43f1b2fde0 Merge branch 'prices-in' of /mygit/gnucash into prices-in 2017-12-10 10:24:07 +00:00
Robert Fewell
288563c25e Add a test for empty values
Some csv values are allowed to be empty based on options selected so
add a test for this otherwise all values are required.
2017-12-10 10:23:47 +00:00
Robert Fewell
16714a8c5b Replace date parse function with one from gnc_datetime 2017-12-10 10:23:47 +00:00
Robert Fewell
ee2f301789 Make changes for Gtk3 compatibility 2017-12-10 10:23:47 +00:00
Robert Fewell
1aa3601e01 Pot file changes for new files and settings rename 2017-12-10 10:23:47 +00:00