1# Before "make install", this script should be runnable with "make test".
2# After "make install" it should work as "perl t/Sigma.t".
3
4BEGIN {
5    $| = 1; print "1..5\n"; $Image::ExifTool::configFile = '';
6    require './t/TestLib.pm'; t::TestLib->import();
7}
8END {print "not ok 1\n" unless $loaded;}
9
10# test 1: Load the module(s)
11use Image::ExifTool 'ImageInfo';
12use Image::ExifTool::Sigma;
13$loaded = 1;
14print "ok 1\n";
15
16my $testname = 'Sigma';
17my $testnum = 1;
18
19# test 2: Extract information from Sigma.jpg
20{
21    ++$testnum;
22    my $exifTool = new Image::ExifTool;
23    my $info = $exifTool->ImageInfo('t/images/Sigma.jpg');
24    print 'not ' unless check($exifTool, $info, $testname, $testnum);
25    print "ok $testnum\n";
26}
27
28# test 3: Write some new information
29{
30    ++$testnum;
31    my @writeInfo = (
32        ['IPTCPixelWidth' => 200],
33        ['Sharpness' => 2, 'Group' => 'MakerNotes'],
34    );
35    print 'not ' unless writeCheck(\@writeInfo, $testname, $testnum);
36    print "ok $testnum\n";
37}
38
39# test 4: Test reading X3F image
40{
41    ++$testnum;
42    my $exifTool = new Image::ExifTool;
43    my $info = $exifTool->ImageInfo('t/images/Sigma.x3f');
44    print 'not ' unless check($exifTool, $info, $testname, $testnum);
45    print "ok $testnum\n";
46}
47
48# test 5: Test writing X3F image
49{
50    ++$testnum;
51    my @writeInfo = (
52        ['Artist' => 'Phil Harvey'],
53        ['XMP:Title' => 'A title'],
54        ['Keywords' => ['one','two']],
55    );
56    print 'not ' unless writeCheck(\@writeInfo, $testname, $testnum, 't/images/SigmaDP2.x3f');
57    print "ok $testnum\n";
58}
59
60
61# end
62