gnucash maint: Failing to add a price to the db isn't a test failure.

John Ralls jralls at code.gnucash.org
Tue Sep 22 13:06:40 EDT 2015


Updated	 via  https://github.com/Gnucash/gnucash/commit/782ff9ec (commit)
	from  https://github.com/Gnucash/gnucash/commit/4088a913 (commit)



commit 782ff9ec5f4a3a514137b11bbc5c9e2363f608ac
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Sep 22 10:05:55 2015 -0700

    Failing to add a price to the db isn't a test failure.
    
    Just try again.

diff --git a/src/engine/test-core/test-engine-stuff.c b/src/engine/test-core/test-engine-stuff.c
index a539a9f..dc3e945 100644
--- a/src/engine/test-core/test-engine-stuff.c
+++ b/src/engine/test-core/test-engine-stuff.c
@@ -715,7 +715,6 @@ gboolean
 make_random_pricedb (QofBook *book, GNCPriceDB *db)
 {
     int num_prices;
-    gboolean check;
 
     num_prices = get_random_int_in_range (1, 41);
     if (num_prices < 1) /* should be impossible */
@@ -737,11 +736,9 @@ make_random_pricedb (QofBook *book, GNCPriceDB *db)
             return FALSE;
         }
 
-        check = gnc_pricedb_add_price (db, p);
-        if (!check)
-        {
-            return check;
-        }
+        if (!gnc_pricedb_add_price (db, p))
+            /* probably the same date as another price, just try again. */
+            ++num_prices;
 
         gnc_price_unref (p);
     }



Summary of changes:
 src/engine/test-core/test-engine-stuff.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)



More information about the gnucash-changes mailing list