~ubuntu-branches/ubuntu/karmic/libimage-exiftool-perl/karmic

« back to all changes in this revision

Viewing changes to t/IPTC-XMP.t

  • Committer: Bazaar Package Importer
  • Author(s): Mari Wang
  • Date: 2008-02-04 20:32:53 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080204203253-mpbal8trlfe1fz5d
Tags: 7.00-1
* Upload of new production release (Closes: #456430)
* Added Recommends: libcompress-zlib-perl (Closes: #435589)
* Package now includes iptc2xmp.args and xmp2iptc.args, they are put
  into /usr/share/libimage-exiftool/ (Closes: #436100)
* Updated standards-version (3.7.2 -> 3.7.3). No changes needed.
* Lots of updates and bugfixes compared to last debian version
  (6.90).  See the Changes file for details
* Upload sponsored by Petter Reinholdtsen

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
# Change "1..N" below to so that N matches last test number
7
7
 
8
 
BEGIN { $| = 1; print "1..12\n"; $Image::ExifTool::noConfig = 1; }
 
8
BEGIN { $| = 1; print "1..18\n"; $Image::ExifTool::noConfig = 1; }
9
9
END {print "not ok 1\n" unless $loaded;}
10
10
 
11
11
# test 1: Load ExifTool
141
141
    $exifTool->SetNewValue(Label => 'Blue');
142
142
    $exifTool->SetNewValue(Rating => 3);
143
143
    $exifTool->SetNewValue(Subject => q{char test: & > < ' "}, AddValue => 1);
 
144
    $exifTool->SetNewValue('Rights' => "\xc2\xa9 Copyright Someone Else");
144
145
    $exifTool->Options(Compact => 1);
145
146
    $exifTool->WriteInfo('t/images/XMP.xmp',$testfile);
146
147
    print 'not ' unless testCompare("t/IPTC-XMP_$testnum.out",$testfile,$testnum);
168
169
    }
169
170
}
170
171
 
 
172
# tests 13-18: Test writing/deleting XMP alternate languages
 
173
{
 
174
    my @writeList = (
 
175
        [ ['Rights-x-default' => "\xc2\xa9 Copyright Another One"] ], # should overwrite x-default only
 
176
        [ ['Rights-de-DE' => "\xc2\xa9 Urheberrecht Phil Harvey"] ],  # should create de-DE only
 
177
        [ ['Rights-x-default' => undef] ],  # should delete all languages
 
178
        [ ['Rights-fr' => undef] ],         # should delete fr only
 
179
        [ ['Title-fr' => 'Test fr title'] ],# should also create x-default
 
180
        [ ['Title-fr' => 'Test fr title'],
 
181
          ['Title-x-default' => 'dTitle'] ],# should create x-default before fr
 
182
    );
 
183
    my $writeListRef;
 
184
    foreach $writeListRef (@writeList) {
 
185
        ++$testnum;
 
186
        my $exifTool = new Image::ExifTool;
 
187
        my $testfile = "t/${testname}_${testnum}_failed.xmp";
 
188
        unlink $testfile;
 
189
        print 'not ' unless writeCheck($writeListRef, $testname, $testnum, 't/images/XMP.xmp',
 
190
                                       [ 'XMP-dc:*' ]);
 
191
        print "ok $testnum\n";
 
192
    }
 
193
}
 
194
 
 
195
 
171
196
# end