Casio.t 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Before "make install", this script should be runnable with "make test".
  2. # After "make install" it should work as "perl t/Casio.t".
  3. BEGIN { $| = 1; print "1..6\n"; $Image::ExifTool::noConfig = 1; }
  4. END {print "not ok 1\n" unless $loaded;}
  5. # test 1: Load the module(s)
  6. use Image::ExifTool 'ImageInfo';
  7. use Image::ExifTool::Casio;
  8. $loaded = 1;
  9. print "ok 1\n";
  10. use t::TestLib;
  11. my $testname = 'Casio';
  12. my $testnum = 1;
  13. # test 2-4: Extract information from Casio images
  14. {
  15. my $file;
  16. my $exifTool = new Image::ExifTool;
  17. foreach $file ('Casio.jpg', 'Casio2.jpg', 'CasioQVCI.jpg') {
  18. ++$testnum;
  19. my $info = $exifTool->ImageInfo("t/images/$file");
  20. print 'not ' unless check($exifTool, $info, $testname, $testnum);
  21. print "ok $testnum\n";
  22. }
  23. }
  24. # test 5: Write some new information
  25. {
  26. ++$testnum;
  27. my @writeInfo = (
  28. [MaxApertureValue => 4],
  29. [FocusMode => 'Macro'],
  30. );
  31. print 'not ' unless writeCheck(\@writeInfo, $testname, $testnum);
  32. print "ok $testnum\n";
  33. }
  34. # test 6: Write some new information in type 2 file
  35. {
  36. ++$testnum;
  37. my @writeInfo = (
  38. ['XResolution',300],
  39. ['YResolution',300],
  40. ['ObjectDistance','3.5'],
  41. );
  42. print 'not ' unless writeCheck(\@writeInfo, $testname, $testnum, 't/images/Casio2.jpg');
  43. print "ok $testnum\n";
  44. }
  45. # end