Commit Graph

89 Commits

Author SHA1 Message Date
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
Linas Vepstas
c90c817e64 merge first round of entity rework back into head branch
The net total of this work is (i beleive) fewer lines of code.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9530 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-10-17 04:25:53 +00:00
Derek Atkins
3331bbe954 * src/engine/engine-helpers.c: turn off scheme garbage collection
during query->scm and scm->query conversion.  It shaves about 50%
	  off the test-scm-query-string tests.
	* src/engine/test-core/test-engine-stuff.c:  add some code to help
	  track down what the get_random_query() is doing.  Turned off by
	  default.
	* src/app-utils/test/test-scm-query-string.c: make the test
	  deterministic by seeding the RNG with a known value.  There is a
	  known "delay" at #245 with a seed of 1 on Linux systems.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9273 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-09-10 00:01:54 +00:00
Linas Vepstas
1752f2c33d remove spectacularly brain-damaged implementation of 'ForEach'
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9097 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-08-16 21:13:31 +00:00
Linas Vepstas
367a8b5f69 rename kvp_frame to KvpFrame to more closely follow gnome naming conventions
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8782 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-06-27 23:33:00 +00:00
Linas Vepstas
92a2f26e52 Rename gncbook and gncsession to qofbook and qofsession
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8762 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-06-27 02:51:10 +00:00
Linas Vepstas
88c88039dc rename the entity functions from xaccEntity to qof_entity
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8749 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-06-26 07:30:48 +00:00
Linas Vepstas
8118b2fd69 rename QueryNew to QofQuery
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8721 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-06-25 07:38:15 +00:00
Linas Vepstas
edfa2f1151 rename gncQueryCore to QofQueryCore
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8701 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-06-25 05:14:10 +00:00
David Hampton
c1f8f4bbe8 New tests for un-voiding and reversing transactions.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8622 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-06-16 03:52:09 +00:00
Linas Vepstas
7a055accd9 date.h -> gnc-date.h
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8551 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-06-10 18:18:34 +00:00
David Hampton
2fc7cc7372 Consolidate all the tests for an ISO 4217 commodity into a pair of
functions.  Use these functions throughout the code.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8252 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-04-29 06:15:34 +00:00
Derek Atkins
0f0080c964 Integration of the new Query subsystem, to replace the old Query
infrastructure.  This also replaces the old "Find Transaction"
	dialog with the new gnome-search dialog.  Registers, Reports, SXs,
	etc. all test out fine.  Integration with SQL has been "done"
	(i.e. it compiles cleanly) but not "tested."  Lots of the old code
	is still there, but #ifdef'ed out.  That code will go away
	shortly.

	There is only one known loss-of-functionality: the query->xml-v1
	converter was not re-implemented.  The current intention is, if
	this functionality is required, to use the query->scm converter
	and then convert the scm->string and insert that into an XML
	document.

	Fix a Transaction Void bug.

	Fix a few bugs in test code.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6951 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-06-05 21:59:35 +00:00
Dave Peticolas
d4a459b968 Peter O'Gorman's patch for Max OS X.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6674 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-01-30 07:38:35 +00:00
Dave Peticolas
dbcc5528c5 Remove unneeded include.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6494 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-01-02 23:35:19 +00:00
Linas Vepstas
dad6b1f29e add missing include
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6488 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-01-02 20:53:29 +00:00
Linas Vepstas
8819597b9d cosmetic renaming of PR_AMOUNT->PR_VALUE
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6486 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-01-02 20:20:37 +00:00
Linas Vepstas
20f13f9cd2 uhh, never mind, revert the last patch
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6475 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-01-02 06:31:49 +00:00
Linas Vepstas
9c12b44817 commodities belong to books
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6471 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-01-02 04:28:32 +00:00
Dave Peticolas
a02f6e3f4d * src/backend/postgres/test/test-db.c: test rollback
* src/engine/Transaction.c: fix bug in transaction rollback

* src/engine/test-core/test-engine-stuff.h: add test routine

* src/engine/test-core/test-engine-stuff.c: add test routine


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6413 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-12-26 07:14:44 +00:00
Dave Peticolas
ab80a5712f Fix bugs.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6269 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-12-07 11:10:22 +00:00
Dave Peticolas
4a67dfe918 Remove acc_guid member from splits.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6262 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-12-06 09:30:25 +00:00
Dave Peticolas
277b4757a7 Add more account queries to make_trans_query.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6139 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-11-29 11:09:33 +00:00
Dave Peticolas
6b9dee0392 fix bug
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6055 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-11-25 09:38:15 +00:00
Linas Vepstas
381504ad5a fix test cases that are wildly misusing internal routines with great borkeness.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6054 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-11-25 09:10:17 +00:00