~ubuntu-branches/ubuntu/lucid/gscan2pdf/lucid

« back to all changes in this revision

Viewing changes to t/umax.t

  • Committer: Bazaar Package Importer
  • Author(s): Jeffrey Ratcliffe
  • Date: 2008-07-04 22:54:16 UTC
  • mfrom: (1.2.1 upstream) (12 intrepid)
  • mto: (4.2.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: james.westby@ubuntu.com-20080704225416-r875lmn0ffsmeguf
* New upstream release.
  Now Depends: libconfig-general-perl (>= 2.40) to avoid heredoc bug
  Closes: #480947 (gscan2pdf: Defaults for pages are weird now)
  Closes: #486553 (gscan2pdf: unable to save as DjVu)
  Closes: #486680 (gscan2pdf: bizarre DjVu text zones)
  Closes: #485641 (gscan2pdf: No longer saves resolution in TIFF files)
  Closes: #484641 (gscan2pdf: prefix option for scanimage command)
* Bumped Standards-Version

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