[libgsf] Tests: check that we don't write our "ignore" header for seekable sinks.



commit c43b40af810d1eb50942948009d9316eb876cc8e
Author: Morten Welinder <terra gnome org>
Date:   Sun Dec 14 23:07:19 2014 -0500

    Tests: check that we don't write our "ignore" header for seekable sinks.

 tests/LibGsfTest.pm      |   15 +++++++++++++++
 tests/t1004-zip-zip64.pl |    4 ++--
 2 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/tests/LibGsfTest.pm b/tests/LibGsfTest.pm
index 59b9e28..e32f1ee 100644
--- a/tests/LibGsfTest.pm
+++ b/tests/LibGsfTest.pm
@@ -272,6 +272,11 @@ sub zipinfo_callback {
            next;
        }
 
+       if ($entry && /^\s*- A subfield with ID 0x4949 /) {
+           $entry->{'ignore'} = 1;
+           next;
+       }
+
        if ($entry && /^  *(\S.*\S):\s*(\S.*)$/) {
            my $field = $1;
            my $val = $2;
@@ -321,6 +326,16 @@ sub test_zip {
            };
            next;
        }
+
+       if ($test eq '!ignore') {
+           push @{$args{'member-tests'}},
+           sub {
+               my ($member) = @_;
+               my $name = $member->{'name'};
+               die "Member $name should not use ignore extension\n" if $member->{'ignore'};
+           };
+           next;
+       }
     }
 
     &test_archive (\%args);
diff --git a/tests/t1004-zip-zip64.pl b/tests/t1004-zip-zip64.pl
index 24223ed..f4af552 100755
--- a/tests/t1004-zip-zip64.pl
+++ b/tests/t1004-zip-zip64.pl
@@ -7,8 +7,8 @@ use LibGsfTest;
 
 &test_zip ('files' => ['Makefile.am', 'common.supp'],
           'create-options' => ["--zip64=1"],
-          'zip-member-tests' => ['zip64']);
+          'zip-member-tests' => ['zip64', '!ignore']);
 
 &test_zip ('files' => ['Makefile.am', 'common.supp'],
           'create-options' => ["--zip64=0"],
-          'zip-member-tests' => ['!zip64']);
+          'zip-member-tests' => ['!zip64', '!ignore']);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]