~ubuntu-branches/debian/sid/gscan2pdf/sid

« back to all changes in this revision

Viewing changes to t/49_cancel_to_tiff.t

  • Committer: Package Import Robot
  • Author(s): Jeffrey Ratcliffe
  • Date: 2012-02-05 22:13:28 UTC
  • mfrom: (1.3.7)
  • Revision ID: package-import@ubuntu.com-20120205221328-lbe6imlt2nymnk7o
Tags: 1.0.1-1
* New upstream release
  Closes: #653918 (gscan2pdf doesn't save metadata anymore)
  Closes: #646298 (pdf-exports of ocropus texts are slow, big)
  Closes: #646246 (gscan2pdf ignores html-entities returned by ocropus
                   documents)
  Closes: #651666 (ability to preview saved files)
  Closes: #645322 (No lock after recovery can result in data loss)
  Closes: #645323 (Imported pages have no thumbnails)
* Bumped standards to 3.9.2 (no changes required)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Before `make install' is performed this script should be runnable with
2
 
# `make test'. After `make install' it should work as `perl Gscan2pdf.t'
3
 
 
4
 
#########################
5
 
 
6
 
# change 'tests => 1' to 'tests => last_test_to_print';
7
 
 
8
 
use Test::More tests => 1;
9
 
BEGIN {
10
 
  use Gscan2pdf;
11
 
  use Gscan2pdf::Document;
12
 
};
13
 
 
14
 
#########################
15
 
 
16
 
# Insert your test code below, the Test::More module is use()ed here so read
17
 
# its man page ( perldoc Test::More ) for help writing this test script.
18
 
 
19
 
# Thumbnail dimensions
20
 
our $widtht  = 100;
21
 
our $heightt = 100;
22
 
 
23
 
use Log::Log4perl qw(:easy);
24
 
Log::Log4perl->easy_init($DEBUG);
25
 
our $logger = Log::Log4perl::get_logger;
26
 
my $prog_name = 'gscan2pdf';
27
 
use Locale::gettext 1.05;    # For translations
28
 
our $d = Locale::gettext->domain($prog_name);
29
 
Gscan2pdf->setup($d, $logger);
30
 
 
31
 
# Create test image
32
 
system('convert rose: test.pnm');
33
 
 
34
 
my $slist = Gscan2pdf::Document->new;
35
 
$slist->get_file_info( 'test.pnm', undef, undef, undef, sub {
36
 
 my ($info) = @_;
37
 
 $slist->import_file( $info, 1, 1, undef, undef, undef, sub {
38
 
  $slist->to_tiff($slist->{data}[0][2], undef, undef, undef, undef, undef, sub {
39
 
   is( -s 'test.pnm', -s "$slist->{data}[0][2]{filename}", 'image not modified' );
40
 
   Gtk2->main_quit;
41
 
  });
42
 
  $slist->{cancelled} = 1;
43
 
 })
44
 
});
45
 
Gtk2->main;
46
 
 
47
 
#########################
48
 
 
49
 
unlink 'test.pnm';
50
 
Gscan2pdf->quit();