2002-10-14 Joshua Sled <jsled@asynchronous.org>

* src/app-utils/gnc-exp-parser.c (func_op): Remove
	seemed-like-a-bad-idea explicit negation of calculated values;
	fixes Bug#95781.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7316 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Joshua Sled
2002-10-15 03:26:46 +00:00
parent b602aa7a49
commit 64f30ce2a5
3 changed files with 11 additions and 10 deletions

View File

@@ -1,3 +1,9 @@
2002-10-14 Joshua Sled <jsled@asynchronous.org>
* src/app-utils/gnc-exp-parser.c (func_op): Remove
seemed-like-a-bad-idea explicit negation of calculated values;
fixes Bug#95781.
2002-10-14 Derek Atkins <derek@ihtfp.com>
* src/backend/file/test-xml-transaction.c -- use gnc_numeric_equal()
to compare split value and quantities in tests, because Splits can

View File

@@ -392,11 +392,6 @@ func_op( const char *fname,
*result = double_to_gnc_numeric( gh_scm2double(scmTmp),
GNC_DENOM_AUTO,
GNC_DENOM_SIGFIGS(6) | GNC_RND_ROUND );
/* I'm not sure why this explicit negation step is necessary, but it
* doesn't seem like it should be. */
if ( gh_scm2double( scmTmp ) < 0 ) {
*result = gnc_numeric_neg( *result );
}
/* FIXME: cleanup scmArgs = gh_list, cons'ed cells? */
return (void*)result;
}

View File

@@ -150,14 +150,14 @@ test_parser (void)
add_pass_test( "plus( plus( 1 : 2 ) : 3 )", NULL, gnc_numeric_create( 6, 1 ) );
add_pass_test( "plus( 4 : plus( plus( 1 : 2 ) : 3))", NULL, gnc_numeric_create( 10, 1 ) );
gh_eval_str( "(define (gnc:foo a b) (- a b))" );
add_pass_test( "foo( 1 : 2 ) + 4", NULL, gnc_numeric_create( 3, 1 ) );
gh_eval_str( "(define (gnc:sub a b) (- a b))" );
add_pass_test( "sub( 1 : 2 ) + 4", NULL, gnc_numeric_create( 3, 1 ) );
add_pass_test( "foo( (1 + 2 * 3) : 4 ) + 5",
add_pass_test( "sub( (1 + 2 * 3) : 4 ) + 5",
NULL, gnc_numeric_create( 8, 1 ) );
add_pass_test( "foo( 1 : 2 ) + foo( 3 : 4 ) + 5",
add_pass_test( "sub( 1 : 2 ) + sub( 3 : 4 ) + 5",
NULL, gnc_numeric_create( 3, 1 ) );
add_pass_test( "foo( a = 42 : foo( plus( 1 : 2 ) : 6 * 7 )) + a",
add_pass_test( "sub( a = 42 : sub( plus( 1 : 2 ) : 6 * 7 )) + a",
NULL, gnc_numeric_create( 123, 1 ) );
gh_eval_str( "(define (gnc:test_str str b)"