[gnumeric] tests: underflow to zero as appropriate in generating the test cases.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] tests: underflow to zero as appropriate in generating the test cases.
- Date: Thu, 31 Oct 2013 01:59:27 +0000 (UTC)
commit 62c54f0e97a05938ff7bbd398013522405c57af0
Author: Morten Welinder <terra gnome org>
Date: Wed Oct 30 21:58:51 2013 -0400
tests: underflow to zero as appropriate in generating the test cases.
tools/process-amath.pl | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/tools/process-amath.pl b/tools/process-amath.pl
index 2ca9f7a..8b07232 100644
--- a/tools/process-amath.pl
+++ b/tools/process-amath.pl
@@ -215,8 +215,8 @@ foreach my $f (@test_files) {
foreach (@args) {
s/^\s+//;
s/\s+$//;
- if (m{^([-+*/() .eE0-9]+)$}) {
- $_ = 0 if /^[-+]?[0-9.]+[eE][-+]?\d+/ && $_ == 0;
+ if (m{^[-+*/() .eE0-9]+$}) {
+ $_ = 0 if /^[-+]?[0-9.]+[eE][-+]?\d+$/ && $_ == 0;
next;
} elsif (exists $vars{$_}) {
$_ = $vars{$_};
@@ -241,7 +241,10 @@ foreach my $f (@test_files) {
}
while (s/^\s*([a-zA-Z0-9]+)\s*:=\s*([-+.eE0-9_]+)\s*;//) {
- $vars{$1} = $2;
+ my $var = $1;
+ my $val = $2;
+ $val = 0 if $val =~ /^[-+]?[0-9.]+[eE][-+]?\d+$/ && $val == 0;
+ $vars{$var} = $val;
}
if (/^\s*test(rel|abs)\s*/ && exists $vars{'f'} && defined ($expr)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]