[gnumeric] tests: resize roundtrip tests for xls/biff7 and xlsx.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] tests: resize roundtrip tests for xls/biff7 and xlsx.
- Date: Mon, 17 Feb 2014 18:54:29 +0000 (UTC)
commit 204f1624c1697b3f0a9d8e219b8e28f6fc729a81
Author: Morten Welinder <terra gnome org>
Date: Mon Feb 17 13:53:27 2014 -0500
tests: resize roundtrip tests for xls/biff7 and xlsx.
We're not interested in getting differences related to the different
sheet sizes these formats use.
test/GnumericTest.pm | 14 +++++++++++---
test/t6500-strings.pl | 4 ++--
test/t6501-numbers.pl | 4 ++--
3 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/test/GnumericTest.pm b/test/GnumericTest.pm
index 447020a..03e0c2f 100644
--- a/test/GnumericTest.pm
+++ b/test/GnumericTest.pm
@@ -355,7 +355,7 @@ sub test_exporter {
# -----------------------------------------------------------------------------
sub test_roundtrip {
- my ($file,$format,$newext) = @_;
+ my ($file,$format,$newext,$resize) = @_;
&report_skip ("file $file does not exist") unless -r $file;
@@ -365,9 +365,17 @@ sub test_roundtrip {
my $code;
my $keep = 0;
+ my $file_resized = $file;
+ if ($resize) {
+ $file_resized =~ s/(\.gnumeric)$/-resize$1/;
+ $code = system ("$ssconvert --resize $resize '$file' '$file_resized' 2>&1 | sed -e 's/^/| /'");
+ &system_failure ($ssconvert, $code) if $code;
+ &junkfile ($file_resized) unless $keep;
+ }
+
my $tmp1 = "$tmp.$newext";
&junkfile ($tmp1) unless $keep;
- $code = system ("$ssconvert -T $format '$file' '$tmp1' 2>&1 | sed -e 's/^/| /'");
+ $code = system ("$ssconvert -T $format '$file_resized' '$tmp1' 2>&1 | sed -e 's/^/| /'");
&system_failure ($ssconvert, $code) if $code;
my $tmp2 = "$tmp-new.$ext";
@@ -377,7 +385,7 @@ sub test_roundtrip {
my $tmp_xml = "$tmp.xml";
&junkfile ($tmp_xml) unless $keep;
- $code = system ("zcat -f '$file' | $PERL normalize-gnumeric >'$tmp_xml'");
+ $code = system ("zcat -f '$file_resized' | $PERL normalize-gnumeric >'$tmp_xml'");
&system_failure ('zcat', $code) if $code;
my $tmp2_xml = "$tmp-new.xml";
diff --git a/test/t6500-strings.pl b/test/t6500-strings.pl
index 174d84b..2d69f9a 100755
--- a/test/t6500-strings.pl
+++ b/test/t6500-strings.pl
@@ -14,10 +14,10 @@ my $file = "$samples/string-tests.gnumeric";
&test_roundtrip ($file, 'Gnumeric_OpenCalc:odf', "ods");
&message ("Check string xls/BIFF7 roundtrip.");
-&test_roundtrip ($file, 'Gnumeric_Excel:excel_biff7', "xls");
+&test_roundtrip ($file, 'Gnumeric_Excel:excel_biff7', "xls", '16384x256');
&message ("Check string xls/BIFF8 roundtrip.");
&test_roundtrip ($file, 'Gnumeric_Excel:excel_biff8', "xls");
&message ("Check string xlsx roundtrip.");
-&test_roundtrip ($file, 'Gnumeric_Excel:xlsx', "xlsx");
+&test_roundtrip ($file, 'Gnumeric_Excel:xlsx', "xlsx", '1048576x16384');
diff --git a/test/t6501-numbers.pl b/test/t6501-numbers.pl
index e420b31..36c6c35 100755
--- a/test/t6501-numbers.pl
+++ b/test/t6501-numbers.pl
@@ -14,10 +14,10 @@ my $file = "$samples/number-tests.gnumeric";
&test_roundtrip ($file, 'Gnumeric_OpenCalc:odf', "ods");
&message ("Check number xls/BIFF7 roundtrip.");
-&test_roundtrip ($file, 'Gnumeric_Excel:excel_biff7', "xls");
+&test_roundtrip ($file, 'Gnumeric_Excel:excel_biff7', "xls", '16384x256');
&message ("Check number xls/BIFF8 roundtrip.");
&test_roundtrip ($file, 'Gnumeric_Excel:excel_biff8', "xls");
&message ("Check number xlsx roundtrip.");
-&test_roundtrip ($file, 'Gnumeric_Excel:xlsx', "xlsx");
+&test_roundtrip ($file, 'Gnumeric_Excel:xlsx', "xlsx", '1048576x16384');
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]