mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
When the Imap Editor is loaded, the bayes KVP entries are tested to see if they are required to be converted to flat entries. This involves a function that scans every account and if it finds entries that need changing, the change is made and book property GNC_FEATURE_GUID_FLAT_BAYESIAN is added so further scans are not made. As the Imap Editor loops over the account list also, if there are no bayes KVP changes then the conversion function gets called for every account in the list. This can also happen to a lesser degree when doing imports. To stop this a flag is set once the convert to flat function has been run so it only runs once and only lasts for the session.
This directory contains unit test cases to exercise basic GnuCash engine functions. To run the tests, just do 'make check' Notes on test of dirty/clean flag: --------------------------------- This test is currently performed in part in test-customer test-employee test-job test-vendor The test cases will check if the dirty flag is unset on creation of an object and if the dirty flag is set when the object is modified. There used to be a test also to check if the dirty flag is cleared again upon committing the change. This test has been removed, because it can only be successful if a backend is set up. That's because the 'dirty' flag is supposed to be cleared by the backend only. We are in the engine test code however. In here it's not possible to load a backend without creating some circular dependencies between gnucash modules. Just for completeness, this was said on the dirty flag tests before these test cases got moved to the engine: "An object cannot be marked 'clean' unless it has actually been saved to a file or sql db. (Or, in the case of the file backend, the 'dirtiness' of the data has been duly noted, and will be taken care of for the next file save. Until its saved, it lives in perpetual dirtiness. Thus, the test cases need to specify a backend, then do the commit, then test the dirty flag. Actually, the use of the dirty flag in gnucash is, at this time, mildly ambiguous, and its semantics are not clearly defined."