mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-11-01 09:28:00 -06:00
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
This commit is contained in:
1 parent
340d2ae258
commit
894d2ee6c3
1 file changed
+7
-1
@@ -1334,8 +1334,14 @@ get_random_split(QofBook *book, Account *acct, Transaction *trn)
|
||||
} while (gnc_numeric_check(amt) != GNC_ERROR_OK);
|
||||
}
|
||||
xaccSplitSetAmount(ret, amt);
|
||||
|
||||
/* Make sure val and amt have the same sign. Note that amt is
|
||||
also allowed to be zero, because that is caused by a small
|
||||
rate. */
|
||||
if (gnc_numeric_positive_p(val))
|
||||
g_assert(gnc_numeric_positive_p(amt));
|
||||
g_assert(!gnc_numeric_negative_p(amt)); /* non-negative amt */
|
||||
else
|
||||
g_assert(!gnc_numeric_positive_p(amt)); /* non-positive amt */
|
||||
|
||||
xaccSplitSetSlots_nc(ret, get_random_kvp_frame());
|
||||
xaccTransCommitEdit(trn);
|
||||
|
||||
Reference in new issue
Block a user