Commit Graph

113 Commits

Author SHA1 Message Date
Christian Stimming
8b3650e07f (cppcheck) Fix a possible memory leak
Patch by Aurimas Fišeras.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21200 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-08-21 19:42:34 +00:00
Christian Stimming
88cb0b1b20 Replace more obsolete #define'd function names by their current names.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19939 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-12-14 20:22:48 +00:00
Christian Stimming
febe74e6c0 Replace more obsolete #define'd function names by their current names.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19936 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-12-13 21:00:23 +00:00
Christian Stimming
6dfd0f28f4 Re-indentation of source code.
This re-indentation was done using astyle-1.24 using the following options:

  astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19907 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-12-04 21:09:57 +00:00
Geert Janssens
a0c19b4c71 Bug #502853 - Incorrent tax rounding in invoice (rounding of .5)
This patch changes the default rounding behaviour in GnuCash from
"Round to nearest even" to "Round away to infinity". See the bugreport
for more details on these different rounding methods.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19695 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-10-23 10:38:48 +00:00
Christian Stimming
67c6a3d0cf Replace some renamed functions by their real new names, removing the annoying #defines.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19652 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-10-13 16:16:04 +00:00
Christian Stimming
de83edb352 And more const-correctnes in SchedXaction.h
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19462 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-08-22 11:10:12 +00:00
Christian Stimming
a322015eb8 Rename the type GUID into GncGUID because on Windows, the system headers have a type GUID which clashes with ours.
Note that only the type was renamed, but not any enums or function names.
Hence, the scheme wrappers should be unchanged completely (hopefully).

Discussed at http://lists.gnucash.org/pipermail/gnucash-devel/2010-March/027679.html

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18969 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-27 21:01:21 +00:00
Christian Stimming
a824e611e2 Re-indentation of source code, next batch.
This also strips trailing whitespaces from lines where they existed.
This re-indentation was done using astyle-1.24 using the following options:

astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header

Discussed at http://lists.gnucash.org/pipermail/gnucash-devel/2009-August/026121.html

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18675 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-02-18 05:31:54 +00:00
Christian Stimming
8cecfea8da Bug #106401: Add SX weekend occurence to be shifted to weekdays
The RFE wanted to specify the date of a scheduled transaction like this:
At the 15th of each month but if that is a saturday or a sunday then
at the next monday after that (or the friday before)

This patch implements this. The contributer writes:
Aside from some combinations being possible that don't make sense (because I
haven't looked at how to hide the extra combo boxes for them), and some awful
code in recurrenceNextInstance to stop it trying to go backwards (it may make
more sense to store the date that was going to be used next before it's changed
back/forward, so that that can be compared instead), it seems to work ok.

Patch by Simon Arlott.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17725 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-11-26 21:17:30 +00:00
Derek Atkins
6f39c0c26e (#492137) Re-apply r16619 and make a change to the test
harness to actually get the checks to pass with r16690.
This was an overflow in the test harness.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16716 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-12-24 21:18:09 +00:00
Joshua Sled
f5923ae956 Remove FreqSpec.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16387 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-08-05 21:24:16 +00:00
David Hampton
0964eebb45 Limit the values of randomly generated numbers a little bit more.
This prevents the test-lots case from dying when it attempts to divide
one split into two splits, and the ration of the two splits ends up
producing numbers less than 0.01.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16082 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-05-13 20:54:57 +00:00
David Hampton
cfa50383a5 Replace a function name mapping with the real function call.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15936 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-19 05:09:34 +00:00
Derek Atkins
49c4d834e3 convert price/pricedb objects to GObject initialization
rename gnc_price_{get,set}_type() to _typestr() so it doesn't
conflict with the GType gnc_price_get_type() API.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/branches/gobject-engine-dev-warlord@15812 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-05 00:24:38 +00:00
Joshua Sled
09d90de350 Unused identifier cleanup.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15718 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-03-15 00:56:52 +00:00
David Hampton
6fbada92ec Remove all traces of the AccountGroup data structure. Accounts now
point directly to their parent and have a simple GList of children.
(The old method was alternating data structures in the form Account,
AccountGroup, Account, AccountGroup, etc.)


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15647 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-02-23 01:23:31 +00:00
Joshua Sled
d20436a81e Fix up SX test fixtures for Recurrence transition
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15614 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-02-19 00:14:53 +00:00
Joshua Sled
eb73260220 Fold branches/sx-cleanup/ [14463:15384] back into trunk/.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15399 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-19 23:45:45 +00:00
David Hampton
fc5fe1e5a6 Regularize the account type names into the form ACCT_TYPE_xxx.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14599 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-08-06 22:07:12 +00:00
Christian Stimming
894d2ee6c3 Fix test of numerics in random splits, because multiplications might also turn out zero.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14544 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-07-19 16:03:05 +00:00
Joshua Sled
3a2fa62d87 Fix test-query failure.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13942 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-07 21:39:30 +00:00
Chris Shoemaker
90864dcb27 Correctly ensure that the amount and value of test Splits have the same sign
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13919 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-05 00:17:04 +00:00
Chris Shoemaker
ec1bcb86df Return the actual number of test failures with get_rv().
Use shorter strings for commodity mnemonics.
   Ensure that test splits amount and value have the same sign.
   Avoid numerical overflow in rate calculation when generating test splits.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13718 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-31 01:43:16 +00:00
Chris Shoemaker
241f37379a Remove some testing of an engine API that has been removed.
The engine used to have functions that made it possible to orphan a Split.
   As this is no longer possible, we can't test anymore.

   Incidental:
      Fix three or four small leaks in the test functions.
      Allow test-period to be randomized based on optional command-line arg.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13458 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:09:31 +00:00
Chris Shoemaker
2d1804e67c Move the code that (usually) ensures value/amount consistency for Splits
from add_random_splits() to get_random_split().
   Avoid numeric overflow when creating split values.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13345 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-21 19:43:00 +00:00
Chris Shoemaker
ceebdbd6c7 Fix for 'use of uninitialized' warning.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13313 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-20 02:58:29 +00:00
Christian Stimming
9ff822ad75 Fix uninitialized variable warning
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13301 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-19 20:48:50 +00:00
Derek Atkins
ead7057358 A few tests to improve get_random_query() and fix a couple test bugs.
- Prefer QUERY_AND and QUERY_OR over NAND, NOR, XOR
	  - Don't randomly generate a gnc_numeric with a 0 denominator.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13300 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-19 19:29:51 +00:00
David Hampton
cdc686ecb5 Globally replace the words "exchange_code" with cusip in the
source. No user visible changes.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13213 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-11 20:00:52 +00:00
Derek Atkins
e9e033f60e - better fix for #accounts
- don't g_list_free the account_list



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13127 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-05 21:10:19 +00:00
Derek Atkins
58fd1ba067 A few test changes to make sure we don't fail when we're very unlucky.
- make sure a random group always has at least two accounts
	  - fix "make random transaction" to tell us when we don't
	    have at least two accounts.
	  - free the results of xaccGroupGetSubAccounts().



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13124 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-05 20:38:46 +00:00
Chris Shoemaker
3be52c3a36 Minor improvements to engine testing infrastructure
* add some arrays of realistic string values for various 
     Account and Transaction fields
 * use the arrays to generate slightly more human-readable 
     random books
 * pull some hardcoded constants out into static knobs
 * wrap Transaction creation in begin/commit




git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@12202 57a11ea4-9604-0410-9ed3-97b8803252fd
2005-12-30 04:36:38 +00:00
David Hampton
0289273f91 Don't ignore the return value of glib list functions. This will
likely become a warning in future version of glib, which translates to
an error for gnucash since it compiles with the -Werror flag.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@12093 57a11ea4-9604-0410-9ed3-97b8803252fd
2005-12-04 17:08:02 +00:00
David Hampton
f28d033d74 Collapse the gnome2 branch back into HEAD.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@11565 57a11ea4-9604-0410-9ed3-97b8803252fd
2005-11-02 03:32:36 +00:00
Derek Atkins
4417e511a9 Rich Johnson's patch to include private structures in the doxygen docs.
* src/doc/doxygen.cfg.in:
	  extract local classes = yes
	  don't exclude *P.h


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10378 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-12-17 15:56:30 +00:00
Derek Atkins
6e4a7b2f24 Fix ISO C90 (#153465).
* src/engine/test/test-transaction-reversal.c:
	* src/engine/test-core/test-engine-stuff.c:
	  Fix for ISO C90.  Fixes #153465.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10267 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-09-22 18:40:10 +00:00
Linas Vepstas
b3cea34b4b too many price-dbs are being created ... causing tests to fail
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10186 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-07-09 03:22:21 +00:00
Linas Vepstas
e1807cad13 port over to new typenames.
Make sure that accounts are properly anchored in a book.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10181 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-07-09 03:07:34 +00:00
Linas Vepstas
8ac1f54b9f add code to create intentionally borked transactions
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10173 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-07-07 02:42:44 +00:00
Linas Vepstas
60f2797947 shuffle big blocks of code around; no actual changes to function
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10170 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-07-06 14:24:09 +00:00
Linas Vepstas
bc2faba5ff add to-do notes
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10168 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-07-06 03:46:41 +00:00
Linas Vepstas
a069fe265f clean up test generator to produce self-consistent data.
I make these changes with some trepidation, since this puts
a whole lot less stress on the 'scrub' infrastructure.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10167 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-07-06 03:40:57 +00:00
Linas Vepstas
492ed743ae re-order the way that random data is created,
making it slightly more random.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10144 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-07-03 15:29:39 +00:00
Linas Vepstas
0e0482c2c8 test driver tweaks
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10136 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-07-03 01:24:01 +00:00
Linas Vepstas
1d7e3f3384 make random-numeric code more human-readable
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10112 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-06-27 17:39:24 +00:00
Linas Vepstas
d97831dc8a tweak to attempt to minimize numeric overflows
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10036 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-06-07 03:05:35 +00:00
Derek Atkins
aa3f92a7e2 * src/engine/test-core/test-engine-stuff.c: don't test double
KVPs, on the theory that they will soon be deprecated.
	Fixes #127315


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9750 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-01-02 23:48:47 +00:00
Derek Atkins
e5392da8d6 * src/engine/test-core/test-engine-stuff.c: random queries only
get up to 3 terms, not 4
	* src/app-utils/test/test-scm-query-string.c: loop the test 1000
	  times, now that the queries are smaller.
	Fixes #127492


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9749 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-01-02 23:21:51 +00:00
Derek Atkins
416fd6bb48 * src/engine/test-core/test-engine-stuff.c: don't make a timespec
with tv_sec == 0.  Fixes some tests on the alpha platform.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9685 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-11-17 03:48:17 +00:00