Include asserts to fail immediately if either the dbi or xml backends
fail to load.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22511 57a11ea4-9604-0410-9ed3-97b8803252fd
end_date and last_date with invalid GDates.
This happens routinely when those values are empty and are restored from
SQL. Thanks to all warnings being fatal when testing, this caused the dbi
tests to fail.
[BP]
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22465 57a11ea4-9604-0410-9ed3-97b8803252fd
Replacing printed errors and "do_test" with proper asserts.
There's a fake do_test to let it compile with the still unfixed but also
unused safe save and version check tests.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22464 57a11ea4-9604-0410-9ed3-97b8803252fd
Workaround for Darwin similar to what's already in gnc_module_refresh().
BP
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22459 57a11ea4-9604-0410-9ed3-97b8803252fd
Add all scheme files to POTFILES.skip so that intltool-update > 0.50
will ignore them. Scheme file translation strings are handled by intl-scm/.
BP
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22298 57a11ea4-9604-0410-9ed3-97b8803252fd
Work around strange side-effect of r21665 which caused LC_TIME to be
changed after it had been set by setlocale(LC_ALL) in set_mac_locale().
BP
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22293 57a11ea4-9604-0410-9ed3-97b8803252fd
Some functions may be called only by callback reference in a GtkBuilder
XML file (*.glade, *.xml, or *.ui). Indicate that usage in the test-file
function summary.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22259 57a11ea4-9604-0410-9ed3-97b8803252fd
The actual change to configure.ac (at line 1106) to enable -Wunused -- or rather to un-disable it -- is not included in order to not break the build for folks with buggy versions of swig.
(For example, https://sourceforge.net/tracker/?func=detail&aid=3530021&group_id=1645&atid=101645)
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22203 57a11ea4-9604-0410-9ed3-97b8803252fd
One can't link a library created with -module on OSX, but one can dload
a library compiled with -shared on both OSX and Linux.
Also cleaned out the old "make check" files from test/Makefile.am
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22200 57a11ea4-9604-0410-9ed3-97b8803252fd
Configure gets confused by some gcc builtins on Win7: Disable them so that configure finds the right settings.
[BP]
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22197 57a11ea4-9604-0410-9ed3-97b8803252fd
Special-cases dbi_result_get_datetime returning -1 to work around a bug in MinGW's implementation of gmtime().
[BP]
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22188 57a11ea4-9604-0410-9ed3-97b8803252fd
Wizard and SQL Backend
This addresses the crash reported on Ubuntu with Postgres by Krzysiek.
The stack trace he posted showed the crash was the result of
dereferencing a NULL GDate*, and this change protects against that. It
still doesn't address the more basic problem of why on Win32 and with
mysql and pgsql (but not SQLite3) the mortgage wizard is writing corrupt
dates.
[BP]
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22171 57a11ea4-9604-0410-9ed3-97b8803252fd
budget
Never assume a pointer is NULL unless you set it to NULL!
BP
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22154 57a11ea4-9604-0410-9ed3-97b8803252fd
Which rearranged the ApplyPayments code so that it's done from the
GncInvoice object instead of explicitly by the owner (or in this case,
GncCustomer).
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22151 57a11ea4-9604-0410-9ed3-97b8803252fd
Allows asserting on the number of times error messages are encountered.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22135 57a11ea4-9604-0410-9ed3-97b8803252fd
I'd originally put the functions supporting log detection, qof event handling, and mock-counting in test-stuff along with the functions that support the older "make check" integration tests. There are now more unit test support functions than there are of the older functions, so it's time for them to move out on their own.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22132 57a11ea4-9604-0410-9ed3-97b8803252fd
Works on GObjects. Asserts if the object isn't a GObject (which may be the case if it has already been finalized) or if the object's finalize method isn't called (indicating a leak).
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22114 57a11ea4-9604-0410-9ed3-97b8803252fd
Now the assert reports the location in the test program where it fails instead of inside test-stuff.c.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22113 57a11ea4-9604-0410-9ed3-97b8803252fd
Forward-port of r21886, done in the 2.4 branch to quickly resolve bug
#667900 and to give windows users a nightly build to test with.
Extends that change by also converting the GDK_SELECTION_PRIMARY
operations to use GtkClipboard instead of GtkSelection.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21918 57a11ea4-9604-0410-9ed3-97b8803252fd
td isn't declared unless HAVE_KTOBLZCHECK_H is true, so we can't use it
outside of the #if block.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21917 57a11ea4-9604-0410-9ed3-97b8803252fd
ac_cv_header_dbi_dbi_h is set only if want_dbi is true, so testing for != no succeeds if dbi isn't enabled -- which is not what we want.
BP
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21867 57a11ea4-9604-0410-9ed3-97b8803252fd
So that FileSaveAction isn't made sensitive when the session isn't dirty.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21833 57a11ea4-9604-0410-9ed3-97b8803252fd
Separate the two uses of QofBook::dirty -- indicating that the book object
itself has been edited and indicating that some object in the dataset has
been changed -- into two separate variables with separate getters & setters.
The latter purpose, indicating that some object has been changed, is moved
to a new member variable of QofBook, session_dirty. Its new setter
qof_book_mark_session_dirty() and canceler qof_book_mark_session_saved()
are called only from the xml backend or gnc-autosave(). Its tester,
qof_book_session_not_saved() is used to check for the need to autosave
and to activate FileSaveAction.
BP
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21832 57a11ea4-9604-0410-9ed3-97b8803252fd
Use gnc_dbi_safe_sync_all (which doesn't lose data if the save partion
errors out) for all be->sync.
This is a bit of a half-way solution; we really shouldn't ever have to do
this except when creating a new database, but fixing that will take major
surgery.
BP
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21831 57a11ea4-9604-0410-9ed3-97b8803252fd
Reverse qof_book_mark_saved and qof_instance_mark_clean so that the book
is dirty for qof_book_mark_saved when it's the instance.
BP
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21825 57a11ea4-9604-0410-9ed3-97b8803252fd
Create failing test for gnc_sql_commit_edit() showing that it doesn't call book->dirty_cb when the instance gnc_sql_commit_edit() is called on the book itself.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21824 57a11ea4-9604-0410-9ed3-97b8803252fd
Much work has been done to change LibGnome Druids to GtkAssistants. The
Makefiles in the containing directories no longer need to use $GNOME_CFLAGS
or $GNOME_LDFLAGS. In a few cases where there still is a dependency,
there's also a dependency on GCONF, so this change also adds $GCONF_CFLAGS
and $GCONF_LDFLAGS to those Makefiles to clarify the dependency.
There were also a few cases where the dependency consisted of a no-longer-
needed include, or where an include was more general than appropriate.
This change cleans up those cases as well.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21796 57a11ea4-9604-0410-9ed3-97b8803252fd
Wraps the kvp_frame_set_slot_path with xaccAccountBeginEdit()/xaccAccountCommitEdit().
BP
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21742 57a11ea4-9604-0410-9ed3-97b8803252fd
Compile test-core/test-stuff.c into test-qof, then recompile test-core as a module for dealing with noise from Guile and Python tests.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21736 57a11ea4-9604-0410-9ed3-97b8803252fd
Carried over from somewhere in 2000, only maintained as part of global changes since. Not used anywhere.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21730 57a11ea4-9604-0410-9ed3-97b8803252fd
The GncNumericErrorCode enums are re-defined in src/engine/gnc-numeric.scm -- the SWIG way of representing them produces type errors in the report code. This may well be a problem with the calling code, but it's easier at this point to just not import the symbols into sw_engine.
gnc_commodity_table_get_quotable_commodities is explicitly wrapped in app-utils.i, so we need to not have the default wrapper in sw_engine.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21727 57a11ea4-9604-0410-9ed3-97b8803252fd
Enables silencing expected error output. Finally found the secret code
to get libtool to build a "noinst" dynamic library: pass -rpath as an
ldflag.
BP
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21724 57a11ea4-9604-0410-9ed3-97b8803252fd
Much better for expected warnings to be tested for than to have a lead-in message saying that they're really OK.
Don't have the test utilities in Scheme yet.
Set the phony modules in misc-modules to be libtool modules instead of shared libraries. Aside from being more correct, this ensures that they'll have the same name on Linux and OSX.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21677 57a11ea4-9604-0410-9ed3-97b8803252fd
Much better for expected warnings to be tested for than to have a lead-in message saying that they're really OK.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21676 57a11ea4-9604-0410-9ed3-97b8803252fd
Much better for expected warnings to be tested for than to have a lead-in message saying that they're really OK.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21675 57a11ea4-9604-0410-9ed3-97b8803252fd
Ensure that libgncmod-engine can load its backends, and that all module dependencies can be found on OSX when gnucash isn't installed.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21672 57a11ea4-9604-0410-9ed3-97b8803252fd
Prevents error messages about g_hash being NULL.
Invokes qof_log_init_file_special ("stderr") in gnc_module_system_init(), so gnc_log_init() had to be moved to after that call in main() so that the command-line log setting doesn't get replaced with the default setting in module_system_init.
Note that gnc_module_load_common() has one of the offending "ENTER" macros that cause the error, and it's before the safety call of module_system_init, so test programs need to explicitly call module_system_init before loading any modules.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21670 57a11ea4-9604-0410-9ed3-97b8803252fd
Add an GTestFatalFunc which can examine a list of error conditions and suppress those messages and prevent their exiting while passing through any unexpected errors.
Rename test_silent_logger to test_null_handler and change it to a GTestFatalFunc (it can still be used as a GLogFunc).
Rename test_handle_faults to test_checked_handler and improve its flow and message display. It no longer asserts on a bad match.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21668 57a11ea4-9604-0410-9ed3-97b8803252fd