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

« back to all changes in this revision

Viewing changes to t/umax.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 => 2;
9
 
BEGIN { use_ok('Gscan2pdf::Frontend::Scanimage') };
10
 
 
11
 
#########################
12
 
 
13
 
# Insert your test code below, the Test::More module is use()ed here so read
14
 
# its man page ( perldoc Test::More ) for help writing this test script.
15
 
 
16
 
my $filename = 'scanners/umax';
17
 
my $output = do { local( @ARGV, $/ ) = $filename ; <> } ;
18
 
my %this = Gscan2pdf::Frontend::Scanimage::options2hash($output);
19
 
my %that = (
20
 
          'holder-focus-position-0mm' => {
21
 
                                           'tip' => 'Use 0mm holder focus position instead of 0.6mm',
22
 
                                           'default' => 'inactive',
23
 
                                           'values' => ['yes','no']
24
 
                                         },
25
 
          'cal-lamp-density' => {
26
 
                                  'tip' => 'Define lamp density for calibration',
27
 
                                  'default' => 'inactive',
28
 
                                  'min' => 0,
29
 
                                  'max' => 100,
30
 
                        'unit' => '%',
31
 
                                },
32
 
          'mode' => {
33
 
                      'tip' => 'Selects the scan mode (e.g., lineart, monochrome, or color).',
34
 
                      'default' => 'Color',
35
 
                      'values' => ['Lineart','Gray','Color']
36
 
                    },
37
 
          'shadow-r' => {
38
 
                          'tip' => 'Selects what red radiance level should be considered "black".',
39
 
                          'default' => 'inactive',
40
 
                          'min' => 0,
41
 
                          'max' => 100,
42
 
                        'unit' => '%',
43
 
                        },
44
 
          'scan-exposure-time-g' => {
45
 
                                      'tip' => 'Define exposure-time for green scan',
46
 
                                      'default' => 'inactive',
47
 
                                      'min' => 0,
48
 
                                      'max' => 0,
49
 
                        'unit' => 'us',
50
 
                                    },
51
 
          'scan-exposure-time-r' => {
52
 
                                      'tip' => 'Define exposure-time for red scan',
53
 
                                      'default' => 'inactive',
54
 
                                      'min' => 0,
55
 
                                      'max' => 0,
56
 
                        'unit' => 'us',
57
 
                                    },
58
 
          'lamp-on' => {
59
 
                         'tip' => 'Turn on scanner lamp',
60
 
                         'default' => 'inactive',
61
 
                       },
62
 
          'lens-calibration-in-doc-position' => {
63
 
                                                  'tip' => 'Calibrate lens focus in document position',
64
 
                                                  'default' => 'inactive',
65
 
                                                  'values' => ['yes','no']
66
 
                                                },
67
 
          'rgb-bind' => {
68
 
                          'tip' => 'In RGB-mode use same values for each color',
69
 
                          'default' => 'no',
70
 
                          'values' => ['yes','no']
71
 
                        },
72
 
          'analog-gamma' => {
73
 
                              'tip' => 'Analog gamma-correction',
74
 
                              'default' => 'inactive',
75
 
                                   'min' => 1,
76
 
                            'max' => 2,
77
 
                            'step' => 0.00999451,
78
 
                            },
79
 
          'manual-pre-focus' => {
80
 
                                  'tip' => '',
81
 
                                  'default' => 'inactive',
82
 
                                  'values' => ['yes','no']
83
 
                                },
84
 
          'scan-exposure-time-b' => {
85
 
                                      'tip' => 'Define exposure-time for blue scan',
86
 
                                      'default' => 'inactive',
87
 
                                      'min' => 0,
88
 
                                      'max' => 0,
89
 
                        'unit' => 'us',
90
 
                                    },
91
 
          'analog-gamma-b' => {
92
 
                                'tip' => 'Analog gamma-correction for blue',
93
 
                                'default' => 'inactive',
94
 
                                'min' => 1,
95
 
                            'max' => 2,
96
 
                            'step' => 0.00999451,
97
 
                              },
98
 
          'shadow' => {
99
 
                        'tip' => 'Selects what radiance level should be considered "black".',
100
 
                        'default' => 'inactive',
101
 
                        'min' => 0,
102
 
                        'max' => 100,
103
 
                        'unit' => '%',
104
 
                      },
105
 
          'halftone-size' => {
106
 
                               'tip' => 'Sets the size of the halftoning (dithering) pattern used when scanning halftoned images.',
107
 
                               'default' => 'inactive',
108
 
                               'values' => ['2','4','6','8','12'],
109
 
                        'unit' => 'pel',
110
 
                             },
111
 
          'quality-cal' => {
112
 
                             'tip' => 'Do a quality white-calibration',
113
 
                             'default' => 'yes',
114
 
                             'values' => ['yes','no']
115
 
                           },
116
 
          'cal-exposure-time-r' => {
117
 
                                     'tip' => 'Define exposure-time for red calibration',
118
 
                                     'default' => 'inactive',
119
 
                                     'min' => 0,
120
 
                                      'max' => 0,
121
 
                        'unit' => 'us',
122
 
                                   },
123
 
          'depth' => {
124
 
                       'tip' => 'Number of bits per sample, typical values are 1 for "line-art" and 8 for multibit scans.',
125
 
                       'default' => '8',
126
 
                       'values' => ['8'],
127
 
                        'unit' => 'bit',
128
 
                     },
129
 
          'warmup' => {
130
 
                        'tip' => 'Warmup lamp before scanning',
131
 
                        'default' => 'inactive',
132
 
                        'values' => ['yes','no']
133
 
                      },
134
 
          'fix-focus-position' => {
135
 
                                    'tip' => '',
136
 
                                    'default' => 'inactive',
137
 
                                    'values' => ['yes','no']
138
 
                                  },
139
 
          'brightness' => {
140
 
                            'tip' => 'Controls the brightness of the acquired image.',
141
 
                            'default' => 'inactive',
142
 
                                   'min' => -100,
143
 
                            'max' => 100,
144
 
                            'step' => 1,
145
 
                        'unit' => '%',
146
 
                          },
147
 
          'highlight-g' => {
148
 
                             'tip' => 'Selects what green radiance level should be considered "full green".',
149
 
                             'default' => '100',
150
 
                             'min' => 0,
151
 
                             'max' => 100,
152
 
                        'unit' => '%',
153
 
                           },
154
 
          'analog-gamma-r' => {
155
 
                                'tip' => 'Analog gamma-correction for red',
156
 
                                'default' => 'inactive',
157
 
                                'min' => 1,
158
 
                            'max' => 2,
159
 
                            'step' => 0.00999451,
160
 
                              },
161
 
          'y-resolution' => {
162
 
                              'tip' => 'Sets the vertical resolution of the scanned image.',
163
 
                              'default' => 'inactive',
164
 
                                'min' => 5,
165
 
                            'max' => 600,
166
 
                            'step' => 5,
167
 
                        'unit' => 'dpi',
168
 
                            },
169
 
          'preview' => {
170
 
                         'tip' => 'Request a preview-quality scan.',
171
 
                         'default' => 'no',
172
 
                         'values' => ['yes','no']
173
 
                       },
174
 
          'resolution' => {
175
 
                            'tip' => 'Sets the resolution of the scanned image.',
176
 
                            'default' => '100',
177
 
                                'min' => 5,
178
 
                            'max' => 300,
179
 
                            'step' => 5,
180
 
                        'unit' => 'dpi',
181
 
                          },
182
 
          'negative' => {
183
 
                          'tip' => 'Swap black and white',
184
 
                          'default' => 'inactive',
185
 
                          'values' => ['yes','no']
186
 
                        },
187
 
          'batch-scan-end' => {
188
 
                                'tip' => 'set for last scan of batch',
189
 
                                'default' => 'inactive',
190
 
                                'values' => ['yes','no']
191
 
                              },
192
 
          'source' => {
193
 
                        'tip' => 'Selects the scan source (such as a document-feeder).',
194
 
                        'default' => 'Flatbed',
195
 
                        'values' => ['Flatbed']
196
 
                      },
197
 
          'scan-exposure-time' => {
198
 
                                    'tip' => 'Define exposure-time for scan',
199
 
                                    'default' => 'inactive',
200
 
                                    'min' => 0,
201
 
                                      'max' => 0,
202
 
                        'unit' => 'us',
203
 
                                  },
204
 
          'threshold' => {
205
 
                           'tip' => 'Select minimum-brightness to get a white point',
206
 
                           'default' => 'inactive',
207
 
                           'min' => 0,
208
 
                           'max' => 100,
209
 
                        'unit' => '%',
210
 
                         },
211
 
          'highlight-r' => {
212
 
                             'tip' => 'Selects what red radiance level should be considered "full red".',
213
 
                             'default' => '100',
214
 
                             'min' => 0,
215
 
                             'max' => 100,
216
 
                        'unit' => '%',
217
 
                           },
218
 
          'batch-scan-loop' => {
219
 
                                 'tip' => 'set for middle scans of batch',
220
 
                                 'default' => 'inactive',
221
 
                                 'values' => ['yes','no']
222
 
                               },
223
 
          'custom-gamma' => {
224
 
                              'tip' => 'Determines whether a builtin or a custom gamma-table should be used.',
225
 
                              'default' => 'yes',
226
 
                              'values' => ['yes','no']
227
 
                            },
228
 
          'shadow-g' => {
229
 
                          'tip' => 'Selects what green radiance level should be considered "black".',
230
 
                          'default' => 'inactive',
231
 
                          'min' => 0,
232
 
                          'max' => 100,
233
 
                        'unit' => '%',
234
 
                        },
235
 
          'batch-scan-start' => {
236
 
                                  'tip' => 'set for first scan of batch',
237
 
                                  'default' => 'inactive',
238
 
                                  'values' => ['yes','no']
239
 
                                },
240
 
          'batch-scan-next-tl-y' => {
241
 
                                      'tip' => 'Set top left Y position for next scan',
242
 
                                      'default' => 'inactive',
243
 
                          'min' => 0,
244
 
                          'max' => 297.18,
245
 
                        'unit' => 'mm',
246
 
                                    },
247
 
          'resolution-bind' => {
248
 
                                 'tip' => 'Use same values for X and Y resolution',
249
 
                                 'default' => 'yes',
250
 
                                 'values' => ['yes','no']
251
 
                               },
252
 
          'cal-exposure-time-b' => {
253
 
                                     'tip' => 'Define exposure-time for blue calibration',
254
 
                                     'default' => 'inactive',
255
 
                                     'min' => 0,
256
 
                                     'max' => 0,
257
 
                        'unit' => 'us',
258
 
                                   },
259
 
          'highlight-b' => {
260
 
                             'tip' => 'Selects what blue radiance level should be considered "full blue".',
261
 
                             'default' => '100',
262
 
                             'min' => 0,
263
 
                             'max' => 100,
264
 
                        'unit' => '%',
265
 
                           },
266
 
          'disable-pre-focus' => {
267
 
                                   'tip' => 'Do not calibrate focus',
268
 
                                   'default' => 'inactive',
269
 
                                   'values' => ['yes','no']
270
 
                                 },
271
 
          'highlight' => {
272
 
                           'tip' => 'Selects what radiance level should be considered "white".',
273
 
                           'default' => 'inactive',
274
 
                           'min' => 0,
275
 
                           'max' => 100,
276
 
                        'unit' => '%',
277
 
                         },
278
 
          'double-res' => {
279
 
                            'tip' => 'Use lens that doubles optical resolution',
280
 
                            'default' => 'inactive',
281
 
                            'values' => ['yes','no']
282
 
                          },
283
 
          'select-lamp-density' => {
284
 
                                     'tip' => 'Enable selection of lamp density',
285
 
                                     'default' => 'inactive',
286
 
                                     'values' => ['yes','no']
287
 
                                   },
288
 
          'shadow-b' => {
289
 
                          'tip' => 'Selects what blue radiance level should be considered "black".',
290
 
                          'default' => 'inactive',
291
 
                          'min' => 0,
292
 
                          'max' => 100,
293
 
                        'unit' => '%',
294
 
                        },
295
 
          'lamp-off' => {
296
 
                          'tip' => 'Turn off scanner lamp',
297
 
                          'default' => 'inactive',
298
 
                        },
299
 
          'cal-exposure-time-g' => {
300
 
                                     'tip' => 'Define exposure-time for green calibration',
301
 
                                     'default' => 'inactive',
302
 
                                     'min' => 0,
303
 
                                     'max' => 0,
304
 
                        'unit' => 'us',
305
 
                                   },
306
 
          'scan-lamp-density' => {
307
 
                                   'tip' => 'Define lamp density for scan',
308
 
                                   'default' => 'inactive',
309
 
                                   'min' => 0,
310
 
                                   'max' => 100,
311
 
                        'unit' => '%',
312
 
                                 },
313
 
          'analog-gamma-g' => {
314
 
                                'tip' => 'Analog gamma-correction for green',
315
 
                                'default' => 'inactive',
316
 
                                'min' => 1,
317
 
                                'max' => 2,
318
 
                                'step' => 0.00999451,
319
 
                              },
320
 
          'contrast' => {
321
 
                          'tip' => 'Controls the contrast of the acquired image.',
322
 
                          'default' => 'inactive',
323
 
                          'min' => -100,
324
 
                            'max' => 100,
325
 
                            'step' => 1,
326
 
                        'unit' => '%',
327
 
                        },
328
 
          'cal-exposure-time' => {
329
 
                                   'tip' => 'Define exposure-time for calibration',
330
 
                                   'default' => 'inactive',
331
 
                                   'min' => 0,
332
 
                                      'max' => 0,
333
 
                        'unit' => 'us',
334
 
                                 },
335
 
          'lamp-off-at-exit' => {
336
 
                                  'tip' => 'Turn off lamp when program exits',
337
 
                                  'default' => 'inactive',
338
 
                                  'values' => ['yes','no']
339
 
                                },
340
 
          'select-calibration-exposure-time' => {
341
 
                                                  'tip' => 'Allow different settings for calibration and scan exposure times',
342
 
                                                  'default' => 'inactive',
343
 
                                                  'values' => ['yes','no']
344
 
                                                },
345
 
          'halftone-pattern' => {
346
 
                                  'tip' => 'Defines the halftoning (dithering) pattern for scanning halftoned images.',
347
 
                                  'default' => 'inactive',
348
 
                                  'min' => 0,
349
 
                            'max' => 255,
350
 
                                },
351
 
          'select-exposure-time' => {
352
 
                                      'tip' => 'Enable selection of exposure-time',
353
 
                                      'default' => 'inactive',
354
 
                                      'values' => ['yes','no']
355
 
                                    },
356
 
          'l' => {
357
 
                   'tip' => 'Top-left x position of scan area.',
358
 
                   'default' => 0,
359
 
                   'min' => 0,
360
 
                   'max' => 215.9,
361
 
                        'unit' => 'mm',
362
 
                 },
363
 
          't' => {
364
 
                   'tip' => 'Top-left y position of scan area.',
365
 
                   'default' => 0,
366
 
                   'min' => 0,
367
 
                   'max' => 297.18,
368
 
                        'unit' => 'mm',
369
 
                 },
370
 
          'x' => {
371
 
                   'tip' => 'Width of scan-area.',
372
 
                   'default' => 215.9,
373
 
                   'min' => 0,
374
 
                   'max' => 215.9,
375
 
                        'unit' => 'mm',
376
 
                 },
377
 
          'y' => {
378
 
                   'tip' => 'Height of scan-area.',
379
 
                   'default' => 297.18,
380
 
                   'min' => 0,
381
 
                   'max' => 297.18,
382
 
                        'unit' => 'mm',
383
 
                 }
384
 
        );
385
 
is_deeply(\%this, \%that, 'umax');