From abc0dfff5117aa6a87882feeee40520c568ac2a4 Mon Sep 17 00:00:00 2001 From: Derek Atkins Date: Sun, 4 Jul 2004 17:24:08 +0000 Subject: [PATCH] Get test-lots to die consistently. - Set the rng to a known seed. - Loop the test so it fails. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10159 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/test/test-lots.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/engine/test/test-lots.c b/src/engine/test/test-lots.c index 822b13d73f..cf7a73fd99 100644 --- a/src/engine/test/test-lots.c +++ b/src/engine/test/test-lots.c @@ -46,11 +46,15 @@ run_test (void) * XXX not implemented */ success ("automatic lot scrubbing lightly tested and seem to work"); + qof_session_destroy (sess); + } static void main_helper (void *closure, int argc, char **argv) { + int i; + /* Any tests that cause an error or warning to be printed * automatically fail! */ g_log_set_always_fatal( G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING ); @@ -59,7 +63,12 @@ main_helper (void *closure, int argc, char **argv) do_test((NULL!=gnc_module_load("gnucash/engine", 0)), "load engine"); - run_test (); + /* set the rng to a known starting point */ + srand(0); + + /* Iterate the test a number of times */ + for (i=0; i< 20; i++) + run_test (); print_test_results(); exit(get_rv());