]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
354aadbe | 2 | * "$Id: testraster.c 13138 2016-03-15 14:59:54Z msweet $" |
ef416fc2 | 3 | * |
7e86f2f6 | 4 | * Raster test program routines for CUPS. |
ef416fc2 | 5 | * |
a6a4a2f5 | 6 | * Copyright 2007-2016 by Apple Inc. |
7e86f2f6 | 7 | * Copyright 1997-2007 by Easy Software Products. |
ef416fc2 | 8 | * |
7e86f2f6 MS |
9 | * These coded instructions, statements, and computer programs are the |
10 | * property of Apple Inc. and are protected by Federal copyright | |
11 | * law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
12 | * which should have been included with this file. If this file is | |
13 | * file is missing or damaged, see the license at "http://www.cups.org/". | |
ef416fc2 | 14 | * |
7e86f2f6 | 15 | * This file is subject to the Apple OS-Developed Software exception. |
ef416fc2 | 16 | */ |
17 | ||
18 | /* | |
19 | * Include necessary headers... | |
20 | */ | |
21 | ||
a4845881 | 22 | #include <cups/raster-private.h> |
a6a4a2f5 | 23 | #include <cups/ppd.h> |
7e86f2f6 | 24 | #include <math.h> |
ef416fc2 | 25 | |
26 | ||
27 | /* | |
b86bc4cf | 28 | * Test PS commands and header... |
29 | */ | |
30 | ||
f7deaa1a | 31 | static const char *dsc_code = |
32 | "[{\n" | |
33 | "%%BeginFeature: *PageSize Tabloid\n" | |
34 | "<</PageSize[792 1224]>>setpagedevice\n" | |
35 | "%%EndFeature\n" | |
36 | "} stopped cleartomark\n"; | |
37 | static const char *setpagedevice_code = | |
b86bc4cf | 38 | "<<" |
39 | "/MediaClass(Media Class)" | |
40 | "/MediaColor((Media Color))" | |
41 | "/MediaType(Media\\\\Type)" | |
42 | "/OutputType<416263>" | |
43 | "/AdvanceDistance 1000" | |
44 | "/AdvanceMedia 1" | |
45 | "/Collate false" | |
46 | "/CutMedia 2" | |
47 | "/Duplex true" | |
48 | "/HWResolution[100 200]" | |
49 | "/InsertSheet true" | |
50 | "/Jog 3" | |
51 | "/LeadingEdge 1" | |
52 | "/ManualFeed true" | |
53 | "/MediaPosition 8#777" | |
54 | "/MediaWeight 16#fe01" | |
55 | "/MirrorPrint true" | |
56 | "/NegativePrint true" | |
57 | "/NumCopies 1" | |
58 | "/Orientation 1" | |
59 | "/OutputFaceUp true" | |
60 | "/PageSize[612 792.1]" | |
61 | "/Separations true" | |
62 | "/TraySwitch true" | |
63 | "/Tumble true" | |
64 | "/cupsMediaType 2" | |
65 | "/cupsColorOrder 1" | |
66 | "/cupsColorSpace 1" | |
67 | "/cupsCompression 1" | |
68 | "/cupsRowCount 1" | |
69 | "/cupsRowFeed 1" | |
70 | "/cupsRowStep 1" | |
71 | "/cupsBorderlessScalingFactor 1.001" | |
72 | "/cupsInteger0 1" | |
73 | "/cupsInteger1 2" | |
74 | "/cupsInteger2 3" | |
75 | "/cupsInteger3 4" | |
76 | "/cupsInteger4 5" | |
77 | "/cupsInteger5 6" | |
78 | "/cupsInteger6 7" | |
79 | "/cupsInteger7 8" | |
80 | "/cupsInteger8 9" | |
81 | "/cupsInteger9 10" | |
82 | "/cupsInteger10 11" | |
83 | "/cupsInteger11 12" | |
84 | "/cupsInteger12 13" | |
85 | "/cupsInteger13 14" | |
86 | "/cupsInteger14 15" | |
87 | "/cupsInteger15 16" | |
88 | "/cupsReal0 1.1" | |
89 | "/cupsReal1 2.1" | |
90 | "/cupsReal2 3.1" | |
91 | "/cupsReal3 4.1" | |
92 | "/cupsReal4 5.1" | |
93 | "/cupsReal5 6.1" | |
94 | "/cupsReal6 7.1" | |
95 | "/cupsReal7 8.1" | |
96 | "/cupsReal8 9.1" | |
97 | "/cupsReal9 10.1" | |
98 | "/cupsReal10 11.1" | |
99 | "/cupsReal11 12.1" | |
100 | "/cupsReal12 13.1" | |
101 | "/cupsReal13 14.1" | |
102 | "/cupsReal14 15.1" | |
103 | "/cupsReal15 16.1" | |
104 | "/cupsString0(1)" | |
105 | "/cupsString1(2)" | |
106 | "/cupsString2(3)" | |
107 | "/cupsString3(4)" | |
108 | "/cupsString4(5)" | |
109 | "/cupsString5(6)" | |
110 | "/cupsString6(7)" | |
111 | "/cupsString7(8)" | |
112 | "/cupsString8(9)" | |
113 | "/cupsString9(10)" | |
114 | "/cupsString10(11)" | |
115 | "/cupsString11(12)" | |
116 | "/cupsString12(13)" | |
117 | "/cupsString13(14)" | |
118 | "/cupsString14(15)" | |
119 | "/cupsString15(16)" | |
120 | "/cupsMarkerType(Marker Type)" | |
121 | "/cupsRenderingIntent(Rendering Intent)" | |
122 | "/cupsPageSizeName(Letter)" | |
123 | "/cupsPreferredBitsPerColor 17" | |
124 | ">> setpagedevice"; | |
125 | ||
f7deaa1a | 126 | static cups_page_header2_t setpagedevice_header = |
b86bc4cf | 127 | { |
128 | "Media Class", /* MediaClass */ | |
129 | "(Media Color)", /* MediaColor */ | |
130 | "Media\\Type", /* MediaType */ | |
131 | "Abc", /* OutputType */ | |
132 | 1000, /* AdvanceDistance */ | |
133 | CUPS_ADVANCE_FILE, /* AdvanceMedia */ | |
134 | CUPS_FALSE, /* Collate */ | |
135 | CUPS_CUT_JOB, /* CutMedia */ | |
136 | CUPS_TRUE, /* Duplex */ | |
137 | { 100, 200 }, /* HWResolution */ | |
138 | { 0, 0, 0, 0 }, /* ImagingBoundingBox */ | |
139 | CUPS_TRUE, /* InsertSheet */ | |
140 | CUPS_JOG_SET, /* Jog */ | |
141 | CUPS_EDGE_RIGHT, /* LeadingEdge */ | |
142 | { 0, 0 }, /* Margins */ | |
143 | CUPS_TRUE, /* ManualFeed */ | |
144 | 0777, /* MediaPosition */ | |
145 | 0xfe01, /* MediaWeight */ | |
146 | CUPS_TRUE, /* MirrorPrint */ | |
147 | CUPS_TRUE, /* NegativePrint */ | |
148 | 1, /* NumCopies */ | |
149 | CUPS_ORIENT_90, /* Orientation */ | |
150 | CUPS_TRUE, /* OutputFaceUp */ | |
151 | { 612, 792 }, /* PageSize */ | |
152 | CUPS_TRUE, /* Separations */ | |
153 | CUPS_TRUE, /* TraySwitch */ | |
154 | CUPS_TRUE, /* Tumble */ | |
155 | 0, /* cupsWidth */ | |
156 | 0, /* cupsHeight */ | |
157 | 2, /* cupsMediaType */ | |
158 | 0, /* cupsBitsPerColor */ | |
159 | 0, /* cupsBitsPerPixel */ | |
160 | 0, /* cupsBytesPerLine */ | |
161 | CUPS_ORDER_BANDED, /* cupsColorOrder */ | |
162 | CUPS_CSPACE_RGB, /* cupsColorSpace */ | |
163 | 1, /* cupsCompression */ | |
164 | 1, /* cupsRowCount */ | |
165 | 1, /* cupsRowFeed */ | |
166 | 1, /* cupsRowStep */ | |
167 | 0, /* cupsNumColors */ | |
7e86f2f6 MS |
168 | 1.001f, /* cupsBorderlessScalingFactor */ |
169 | { 612.0f, 792.1f }, /* cupsPageSize */ | |
170 | { 0.0f, 0.0f, 0.0f, 0.0f }, /* cupsImagingBBox */ | |
b86bc4cf | 171 | { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, |
172 | /* cupsInteger[16] */ | |
7e86f2f6 | 173 | { 1.1f, 2.1f, 3.1f, 4.1f, 5.1f, 6.1f, 7.1f, 8.1f, 9.1f, 10.1f, 11.1f, 12.1f, 13.1f, 14.1f, 15.1f, 16.1f }, /* cupsReal[16] */ |
b86bc4cf | 174 | { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", |
175 | "14", "15", "16" }, /* cupsString[16] */ | |
176 | "Marker Type", /* cupsMarkerType */ | |
177 | "Rendering Intent", /* cupsRenderingIntent */ | |
178 | "Letter" /* cupsPageSizeName */ | |
179 | }; | |
180 | ||
181 | ||
182 | /* | |
183 | * Local functions... | |
184 | */ | |
185 | ||
f7deaa1a | 186 | static int do_ppd_tests(const char *filename, int num_options, |
187 | cups_option_t *options); | |
188 | static int do_ps_tests(void); | |
f14324a7 | 189 | static int do_ras_file(const char *filename); |
db0bd74a | 190 | static int do_raster_tests(cups_mode_t mode); |
b86bc4cf | 191 | static void print_changes(cups_page_header2_t *header, |
192 | cups_page_header2_t *expected); | |
193 | ||
194 | ||
195 | /* | |
196 | * 'main()' - Test the raster functions. | |
ef416fc2 | 197 | */ |
198 | ||
199 | int /* O - Exit status */ | |
f7deaa1a | 200 | main(int argc, /* I - Number of command-line args */ |
201 | char *argv[]) /* I - Command-line arguments */ | |
ef416fc2 | 202 | { |
f7deaa1a | 203 | int errors; /* Number of errors */ |
f14324a7 | 204 | const char *ext; /* Filename extension */ |
f7deaa1a | 205 | |
206 | ||
207 | if (argc == 1) | |
208 | { | |
209 | errors = do_ps_tests(); | |
db0bd74a MS |
210 | errors += do_raster_tests(CUPS_RASTER_WRITE); |
211 | errors += do_raster_tests(CUPS_RASTER_WRITE_COMPRESSED); | |
c8fef167 | 212 | errors += do_raster_tests(CUPS_RASTER_WRITE_PWG); |
f7deaa1a | 213 | } |
214 | else | |
215 | { | |
216 | int i; /* Looping var */ | |
217 | int num_options; /* Number of options */ | |
218 | cups_option_t *options; /* Options */ | |
219 | ||
220 | ||
221 | for (errors = 0, num_options = 0, options = NULL, i = 1; i < argc; i ++) | |
222 | { | |
223 | if (argv[i][0] == '-') | |
224 | { | |
225 | if (argv[i][1] == 'o') | |
226 | { | |
227 | if (argv[i][2]) | |
228 | num_options = cupsParseOptions(argv[i] + 2, num_options, &options); | |
229 | else | |
230 | { | |
231 | i ++; | |
232 | if (i < argc) | |
233 | num_options = cupsParseOptions(argv[i], num_options, &options); | |
234 | else | |
235 | { | |
236 | puts("Usage: testraster [-o name=value ...] [filename.ppd ...]"); | |
f14324a7 | 237 | puts(" testraster [filename.ras ...]"); |
f7deaa1a | 238 | return (1); |
239 | } | |
240 | } | |
241 | } | |
242 | else | |
243 | { | |
244 | puts("Usage: testraster [-o name=value ...] [filename.ppd ...]"); | |
f14324a7 | 245 | puts(" testraster [filename.ras ...]"); |
f7deaa1a | 246 | return (1); |
247 | } | |
248 | } | |
f14324a7 MS |
249 | else if ((ext = strrchr(argv[i], '.')) != NULL) |
250 | { | |
251 | if (!strcmp(ext, ".ppd")) | |
252 | errors += do_ppd_tests(argv[i], num_options, options); | |
253 | else | |
254 | errors += do_ras_file(argv[i]); | |
255 | } | |
f7deaa1a | 256 | else |
f14324a7 MS |
257 | { |
258 | puts("Usage: testraster [-o name=value ...] [filename.ppd ...]"); | |
259 | puts(" testraster [filename.ras ...]"); | |
260 | return (1); | |
261 | } | |
f7deaa1a | 262 | } |
263 | ||
264 | cupsFreeOptions(num_options, options); | |
265 | } | |
266 | ||
267 | return (errors); | |
268 | } | |
269 | ||
270 | ||
271 | /* | |
272 | * 'do_ppd_tests()' - Test the default option commands in a PPD file. | |
273 | */ | |
274 | ||
275 | static int /* O - Number of errors */ | |
276 | do_ppd_tests(const char *filename, /* I - PPD file */ | |
277 | int num_options, /* I - Number of options */ | |
278 | cups_option_t *options) /* I - Options */ | |
279 | { | |
280 | ppd_file_t *ppd; /* PPD file data */ | |
281 | cups_page_header2_t header; /* Page header */ | |
282 | ||
283 | ||
284 | printf("\"%s\": ", filename); | |
285 | fflush(stdout); | |
286 | ||
287 | if ((ppd = ppdOpenFile(filename)) == NULL) | |
288 | { | |
289 | ppd_status_t status; /* Status from PPD loader */ | |
290 | int line; /* Line number containing error */ | |
291 | ||
292 | ||
293 | status = ppdLastError(&line); | |
294 | ||
295 | puts("FAIL (bad PPD file)"); | |
296 | printf(" %s on line %d\n", ppdErrorString(status), line); | |
297 | ||
298 | return (1); | |
299 | } | |
300 | ||
301 | ppdMarkDefaults(ppd); | |
302 | cupsMarkOptions(ppd, num_options, options); | |
b86bc4cf | 303 | |
f7deaa1a | 304 | if (cupsRasterInterpretPPD(&header, ppd, 0, NULL, NULL)) |
305 | { | |
306 | puts("FAIL (error from function)"); | |
307 | puts(cupsRasterErrorString()); | |
308 | ||
309 | return (1); | |
310 | } | |
311 | else | |
312 | { | |
313 | puts("PASS"); | |
314 | ||
315 | return (0); | |
316 | } | |
317 | } | |
318 | ||
319 | ||
320 | /* | |
321 | * 'do_ps_tests()' - Test standard PostScript commands. | |
322 | */ | |
323 | ||
324 | static int | |
325 | do_ps_tests(void) | |
326 | { | |
327 | cups_page_header2_t header; /* Page header */ | |
328 | int preferred_bits; /* Preferred bits */ | |
329 | int errors = 0; /* Number of errors */ | |
b86bc4cf | 330 | |
b86bc4cf | 331 | |
332 | /* | |
333 | * Test PS exec code... | |
334 | */ | |
335 | ||
336 | fputs("_cupsRasterExecPS(\"setpagedevice\"): ", stdout); | |
337 | fflush(stdout); | |
338 | ||
339 | memset(&header, 0, sizeof(header)); | |
340 | header.Collate = CUPS_TRUE; | |
341 | preferred_bits = 0; | |
342 | ||
f7deaa1a | 343 | if (_cupsRasterExecPS(&header, &preferred_bits, setpagedevice_code)) |
b86bc4cf | 344 | { |
345 | puts("FAIL (error from function)"); | |
f7deaa1a | 346 | puts(cupsRasterErrorString()); |
b86bc4cf | 347 | errors ++; |
348 | } | |
f7deaa1a | 349 | else if (preferred_bits != 17 || |
350 | memcmp(&header, &setpagedevice_header, sizeof(header))) | |
b86bc4cf | 351 | { |
352 | puts("FAIL (bad header)"); | |
353 | ||
354 | if (preferred_bits != 17) | |
355 | printf(" cupsPreferredBitsPerColor %d, expected 17\n", | |
356 | preferred_bits); | |
357 | ||
f7deaa1a | 358 | print_changes(&setpagedevice_header, &header); |
b86bc4cf | 359 | errors ++; |
360 | } | |
361 | else | |
362 | puts("PASS"); | |
f14324a7 | 363 | |
b86bc4cf | 364 | fputs("_cupsRasterExecPS(\"roll\"): ", stdout); |
365 | fflush(stdout); | |
366 | ||
367 | if (_cupsRasterExecPS(&header, &preferred_bits, | |
368 | "792 612 0 0 0\n" | |
369 | "pop pop pop\n" | |
370 | "<</PageSize[5 -2 roll]/ImagingBBox null>>" | |
371 | "setpagedevice\n")) | |
372 | { | |
373 | puts("FAIL (error from function)"); | |
f7deaa1a | 374 | puts(cupsRasterErrorString()); |
b86bc4cf | 375 | errors ++; |
376 | } | |
377 | else if (header.PageSize[0] != 792 || header.PageSize[1] != 612) | |
378 | { | |
379 | printf("FAIL (PageSize [%d %d], expected [792 612])\n", header.PageSize[0], | |
380 | header.PageSize[1]); | |
381 | errors ++; | |
382 | } | |
383 | else | |
384 | puts("PASS"); | |
385 | ||
386 | fputs("_cupsRasterExecPS(\"dup index\"): ", stdout); | |
387 | fflush(stdout); | |
388 | ||
389 | if (_cupsRasterExecPS(&header, &preferred_bits, | |
390 | "true false dup\n" | |
391 | "<</Collate 4 index" | |
392 | "/Duplex 5 index" | |
393 | "/Tumble 6 index>>setpagedevice\n" | |
394 | "pop pop pop")) | |
395 | { | |
396 | puts("FAIL (error from function)"); | |
f7deaa1a | 397 | puts(cupsRasterErrorString()); |
b86bc4cf | 398 | errors ++; |
399 | } | |
400 | else | |
401 | { | |
402 | if (!header.Collate) | |
403 | { | |
404 | printf("FAIL (Collate false, expected true)\n"); | |
405 | errors ++; | |
406 | } | |
407 | ||
408 | if (header.Duplex) | |
409 | { | |
410 | printf("FAIL (Duplex true, expected false)\n"); | |
411 | errors ++; | |
412 | } | |
413 | ||
414 | if (header.Tumble) | |
415 | { | |
416 | printf("FAIL (Tumble true, expected false)\n"); | |
417 | errors ++; | |
418 | } | |
419 | ||
420 | if(header.Collate && !header.Duplex && !header.Tumble) | |
421 | puts("PASS"); | |
422 | } | |
423 | ||
f7deaa1a | 424 | fputs("_cupsRasterExecPS(\"%%Begin/EndFeature code\"): ", stdout); |
425 | fflush(stdout); | |
426 | ||
427 | if (_cupsRasterExecPS(&header, &preferred_bits, dsc_code)) | |
428 | { | |
429 | puts("FAIL (error from function)"); | |
430 | puts(cupsRasterErrorString()); | |
431 | errors ++; | |
432 | } | |
433 | else if (header.PageSize[0] != 792 || header.PageSize[1] != 1224) | |
434 | { | |
435 | printf("FAIL (bad PageSize [%d %d], expected [792 1224])\n", | |
436 | header.PageSize[0], header.PageSize[1]); | |
437 | errors ++; | |
438 | } | |
439 | else | |
440 | puts("PASS"); | |
441 | ||
f14324a7 MS |
442 | return (errors); |
443 | } | |
b86bc4cf | 444 | |
b86bc4cf | 445 | |
f14324a7 MS |
446 | /* |
447 | * 'do_ras_file()' - Test reading of a raster file. | |
448 | */ | |
b86bc4cf | 449 | |
f14324a7 MS |
450 | static int /* O - Number of errors */ |
451 | do_ras_file(const char *filename) /* I - Filename */ | |
452 | { | |
453 | unsigned y; /* Looping vars */ | |
454 | int fd; /* File descriptor */ | |
455 | cups_raster_t *ras; /* Raster stream */ | |
456 | cups_page_header2_t header; /* Page header */ | |
457 | unsigned char *data; /* Raster data */ | |
458 | int errors = 0; /* Number of errors */ | |
459 | unsigned pages = 0; /* Number of pages */ | |
b86bc4cf | 460 | |
b86bc4cf | 461 | |
f14324a7 | 462 | if ((fd = open(filename, O_RDONLY)) < 0) |
b86bc4cf | 463 | { |
f14324a7 MS |
464 | printf("%s: %s\n", filename, strerror(errno)); |
465 | return (1); | |
b86bc4cf | 466 | } |
f14324a7 MS |
467 | |
468 | if ((ras = cupsRasterOpen(fd, CUPS_RASTER_READ)) == NULL) | |
b86bc4cf | 469 | { |
f14324a7 MS |
470 | printf("%s: cupsRasterOpen failed.\n", filename); |
471 | close(fd); | |
472 | return (1); | |
b86bc4cf | 473 | } |
b86bc4cf | 474 | |
f14324a7 | 475 | printf("%s:\n", filename); |
b86bc4cf | 476 | |
f14324a7 | 477 | while (cupsRasterReadHeader2(ras, &header)) |
b86bc4cf | 478 | { |
f14324a7 MS |
479 | pages ++; |
480 | data = malloc(header.cupsBytesPerLine); | |
b86bc4cf | 481 | |
f14324a7 MS |
482 | printf(" Page %u: %ux%ux%u@%ux%udpi", pages, |
483 | header.cupsWidth, header.cupsHeight, header.cupsBitsPerPixel, | |
484 | header.HWResolution[0], header.HWResolution[1]); | |
485 | fflush(stdout); | |
b86bc4cf | 486 | |
f14324a7 MS |
487 | for (y = 0; y < header.cupsHeight; y ++) |
488 | if (cupsRasterReadPixels(ras, data, header.cupsBytesPerLine) < | |
489 | header.cupsBytesPerLine) | |
490 | break; | |
491 | ||
492 | if (y < header.cupsHeight) | |
493 | printf(" ERROR AT LINE %d\n", y); | |
494 | else | |
495 | putchar('\n'); | |
496 | ||
497 | free(data); | |
b86bc4cf | 498 | } |
f14324a7 | 499 | |
590e44a4 MS |
500 | printf("EOF at %ld\n", (long)lseek(fd, SEEK_CUR, 0)); |
501 | ||
f14324a7 MS |
502 | cupsRasterClose(ras); |
503 | close(fd); | |
b86bc4cf | 504 | |
f7deaa1a | 505 | return (errors); |
506 | } | |
507 | ||
508 | ||
509 | /* | |
510 | * 'do_raster_tests()' - Test reading and writing of raster data. | |
511 | */ | |
512 | ||
513 | static int /* O - Number of errors */ | |
db0bd74a | 514 | do_raster_tests(cups_mode_t mode) /* O - Write mode */ |
f7deaa1a | 515 | { |
7e86f2f6 | 516 | unsigned page, x, y; /* Looping vars */ |
f7deaa1a | 517 | FILE *fp; /* Raster file */ |
518 | cups_raster_t *r; /* Raster stream */ | |
519 | cups_page_header2_t header, /* Page header */ | |
520 | expected; /* Expected page header */ | |
521 | unsigned char data[2048]; /* Raster data */ | |
522 | int errors = 0; /* Number of errors */ | |
523 | ||
524 | ||
b86bc4cf | 525 | /* |
526 | * Test writing... | |
527 | */ | |
ef416fc2 | 528 | |
db0bd74a MS |
529 | printf("cupsRasterOpen(%s): ", |
530 | mode == CUPS_RASTER_WRITE ? "CUPS_RASTER_WRITE" : | |
c8fef167 MS |
531 | mode == CUPS_RASTER_WRITE ? "CUPS_RASTER_WRITE_COMPRESSED" : |
532 | "CUPS_RASTER_WRITE_PWG"); | |
b86bc4cf | 533 | fflush(stdout); |
ef416fc2 | 534 | |
535 | if ((fp = fopen("test.raster", "wb")) == NULL) | |
536 | { | |
b86bc4cf | 537 | printf("FAIL (%s)\n", strerror(errno)); |
ef416fc2 | 538 | return (1); |
539 | } | |
540 | ||
db0bd74a | 541 | if ((r = cupsRasterOpen(fileno(fp), mode)) == NULL) |
ef416fc2 | 542 | { |
b86bc4cf | 543 | printf("FAIL (%s)\n", strerror(errno)); |
ef416fc2 | 544 | fclose(fp); |
545 | return (1); | |
546 | } | |
547 | ||
b86bc4cf | 548 | puts("PASS"); |
549 | ||
ef416fc2 | 550 | for (page = 0; page < 4; page ++) |
551 | { | |
552 | memset(&header, 0, sizeof(header)); | |
553 | header.cupsWidth = 256; | |
554 | header.cupsHeight = 256; | |
555 | header.cupsBytesPerLine = 256; | |
556 | ||
557 | if (page & 1) | |
558 | { | |
559 | header.cupsBytesPerLine *= 2; | |
560 | header.cupsColorSpace = CUPS_CSPACE_CMYK; | |
561 | header.cupsColorOrder = CUPS_ORDER_CHUNKED; | |
b86bc4cf | 562 | header.cupsNumColors = 4; |
ef416fc2 | 563 | } |
564 | else | |
565 | { | |
566 | header.cupsColorSpace = CUPS_CSPACE_K; | |
567 | header.cupsColorOrder = CUPS_ORDER_BANDED; | |
b86bc4cf | 568 | header.cupsNumColors = 1; |
ef416fc2 | 569 | } |
570 | ||
571 | if (page & 2) | |
572 | { | |
573 | header.cupsBytesPerLine *= 2; | |
574 | header.cupsBitsPerColor = 16; | |
575 | header.cupsBitsPerPixel = (page & 1) ? 64 : 16; | |
576 | } | |
577 | else | |
578 | { | |
579 | header.cupsBitsPerColor = 8; | |
580 | header.cupsBitsPerPixel = (page & 1) ? 32 : 8; | |
581 | } | |
582 | ||
b86bc4cf | 583 | if (cupsRasterWriteHeader2(r, &header)) |
584 | puts("cupsRasterWriteHeader2: PASS"); | |
585 | else | |
586 | { | |
587 | puts("cupsRasterWriteHeader2: FAIL"); | |
588 | errors ++; | |
589 | } | |
ef416fc2 | 590 | |
b86bc4cf | 591 | fputs("cupsRasterWritePixels: ", stdout); |
592 | fflush(stdout); | |
ef416fc2 | 593 | |
b86bc4cf | 594 | memset(data, 0, header.cupsBytesPerLine); |
ef416fc2 | 595 | for (y = 0; y < 64; y ++) |
b86bc4cf | 596 | if (!cupsRasterWritePixels(r, data, header.cupsBytesPerLine)) |
597 | break; | |
ef416fc2 | 598 | |
b86bc4cf | 599 | if (y < 64) |
600 | { | |
601 | puts("FAIL"); | |
602 | errors ++; | |
603 | } | |
604 | else | |
605 | { | |
606 | for (x = 0; x < header.cupsBytesPerLine; x ++) | |
7e86f2f6 | 607 | data[x] = (unsigned char)x; |
ef416fc2 | 608 | |
b86bc4cf | 609 | for (y = 0; y < 64; y ++) |
610 | if (!cupsRasterWritePixels(r, data, header.cupsBytesPerLine)) | |
611 | break; | |
ef416fc2 | 612 | |
b86bc4cf | 613 | if (y < 64) |
614 | { | |
615 | puts("FAIL"); | |
616 | errors ++; | |
617 | } | |
618 | else | |
619 | { | |
620 | memset(data, 255, header.cupsBytesPerLine); | |
621 | for (y = 0; y < 64; y ++) | |
622 | if (!cupsRasterWritePixels(r, data, header.cupsBytesPerLine)) | |
623 | break; | |
624 | ||
625 | if (y < 64) | |
626 | { | |
627 | puts("FAIL"); | |
628 | errors ++; | |
629 | } | |
630 | else | |
631 | { | |
632 | for (x = 0; x < header.cupsBytesPerLine; x ++) | |
7e86f2f6 | 633 | data[x] = (unsigned char)(x / 4); |
b86bc4cf | 634 | |
635 | for (y = 0; y < 64; y ++) | |
636 | if (!cupsRasterWritePixels(r, data, header.cupsBytesPerLine)) | |
637 | break; | |
638 | ||
639 | if (y < 64) | |
640 | { | |
641 | puts("FAIL"); | |
642 | errors ++; | |
643 | } | |
644 | else | |
645 | puts("PASS"); | |
646 | } | |
647 | } | |
648 | } | |
ef416fc2 | 649 | } |
650 | ||
651 | cupsRasterClose(r); | |
652 | fclose(fp); | |
653 | ||
b86bc4cf | 654 | /* |
655 | * Test reading... | |
656 | */ | |
657 | ||
658 | fputs("cupsRasterOpen(CUPS_RASTER_READ): ", stdout); | |
659 | fflush(stdout); | |
660 | ||
ef416fc2 | 661 | if ((fp = fopen("test.raster", "rb")) == NULL) |
662 | { | |
b86bc4cf | 663 | printf("FAIL (%s)\n", strerror(errno)); |
ef416fc2 | 664 | return (1); |
665 | } | |
666 | ||
667 | if ((r = cupsRasterOpen(fileno(fp), CUPS_RASTER_READ)) == NULL) | |
668 | { | |
b86bc4cf | 669 | printf("FAIL (%s)\n", strerror(errno)); |
ef416fc2 | 670 | fclose(fp); |
671 | return (1); | |
672 | } | |
673 | ||
b86bc4cf | 674 | puts("PASS"); |
675 | ||
ef416fc2 | 676 | for (page = 0; page < 4; page ++) |
677 | { | |
b86bc4cf | 678 | memset(&expected, 0, sizeof(expected)); |
679 | expected.cupsWidth = 256; | |
680 | expected.cupsHeight = 256; | |
681 | expected.cupsBytesPerLine = 256; | |
ef416fc2 | 682 | |
771bd8cb MS |
683 | if (mode == CUPS_RASTER_WRITE_PWG) |
684 | { | |
685 | strlcpy(expected.MediaClass, "PwgRaster", sizeof(expected.MediaClass)); | |
686 | expected.cupsInteger[7] = 0xffffff; | |
687 | } | |
688 | ||
b86bc4cf | 689 | if (page & 1) |
ef416fc2 | 690 | { |
b86bc4cf | 691 | expected.cupsBytesPerLine *= 2; |
692 | expected.cupsColorSpace = CUPS_CSPACE_CMYK; | |
693 | expected.cupsColorOrder = CUPS_ORDER_CHUNKED; | |
694 | expected.cupsNumColors = 4; | |
695 | } | |
696 | else | |
697 | { | |
698 | expected.cupsColorSpace = CUPS_CSPACE_K; | |
699 | expected.cupsColorOrder = CUPS_ORDER_BANDED; | |
700 | expected.cupsNumColors = 1; | |
ef416fc2 | 701 | } |
702 | ||
b86bc4cf | 703 | if (page & 2) |
704 | { | |
705 | expected.cupsBytesPerLine *= 2; | |
706 | expected.cupsBitsPerColor = 16; | |
707 | expected.cupsBitsPerPixel = (page & 1) ? 64 : 16; | |
708 | } | |
709 | else | |
ef416fc2 | 710 | { |
b86bc4cf | 711 | expected.cupsBitsPerColor = 8; |
712 | expected.cupsBitsPerPixel = (page & 1) ? 32 : 8; | |
713 | } | |
ef416fc2 | 714 | |
b86bc4cf | 715 | fputs("cupsRasterReadHeader2: ", stdout); |
716 | fflush(stdout); | |
ef416fc2 | 717 | |
b86bc4cf | 718 | if (!cupsRasterReadHeader2(r, &header)) |
719 | { | |
720 | puts("FAIL (read error)"); | |
721 | errors ++; | |
722 | break; | |
ef416fc2 | 723 | } |
724 | ||
b86bc4cf | 725 | if (memcmp(&header, &expected, sizeof(header))) |
ef416fc2 | 726 | { |
b86bc4cf | 727 | puts("FAIL (bad page header)"); |
728 | errors ++; | |
729 | print_changes(&header, &expected); | |
ef416fc2 | 730 | } |
731 | ||
b86bc4cf | 732 | fputs("cupsRasterReadPixels: ", stdout); |
733 | fflush(stdout); | |
734 | ||
ef416fc2 | 735 | for (y = 0; y < 64; y ++) |
736 | { | |
b86bc4cf | 737 | if (!cupsRasterReadPixels(r, data, header.cupsBytesPerLine)) |
738 | { | |
739 | puts("FAIL (read error)"); | |
740 | errors ++; | |
741 | break; | |
742 | } | |
ef416fc2 | 743 | |
b86bc4cf | 744 | if (data[0] != 0 || memcmp(data, data + 1, header.cupsBytesPerLine - 1)) |
745 | { | |
746 | printf("FAIL (raster line %d corrupt)\n", y); | |
747 | errors ++; | |
748 | break; | |
749 | } | |
750 | } | |
751 | ||
752 | if (y == 64) | |
753 | { | |
754 | for (y = 0; y < 64; y ++) | |
755 | { | |
756 | if (!cupsRasterReadPixels(r, data, header.cupsBytesPerLine)) | |
757 | { | |
758 | puts("FAIL (read error)"); | |
759 | errors ++; | |
ef416fc2 | 760 | break; |
b86bc4cf | 761 | } |
762 | ||
763 | for (x = 0; x < header.cupsBytesPerLine; x ++) | |
764 | if (data[x] != (x & 255)) | |
765 | break; | |
ef416fc2 | 766 | |
b86bc4cf | 767 | if (x < header.cupsBytesPerLine) |
768 | { | |
769 | printf("FAIL (raster line %d corrupt)\n", y + 64); | |
770 | errors ++; | |
771 | break; | |
772 | } | |
773 | } | |
774 | ||
775 | if (y == 64) | |
776 | { | |
777 | for (y = 0; y < 64; y ++) | |
778 | { | |
779 | if (!cupsRasterReadPixels(r, data, header.cupsBytesPerLine)) | |
780 | { | |
781 | puts("FAIL (read error)"); | |
782 | errors ++; | |
783 | break; | |
784 | } | |
785 | ||
786 | if (data[0] != 255 || memcmp(data, data + 1, header.cupsBytesPerLine - 1)) | |
787 | { | |
788 | printf("fail (raster line %d corrupt)\n", y + 128); | |
789 | errors ++; | |
790 | break; | |
791 | } | |
792 | } | |
793 | ||
794 | if (y == 64) | |
795 | { | |
796 | for (y = 0; y < 64; y ++) | |
797 | { | |
798 | if (!cupsRasterReadPixels(r, data, header.cupsBytesPerLine)) | |
799 | { | |
800 | puts("FAIL (read error)"); | |
801 | errors ++; | |
802 | break; | |
803 | } | |
804 | ||
805 | for (x = 0; x < header.cupsBytesPerLine; x ++) | |
806 | if (data[x] != ((x / 4) & 255)) | |
807 | break; | |
808 | ||
809 | if (x < header.cupsBytesPerLine) | |
810 | { | |
811 | printf("FAIL (raster line %d corrupt)\n", y + 192); | |
812 | errors ++; | |
813 | break; | |
814 | } | |
815 | } | |
816 | ||
817 | if (y == 64) | |
818 | puts("PASS"); | |
819 | } | |
820 | } | |
ef416fc2 | 821 | } |
822 | } | |
823 | ||
824 | cupsRasterClose(r); | |
825 | fclose(fp); | |
826 | ||
f7deaa1a | 827 | return (errors); |
b86bc4cf | 828 | } |
829 | ||
830 | ||
b86bc4cf | 831 | /* |
832 | * 'print_changes()' - Print differences in the page header. | |
833 | */ | |
834 | ||
835 | static void | |
836 | print_changes( | |
837 | cups_page_header2_t *header, /* I - Actual page header */ | |
838 | cups_page_header2_t *expected) /* I - Expected page header */ | |
839 | { | |
840 | int i; /* Looping var */ | |
841 | ||
842 | ||
843 | if (strcmp(header->MediaClass, expected->MediaClass)) | |
844 | printf(" MediaClass (%s), expected (%s)\n", header->MediaClass, | |
845 | expected->MediaClass); | |
846 | ||
847 | if (strcmp(header->MediaColor, expected->MediaColor)) | |
848 | printf(" MediaColor (%s), expected (%s)\n", header->MediaColor, | |
849 | expected->MediaColor); | |
850 | ||
851 | if (strcmp(header->MediaType, expected->MediaType)) | |
852 | printf(" MediaType (%s), expected (%s)\n", header->MediaType, | |
853 | expected->MediaType); | |
854 | ||
855 | if (strcmp(header->OutputType, expected->OutputType)) | |
856 | printf(" OutputType (%s), expected (%s)\n", header->OutputType, | |
857 | expected->OutputType); | |
858 | ||
859 | if (header->AdvanceDistance != expected->AdvanceDistance) | |
860 | printf(" AdvanceDistance %d, expected %d\n", header->AdvanceDistance, | |
861 | expected->AdvanceDistance); | |
862 | ||
863 | if (header->AdvanceMedia != expected->AdvanceMedia) | |
864 | printf(" AdvanceMedia %d, expected %d\n", header->AdvanceMedia, | |
865 | expected->AdvanceMedia); | |
866 | ||
867 | if (header->Collate != expected->Collate) | |
868 | printf(" Collate %d, expected %d\n", header->Collate, | |
869 | expected->Collate); | |
870 | ||
871 | if (header->CutMedia != expected->CutMedia) | |
872 | printf(" CutMedia %d, expected %d\n", header->CutMedia, | |
873 | expected->CutMedia); | |
874 | ||
875 | if (header->Duplex != expected->Duplex) | |
876 | printf(" Duplex %d, expected %d\n", header->Duplex, | |
877 | expected->Duplex); | |
878 | ||
879 | if (header->HWResolution[0] != expected->HWResolution[0] || | |
880 | header->HWResolution[1] != expected->HWResolution[1]) | |
881 | printf(" HWResolution [%d %d], expected [%d %d]\n", | |
882 | header->HWResolution[0], header->HWResolution[1], | |
883 | expected->HWResolution[0], expected->HWResolution[1]); | |
884 | ||
885 | if (memcmp(header->ImagingBoundingBox, expected->ImagingBoundingBox, | |
886 | sizeof(header->ImagingBoundingBox))) | |
887 | printf(" ImagingBoundingBox [%d %d %d %d], expected [%d %d %d %d]\n", | |
888 | header->ImagingBoundingBox[0], | |
889 | header->ImagingBoundingBox[1], | |
890 | header->ImagingBoundingBox[2], | |
891 | header->ImagingBoundingBox[3], | |
892 | expected->ImagingBoundingBox[0], | |
893 | expected->ImagingBoundingBox[1], | |
894 | expected->ImagingBoundingBox[2], | |
895 | expected->ImagingBoundingBox[3]); | |
896 | ||
897 | if (header->InsertSheet != expected->InsertSheet) | |
898 | printf(" InsertSheet %d, expected %d\n", header->InsertSheet, | |
899 | expected->InsertSheet); | |
900 | ||
901 | if (header->Jog != expected->Jog) | |
902 | printf(" Jog %d, expected %d\n", header->Jog, | |
903 | expected->Jog); | |
904 | ||
905 | if (header->LeadingEdge != expected->LeadingEdge) | |
906 | printf(" LeadingEdge %d, expected %d\n", header->LeadingEdge, | |
907 | expected->LeadingEdge); | |
908 | ||
909 | if (header->Margins[0] != expected->Margins[0] || | |
910 | header->Margins[1] != expected->Margins[1]) | |
911 | printf(" Margins [%d %d], expected [%d %d]\n", | |
912 | header->Margins[0], header->Margins[1], | |
913 | expected->Margins[0], expected->Margins[1]); | |
914 | ||
915 | if (header->ManualFeed != expected->ManualFeed) | |
916 | printf(" ManualFeed %d, expected %d\n", header->ManualFeed, | |
917 | expected->ManualFeed); | |
918 | ||
919 | if (header->MediaPosition != expected->MediaPosition) | |
920 | printf(" MediaPosition %d, expected %d\n", header->MediaPosition, | |
921 | expected->MediaPosition); | |
922 | ||
923 | if (header->MediaWeight != expected->MediaWeight) | |
924 | printf(" MediaWeight %d, expected %d\n", header->MediaWeight, | |
925 | expected->MediaWeight); | |
926 | ||
927 | if (header->MirrorPrint != expected->MirrorPrint) | |
928 | printf(" MirrorPrint %d, expected %d\n", header->MirrorPrint, | |
929 | expected->MirrorPrint); | |
930 | ||
931 | if (header->NegativePrint != expected->NegativePrint) | |
932 | printf(" NegativePrint %d, expected %d\n", header->NegativePrint, | |
933 | expected->NegativePrint); | |
934 | ||
935 | if (header->NumCopies != expected->NumCopies) | |
936 | printf(" NumCopies %d, expected %d\n", header->NumCopies, | |
937 | expected->NumCopies); | |
938 | ||
939 | if (header->Orientation != expected->Orientation) | |
940 | printf(" Orientation %d, expected %d\n", header->Orientation, | |
941 | expected->Orientation); | |
942 | ||
943 | if (header->OutputFaceUp != expected->OutputFaceUp) | |
944 | printf(" OutputFaceUp %d, expected %d\n", header->OutputFaceUp, | |
945 | expected->OutputFaceUp); | |
946 | ||
947 | if (header->PageSize[0] != expected->PageSize[0] || | |
948 | header->PageSize[1] != expected->PageSize[1]) | |
949 | printf(" PageSize [%d %d], expected [%d %d]\n", | |
950 | header->PageSize[0], header->PageSize[1], | |
951 | expected->PageSize[0], expected->PageSize[1]); | |
952 | ||
953 | if (header->Separations != expected->Separations) | |
954 | printf(" Separations %d, expected %d\n", header->Separations, | |
955 | expected->Separations); | |
956 | ||
957 | if (header->TraySwitch != expected->TraySwitch) | |
958 | printf(" TraySwitch %d, expected %d\n", header->TraySwitch, | |
959 | expected->TraySwitch); | |
960 | ||
961 | if (header->Tumble != expected->Tumble) | |
962 | printf(" Tumble %d, expected %d\n", header->Tumble, | |
963 | expected->Tumble); | |
964 | ||
965 | if (header->cupsWidth != expected->cupsWidth) | |
966 | printf(" cupsWidth %d, expected %d\n", header->cupsWidth, | |
967 | expected->cupsWidth); | |
968 | ||
969 | if (header->cupsHeight != expected->cupsHeight) | |
970 | printf(" cupsHeight %d, expected %d\n", header->cupsHeight, | |
971 | expected->cupsHeight); | |
972 | ||
973 | if (header->cupsMediaType != expected->cupsMediaType) | |
974 | printf(" cupsMediaType %d, expected %d\n", header->cupsMediaType, | |
975 | expected->cupsMediaType); | |
976 | ||
977 | if (header->cupsBitsPerColor != expected->cupsBitsPerColor) | |
978 | printf(" cupsBitsPerColor %d, expected %d\n", header->cupsBitsPerColor, | |
979 | expected->cupsBitsPerColor); | |
980 | ||
981 | if (header->cupsBitsPerPixel != expected->cupsBitsPerPixel) | |
982 | printf(" cupsBitsPerPixel %d, expected %d\n", header->cupsBitsPerPixel, | |
983 | expected->cupsBitsPerPixel); | |
984 | ||
985 | if (header->cupsBytesPerLine != expected->cupsBytesPerLine) | |
986 | printf(" cupsBytesPerLine %d, expected %d\n", header->cupsBytesPerLine, | |
987 | expected->cupsBytesPerLine); | |
988 | ||
989 | if (header->cupsColorOrder != expected->cupsColorOrder) | |
990 | printf(" cupsColorOrder %d, expected %d\n", header->cupsColorOrder, | |
991 | expected->cupsColorOrder); | |
992 | ||
993 | if (header->cupsColorSpace != expected->cupsColorSpace) | |
994 | printf(" cupsColorSpace %d, expected %d\n", header->cupsColorSpace, | |
995 | expected->cupsColorSpace); | |
996 | ||
997 | if (header->cupsCompression != expected->cupsCompression) | |
998 | printf(" cupsCompression %d, expected %d\n", header->cupsCompression, | |
999 | expected->cupsCompression); | |
1000 | ||
1001 | if (header->cupsRowCount != expected->cupsRowCount) | |
1002 | printf(" cupsRowCount %d, expected %d\n", header->cupsRowCount, | |
1003 | expected->cupsRowCount); | |
1004 | ||
1005 | if (header->cupsRowFeed != expected->cupsRowFeed) | |
1006 | printf(" cupsRowFeed %d, expected %d\n", header->cupsRowFeed, | |
1007 | expected->cupsRowFeed); | |
1008 | ||
1009 | if (header->cupsRowStep != expected->cupsRowStep) | |
1010 | printf(" cupsRowStep %d, expected %d\n", header->cupsRowStep, | |
1011 | expected->cupsRowStep); | |
1012 | ||
1013 | if (header->cupsNumColors != expected->cupsNumColors) | |
1014 | printf(" cupsNumColors %d, expected %d\n", header->cupsNumColors, | |
1015 | expected->cupsNumColors); | |
1016 | ||
7e86f2f6 | 1017 | if (fabs(header->cupsBorderlessScalingFactor - expected->cupsBorderlessScalingFactor) > 0.001) |
b86bc4cf | 1018 | printf(" cupsBorderlessScalingFactor %g, expected %g\n", |
1019 | header->cupsBorderlessScalingFactor, | |
1020 | expected->cupsBorderlessScalingFactor); | |
1021 | ||
7e86f2f6 MS |
1022 | if (fabs(header->cupsPageSize[0] - expected->cupsPageSize[0]) > 0.001 || |
1023 | fabs(header->cupsPageSize[1] - expected->cupsPageSize[1]) > 0.001) | |
b86bc4cf | 1024 | printf(" cupsPageSize [%g %g], expected [%g %g]\n", |
1025 | header->cupsPageSize[0], header->cupsPageSize[1], | |
1026 | expected->cupsPageSize[0], expected->cupsPageSize[1]); | |
1027 | ||
7e86f2f6 MS |
1028 | if (fabs(header->cupsImagingBBox[0] - expected->cupsImagingBBox[0]) > 0.001 || |
1029 | fabs(header->cupsImagingBBox[1] - expected->cupsImagingBBox[1]) > 0.001 || | |
1030 | fabs(header->cupsImagingBBox[2] - expected->cupsImagingBBox[2]) > 0.001 || | |
1031 | fabs(header->cupsImagingBBox[3] - expected->cupsImagingBBox[3]) > 0.001) | |
b86bc4cf | 1032 | printf(" cupsImagingBBox [%g %g %g %g], expected [%g %g %g %g]\n", |
1033 | header->cupsImagingBBox[0], header->cupsImagingBBox[1], | |
1034 | header->cupsImagingBBox[2], header->cupsImagingBBox[3], | |
1035 | expected->cupsImagingBBox[0], expected->cupsImagingBBox[1], | |
1036 | expected->cupsImagingBBox[2], expected->cupsImagingBBox[3]); | |
1037 | ||
1038 | for (i = 0; i < 16; i ++) | |
1039 | if (header->cupsInteger[i] != expected->cupsInteger[i]) | |
1040 | printf(" cupsInteger%d %d, expected %d\n", i, header->cupsInteger[i], | |
1041 | expected->cupsInteger[i]); | |
1042 | ||
1043 | for (i = 0; i < 16; i ++) | |
7e86f2f6 | 1044 | if (fabs(header->cupsReal[i] - expected->cupsReal[i]) > 0.001) |
b86bc4cf | 1045 | printf(" cupsReal%d %g, expected %g\n", i, header->cupsReal[i], |
1046 | expected->cupsReal[i]); | |
1047 | ||
1048 | for (i = 0; i < 16; i ++) | |
1049 | if (strcmp(header->cupsString[i], expected->cupsString[i])) | |
1050 | printf(" cupsString%d (%s), expected (%s)\n", i, | |
1051 | header->cupsString[i], expected->cupsString[i]); | |
1052 | ||
1053 | if (strcmp(header->cupsMarkerType, expected->cupsMarkerType)) | |
1054 | printf(" cupsMarkerType (%s), expected (%s)\n", header->cupsMarkerType, | |
1055 | expected->cupsMarkerType); | |
1056 | ||
1057 | if (strcmp(header->cupsRenderingIntent, expected->cupsRenderingIntent)) | |
1058 | printf(" cupsRenderingIntent (%s), expected (%s)\n", | |
1059 | header->cupsRenderingIntent, | |
1060 | expected->cupsRenderingIntent); | |
1061 | ||
1062 | if (strcmp(header->cupsPageSizeName, expected->cupsPageSizeName)) | |
1063 | printf(" cupsPageSizeName (%s), expected (%s)\n", | |
1064 | header->cupsPageSizeName, | |
1065 | expected->cupsPageSizeName); | |
ef416fc2 | 1066 | } |
1067 | ||
1068 | ||
1069 | /* | |
354aadbe | 1070 | * End of "$Id: testraster.c 13138 2016-03-15 14:59:54Z msweet $". |
ef416fc2 | 1071 | */ |