Commit a6e10d75 authored by Morten Welinder's avatar Morten Welinder

Tests: code cleanup.

parent 776c56db
2014-02-19 Morten Welinder <terra@gnome.org>
* GnumericTest.pm (test_roundtrip): Switch to named arguments
since we are going to need more. All callers changed.
2014-02-16 Morten Welinder <terra@gnome.org>
* Release 1.12.11
......
......@@ -355,10 +355,14 @@ sub test_exporter {
# -----------------------------------------------------------------------------
sub test_roundtrip {
my ($file,$format,$newext,$resize) = @_;
my ($file,%named_args) = @_;
&report_skip ("file $file does not exist") unless -r $file;
my $format = $named_args{'format'};
my $newext = $named_args{'ext'};
my $resize = $named_args{'resize'};
my $tmp = fileparse ($file);
$tmp =~ s/\.([a-zA-Z0-9]+)$// or die "Must have extension for roundtrip test.";
my $ext = $1;
......
......@@ -8,16 +8,28 @@ use GnumericTest;
my $file = "$samples/string-tests.gnumeric";
&message ("Check string gnumeric roundtrip.");
&test_roundtrip ($file, 'Gnumeric_XmlIO:sax', "gnm");
&test_roundtrip ($file,
'format' => 'Gnumeric_XmlIO:sax',
'ext' => "gnm");
&message ("Check string ods roundtrip.");
&test_roundtrip ($file, 'Gnumeric_OpenCalc:odf', "ods");
&test_roundtrip ($file,
'format' => 'Gnumeric_OpenCalc:odf',
'ext' => "ods");
&message ("Check string xls/BIFF7 roundtrip.");
&test_roundtrip ($file, 'Gnumeric_Excel:excel_biff7', "xls", '16384x256');
&test_roundtrip ($file,
'format' => 'Gnumeric_Excel:excel_biff7',
'ext' => "xls",
'resize' => '16384x256');
&message ("Check string xls/BIFF8 roundtrip.");
&test_roundtrip ($file, 'Gnumeric_Excel:excel_biff8', "xls");
&test_roundtrip ($file,
'format' => 'Gnumeric_Excel:excel_biff8',
'ext' => "xls");
&message ("Check string xlsx roundtrip.");
&test_roundtrip ($file, 'Gnumeric_Excel:xlsx', "xlsx", '1048576x16384');
&test_roundtrip ($file,
'format' => 'Gnumeric_Excel:xlsx',
'ext' => "xlsx",
'resize' => '1048576x16384');
......@@ -8,16 +8,28 @@ use GnumericTest;
my $file = "$samples/number-tests.gnumeric";
&message ("Check number gnumeric roundtrip.");
&test_roundtrip ($file, 'Gnumeric_XmlIO:sax', "gnm");
&test_roundtrip ($file,
'format' => 'Gnumeric_XmlIO:sax',
'ext' => "gnm");
&message ("Check number ods roundtrip.");
&test_roundtrip ($file, 'Gnumeric_OpenCalc:odf', "ods");
&test_roundtrip ($file,
'format' => 'Gnumeric_OpenCalc:odf',
'ext' => "ods");
&message ("Check number xls/BIFF7 roundtrip.");
&test_roundtrip ($file, 'Gnumeric_Excel:excel_biff7', "xls", '16384x256');
&test_roundtrip ($file,
'format' => 'Gnumeric_Excel:excel_biff7',
'ext' => "xls",
'resize' => '16384x256');
&message ("Check number xls/BIFF8 roundtrip.");
&test_roundtrip ($file, 'Gnumeric_Excel:excel_biff8', "xls");
&test_roundtrip ($file,
'format' => 'Gnumeric_Excel:excel_biff8',
'ext' => "xls");
&message ("Check number xlsx roundtrip.");
&test_roundtrip ($file, 'Gnumeric_Excel:xlsx', "xlsx", '1048576x16384');
&test_roundtrip ($file,
'format' => 'Gnumeric_Excel:xlsx',
'ext' => "xlsx",
'resize' => '1048576x16384');
......@@ -8,16 +8,28 @@ use GnumericTest;
my $file = "$samples/style-tests.gnumeric";
&message ("Check style gnumeric roundtrip.");
&test_roundtrip ($file, 'Gnumeric_XmlIO:sax', "gnm");
&test_roundtrip ($file,
'format' => 'Gnumeric_XmlIO:sax',
'ext' => "gnm");
&message ("Check style ods roundtrip.");
&test_roundtrip ($file, 'Gnumeric_OpenCalc:odf', "ods");
&test_roundtrip ($file,
'format' => 'Gnumeric_OpenCalc:odf',
'ext' => "ods");
&message ("Check style xls/BIFF7 roundtrip.");
&test_roundtrip ($file, 'Gnumeric_Excel:excel_biff7', "xls", '16384x256');
&test_roundtrip ($file,
'format' => 'Gnumeric_Excel:excel_biff7',
'ext' => "xls",
'resize' => '16384x256');
&message ("Check style xls/BIFF8 roundtrip.");
&test_roundtrip ($file, 'Gnumeric_Excel:excel_biff8', "xls");
&test_roundtrip ($file,
'format' => 'Gnumeric_Excel:excel_biff8',
'ext' => "xls");
&message ("Check style xlsx roundtrip.");
&test_roundtrip ($file, 'Gnumeric_Excel:xlsx', "xlsx", '1048576x16384');
&test_roundtrip ($file,
'format' => 'Gnumeric_Excel:xlsx',
'ext' => "xlsx",
'resize' => '1048576x16384');
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment