2 * "$Id: testraster.c 7376 2008-03-19 21:07:45Z mike $"
4 * Raster test program routines for CUPS.
6 * Copyright 2007-2010 by Apple Inc.
7 * Copyright 1997-2007 by Easy Software Products.
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/".
15 * This file is subject to the Apple OS-Developed Software exception.
19 * main() - Test the raster functions.
20 * do_ppd_tests() - Test the default option commands in a PPD file.
21 * do_ps_tests() - Test standard PostScript commands.
22 * do_raster_tests() - Test reading and writing of raster data.
23 * print_changes() - Print differences in the page header.
27 * Include necessary headers...
30 #include "image-private.h"
34 * Test PS commands and header...
37 static const char *dsc_code
=
39 "%%BeginFeature: *PageSize Tabloid\n"
40 "<</PageSize[792 1224]>>setpagedevice\n"
42 "} stopped cleartomark\n";
43 static const char *setpagedevice_code
=
45 "/MediaClass(Media Class)"
46 "/MediaColor((Media Color))"
47 "/MediaType(Media\\\\Type)"
49 "/AdvanceDistance 1000"
54 "/HWResolution[100 200]"
59 "/MediaPosition 8#777"
60 "/MediaWeight 16#fe01"
66 "/PageSize[612 792.1]"
77 "/cupsBorderlessScalingFactor 1.001"
126 "/cupsMarkerType(Marker Type)"
127 "/cupsRenderingIntent(Rendering Intent)"
128 "/cupsPageSizeName(Letter)"
129 "/cupsPreferredBitsPerColor 17"
132 static cups_page_header2_t setpagedevice_header
=
134 "Media Class", /* MediaClass */
135 "(Media Color)", /* MediaColor */
136 "Media\\Type", /* MediaType */
137 "Abc", /* OutputType */
138 1000, /* AdvanceDistance */
139 CUPS_ADVANCE_FILE
, /* AdvanceMedia */
140 CUPS_FALSE
, /* Collate */
141 CUPS_CUT_JOB
, /* CutMedia */
142 CUPS_TRUE
, /* Duplex */
143 { 100, 200 }, /* HWResolution */
144 { 0, 0, 0, 0 }, /* ImagingBoundingBox */
145 CUPS_TRUE
, /* InsertSheet */
146 CUPS_JOG_SET
, /* Jog */
147 CUPS_EDGE_RIGHT
, /* LeadingEdge */
148 { 0, 0 }, /* Margins */
149 CUPS_TRUE
, /* ManualFeed */
150 0777, /* MediaPosition */
151 0xfe01, /* MediaWeight */
152 CUPS_TRUE
, /* MirrorPrint */
153 CUPS_TRUE
, /* NegativePrint */
155 CUPS_ORIENT_90
, /* Orientation */
156 CUPS_TRUE
, /* OutputFaceUp */
157 { 612, 792 }, /* PageSize */
158 CUPS_TRUE
, /* Separations */
159 CUPS_TRUE
, /* TraySwitch */
160 CUPS_TRUE
, /* Tumble */
163 2, /* cupsMediaType */
164 0, /* cupsBitsPerColor */
165 0, /* cupsBitsPerPixel */
166 0, /* cupsBytesPerLine */
167 CUPS_ORDER_BANDED
, /* cupsColorOrder */
168 CUPS_CSPACE_RGB
, /* cupsColorSpace */
169 1, /* cupsCompression */
170 1, /* cupsRowCount */
173 0, /* cupsNumColors */
174 1.001, /* cupsBorderlessScalingFactor */
175 { 612.0, 792.1 }, /* cupsPageSize */
176 { 0.0, 0.0, 0.0, 0.0 }, /* cupsImagingBBox */
177 { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 },
178 /* cupsInteger[16] */
179 { 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 8.1, 9.1, 10.1, 11.1, 12.1, 13.1,
180 14.1, 15.1, 16.1 }, /* cupsReal[16] */
181 { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13",
182 "14", "15", "16" }, /* cupsString[16] */
183 "Marker Type", /* cupsMarkerType */
184 "Rendering Intent", /* cupsRenderingIntent */
185 "Letter" /* cupsPageSizeName */
193 static int do_ppd_tests(const char *filename
, int num_options
,
194 cups_option_t
*options
);
195 static int do_ps_tests(void);
196 static int do_raster_tests(cups_mode_t mode
);
197 static void print_changes(cups_page_header2_t
*header
,
198 cups_page_header2_t
*expected
);
202 * 'main()' - Test the raster functions.
205 int /* O - Exit status */
206 main(int argc
, /* I - Number of command-line args */
207 char *argv
[]) /* I - Command-line arguments */
209 int errors
; /* Number of errors */
214 errors
= do_ps_tests();
215 errors
+= do_raster_tests(CUPS_RASTER_WRITE
);
216 errors
+= do_raster_tests(CUPS_RASTER_WRITE_COMPRESSED
);
220 int i
; /* Looping var */
221 int num_options
; /* Number of options */
222 cups_option_t
*options
; /* Options */
225 for (errors
= 0, num_options
= 0, options
= NULL
, i
= 1; i
< argc
; i
++)
227 if (argv
[i
][0] == '-')
229 if (argv
[i
][1] == 'o')
232 num_options
= cupsParseOptions(argv
[i
] + 2, num_options
, &options
);
237 num_options
= cupsParseOptions(argv
[i
], num_options
, &options
);
240 puts("Usage: testraster [-o name=value ...] [filename.ppd ...]");
247 puts("Usage: testraster [-o name=value ...] [filename.ppd ...]");
252 errors
+= do_ppd_tests(argv
[i
], num_options
, options
);
255 cupsFreeOptions(num_options
, options
);
263 * 'do_ppd_tests()' - Test the default option commands in a PPD file.
266 static int /* O - Number of errors */
267 do_ppd_tests(const char *filename
, /* I - PPD file */
268 int num_options
, /* I - Number of options */
269 cups_option_t
*options
) /* I - Options */
271 ppd_file_t
*ppd
; /* PPD file data */
272 cups_page_header2_t header
; /* Page header */
275 printf("\"%s\": ", filename
);
278 if ((ppd
= ppdOpenFile(filename
)) == NULL
)
280 ppd_status_t status
; /* Status from PPD loader */
281 int line
; /* Line number containing error */
284 status
= ppdLastError(&line
);
286 puts("FAIL (bad PPD file)");
287 printf(" %s on line %d\n", ppdErrorString(status
), line
);
292 ppdMarkDefaults(ppd
);
293 cupsMarkOptions(ppd
, num_options
, options
);
295 if (cupsRasterInterpretPPD(&header
, ppd
, 0, NULL
, NULL
))
297 puts("FAIL (error from function)");
298 puts(cupsRasterErrorString());
312 * 'do_ps_tests()' - Test standard PostScript commands.
318 cups_page_header2_t header
; /* Page header */
319 int preferred_bits
; /* Preferred bits */
320 int errors
= 0; /* Number of errors */
324 * Test PS exec code...
327 fputs("_cupsRasterExecPS(\"setpagedevice\"): ", stdout
);
330 memset(&header
, 0, sizeof(header
));
331 header
.Collate
= CUPS_TRUE
;
334 if (_cupsRasterExecPS(&header
, &preferred_bits
, setpagedevice_code
))
336 puts("FAIL (error from function)");
337 puts(cupsRasterErrorString());
340 else if (preferred_bits
!= 17 ||
341 memcmp(&header
, &setpagedevice_header
, sizeof(header
)))
343 puts("FAIL (bad header)");
345 if (preferred_bits
!= 17)
346 printf(" cupsPreferredBitsPerColor %d, expected 17\n",
349 print_changes(&setpagedevice_header
, &header
);
355 fputs("_cupsRasterExecPS(\"roll\"): ", stdout
);
358 if (_cupsRasterExecPS(&header
, &preferred_bits
,
361 "<</PageSize[5 -2 roll]/ImagingBBox null>>"
364 puts("FAIL (error from function)");
365 puts(cupsRasterErrorString());
368 else if (header
.PageSize
[0] != 792 || header
.PageSize
[1] != 612)
370 printf("FAIL (PageSize [%d %d], expected [792 612])\n", header
.PageSize
[0],
377 fputs("_cupsRasterExecPS(\"dup index\"): ", stdout
);
380 if (_cupsRasterExecPS(&header
, &preferred_bits
,
384 "/Tumble 6 index>>setpagedevice\n"
387 puts("FAIL (error from function)");
388 puts(cupsRasterErrorString());
395 printf("FAIL (Collate false, expected true)\n");
401 printf("FAIL (Duplex true, expected false)\n");
407 printf("FAIL (Tumble true, expected false)\n");
411 if(header
.Collate
&& !header
.Duplex
&& !header
.Tumble
)
415 fputs("_cupsRasterExecPS(\"%%Begin/EndFeature code\"): ", stdout
);
418 if (_cupsRasterExecPS(&header
, &preferred_bits
, dsc_code
))
420 puts("FAIL (error from function)");
421 puts(cupsRasterErrorString());
424 else if (header
.PageSize
[0] != 792 || header
.PageSize
[1] != 1224)
426 printf("FAIL (bad PageSize [%d %d], expected [792 1224])\n",
427 header
.PageSize
[0], header
.PageSize
[1]);
434 fputs("_cupsRasterExecPS(\"\"): ", stdout
);
437 if (_cupsRasterExecPS(&header
, &preferred_bits
,
440 puts("FAIL (error from function)");
451 fputs("_cupsRasterExecPS(\"\"): ", stdout
);
454 if (_cupsRasterExecPS(&header
, &preferred_bits
,
457 puts("FAIL (error from function)");
468 fputs("_cupsRasterExecPS(\"\"): ", stdout
);
471 if (_cupsRasterExecPS(&header
, &preferred_bits
,
474 puts("FAIL (error from function)");
485 fputs("_cupsRasterExecPS(\"\"): ", stdout
);
488 if (_cupsRasterExecPS(&header
, &preferred_bits
,
491 puts("FAIL (error from function)");
502 fputs("_cupsRasterExecPS(\"\"): ", stdout
);
505 if (_cupsRasterExecPS(&header
, &preferred_bits
,
508 puts("FAIL (error from function)");
525 * 'do_raster_tests()' - Test reading and writing of raster data.
528 static int /* O - Number of errors */
529 do_raster_tests(cups_mode_t mode
) /* O - Write mode */
531 int page
, x
, y
; /* Looping vars */
532 FILE *fp
; /* Raster file */
533 cups_raster_t
*r
; /* Raster stream */
534 cups_page_header2_t header
, /* Page header */
535 expected
; /* Expected page header */
536 unsigned char data
[2048]; /* Raster data */
537 int errors
= 0; /* Number of errors */
544 printf("cupsRasterOpen(%s): ",
545 mode
== CUPS_RASTER_WRITE
? "CUPS_RASTER_WRITE" :
546 "CUPS_RASTER_WRITE_COMPRESSED");
549 if ((fp
= fopen("test.raster", "wb")) == NULL
)
551 printf("FAIL (%s)\n", strerror(errno
));
555 if ((r
= cupsRasterOpen(fileno(fp
), mode
)) == NULL
)
557 printf("FAIL (%s)\n", strerror(errno
));
564 for (page
= 0; page
< 4; page
++)
566 memset(&header
, 0, sizeof(header
));
567 header
.cupsWidth
= 256;
568 header
.cupsHeight
= 256;
569 header
.cupsBytesPerLine
= 256;
573 header
.cupsBytesPerLine
*= 2;
574 header
.cupsColorSpace
= CUPS_CSPACE_CMYK
;
575 header
.cupsColorOrder
= CUPS_ORDER_CHUNKED
;
576 header
.cupsNumColors
= 4;
580 header
.cupsColorSpace
= CUPS_CSPACE_K
;
581 header
.cupsColorOrder
= CUPS_ORDER_BANDED
;
582 header
.cupsNumColors
= 1;
587 header
.cupsBytesPerLine
*= 2;
588 header
.cupsBitsPerColor
= 16;
589 header
.cupsBitsPerPixel
= (page
& 1) ? 64 : 16;
593 header
.cupsBitsPerColor
= 8;
594 header
.cupsBitsPerPixel
= (page
& 1) ? 32 : 8;
597 if (cupsRasterWriteHeader2(r
, &header
))
598 puts("cupsRasterWriteHeader2: PASS");
601 puts("cupsRasterWriteHeader2: FAIL");
605 fputs("cupsRasterWritePixels: ", stdout
);
608 memset(data
, 0, header
.cupsBytesPerLine
);
609 for (y
= 0; y
< 64; y
++)
610 if (!cupsRasterWritePixels(r
, data
, header
.cupsBytesPerLine
))
620 for (x
= 0; x
< header
.cupsBytesPerLine
; x
++)
623 for (y
= 0; y
< 64; y
++)
624 if (!cupsRasterWritePixels(r
, data
, header
.cupsBytesPerLine
))
634 memset(data
, 255, header
.cupsBytesPerLine
);
635 for (y
= 0; y
< 64; y
++)
636 if (!cupsRasterWritePixels(r
, data
, header
.cupsBytesPerLine
))
646 for (x
= 0; x
< header
.cupsBytesPerLine
; x
++)
649 for (y
= 0; y
< 64; y
++)
650 if (!cupsRasterWritePixels(r
, data
, header
.cupsBytesPerLine
))
672 fputs("cupsRasterOpen(CUPS_RASTER_READ): ", stdout
);
675 if ((fp
= fopen("test.raster", "rb")) == NULL
)
677 printf("FAIL (%s)\n", strerror(errno
));
681 if ((r
= cupsRasterOpen(fileno(fp
), CUPS_RASTER_READ
)) == NULL
)
683 printf("FAIL (%s)\n", strerror(errno
));
690 for (page
= 0; page
< 4; page
++)
692 memset(&expected
, 0, sizeof(expected
));
693 expected
.cupsWidth
= 256;
694 expected
.cupsHeight
= 256;
695 expected
.cupsBytesPerLine
= 256;
699 expected
.cupsBytesPerLine
*= 2;
700 expected
.cupsColorSpace
= CUPS_CSPACE_CMYK
;
701 expected
.cupsColorOrder
= CUPS_ORDER_CHUNKED
;
702 expected
.cupsNumColors
= 4;
706 expected
.cupsColorSpace
= CUPS_CSPACE_K
;
707 expected
.cupsColorOrder
= CUPS_ORDER_BANDED
;
708 expected
.cupsNumColors
= 1;
713 expected
.cupsBytesPerLine
*= 2;
714 expected
.cupsBitsPerColor
= 16;
715 expected
.cupsBitsPerPixel
= (page
& 1) ? 64 : 16;
719 expected
.cupsBitsPerColor
= 8;
720 expected
.cupsBitsPerPixel
= (page
& 1) ? 32 : 8;
723 fputs("cupsRasterReadHeader2: ", stdout
);
726 if (!cupsRasterReadHeader2(r
, &header
))
728 puts("FAIL (read error)");
733 if (memcmp(&header
, &expected
, sizeof(header
)))
735 puts("FAIL (bad page header)");
737 print_changes(&header
, &expected
);
740 fputs("cupsRasterReadPixels: ", stdout
);
743 for (y
= 0; y
< 64; y
++)
745 if (!cupsRasterReadPixels(r
, data
, header
.cupsBytesPerLine
))
747 puts("FAIL (read error)");
752 if (data
[0] != 0 || memcmp(data
, data
+ 1, header
.cupsBytesPerLine
- 1))
754 printf("FAIL (raster line %d corrupt)\n", y
);
762 for (y
= 0; y
< 64; y
++)
764 if (!cupsRasterReadPixels(r
, data
, header
.cupsBytesPerLine
))
766 puts("FAIL (read error)");
771 for (x
= 0; x
< header
.cupsBytesPerLine
; x
++)
772 if (data
[x
] != (x
& 255))
775 if (x
< header
.cupsBytesPerLine
)
777 printf("FAIL (raster line %d corrupt)\n", y
+ 64);
785 for (y
= 0; y
< 64; y
++)
787 if (!cupsRasterReadPixels(r
, data
, header
.cupsBytesPerLine
))
789 puts("FAIL (read error)");
794 if (data
[0] != 255 || memcmp(data
, data
+ 1, header
.cupsBytesPerLine
- 1))
796 printf("fail (raster line %d corrupt)\n", y
+ 128);
804 for (y
= 0; y
< 64; y
++)
806 if (!cupsRasterReadPixels(r
, data
, header
.cupsBytesPerLine
))
808 puts("FAIL (read error)");
813 for (x
= 0; x
< header
.cupsBytesPerLine
; x
++)
814 if (data
[x
] != ((x
/ 4) & 255))
817 if (x
< header
.cupsBytesPerLine
)
819 printf("FAIL (raster line %d corrupt)\n", y
+ 192);
840 * 'print_changes()' - Print differences in the page header.
845 cups_page_header2_t
*header
, /* I - Actual page header */
846 cups_page_header2_t
*expected
) /* I - Expected page header */
848 int i
; /* Looping var */
851 if (strcmp(header
->MediaClass
, expected
->MediaClass
))
852 printf(" MediaClass (%s), expected (%s)\n", header
->MediaClass
,
853 expected
->MediaClass
);
855 if (strcmp(header
->MediaColor
, expected
->MediaColor
))
856 printf(" MediaColor (%s), expected (%s)\n", header
->MediaColor
,
857 expected
->MediaColor
);
859 if (strcmp(header
->MediaType
, expected
->MediaType
))
860 printf(" MediaType (%s), expected (%s)\n", header
->MediaType
,
861 expected
->MediaType
);
863 if (strcmp(header
->OutputType
, expected
->OutputType
))
864 printf(" OutputType (%s), expected (%s)\n", header
->OutputType
,
865 expected
->OutputType
);
867 if (header
->AdvanceDistance
!= expected
->AdvanceDistance
)
868 printf(" AdvanceDistance %d, expected %d\n", header
->AdvanceDistance
,
869 expected
->AdvanceDistance
);
871 if (header
->AdvanceMedia
!= expected
->AdvanceMedia
)
872 printf(" AdvanceMedia %d, expected %d\n", header
->AdvanceMedia
,
873 expected
->AdvanceMedia
);
875 if (header
->Collate
!= expected
->Collate
)
876 printf(" Collate %d, expected %d\n", header
->Collate
,
879 if (header
->CutMedia
!= expected
->CutMedia
)
880 printf(" CutMedia %d, expected %d\n", header
->CutMedia
,
883 if (header
->Duplex
!= expected
->Duplex
)
884 printf(" Duplex %d, expected %d\n", header
->Duplex
,
887 if (header
->HWResolution
[0] != expected
->HWResolution
[0] ||
888 header
->HWResolution
[1] != expected
->HWResolution
[1])
889 printf(" HWResolution [%d %d], expected [%d %d]\n",
890 header
->HWResolution
[0], header
->HWResolution
[1],
891 expected
->HWResolution
[0], expected
->HWResolution
[1]);
893 if (memcmp(header
->ImagingBoundingBox
, expected
->ImagingBoundingBox
,
894 sizeof(header
->ImagingBoundingBox
)))
895 printf(" ImagingBoundingBox [%d %d %d %d], expected [%d %d %d %d]\n",
896 header
->ImagingBoundingBox
[0],
897 header
->ImagingBoundingBox
[1],
898 header
->ImagingBoundingBox
[2],
899 header
->ImagingBoundingBox
[3],
900 expected
->ImagingBoundingBox
[0],
901 expected
->ImagingBoundingBox
[1],
902 expected
->ImagingBoundingBox
[2],
903 expected
->ImagingBoundingBox
[3]);
905 if (header
->InsertSheet
!= expected
->InsertSheet
)
906 printf(" InsertSheet %d, expected %d\n", header
->InsertSheet
,
907 expected
->InsertSheet
);
909 if (header
->Jog
!= expected
->Jog
)
910 printf(" Jog %d, expected %d\n", header
->Jog
,
913 if (header
->LeadingEdge
!= expected
->LeadingEdge
)
914 printf(" LeadingEdge %d, expected %d\n", header
->LeadingEdge
,
915 expected
->LeadingEdge
);
917 if (header
->Margins
[0] != expected
->Margins
[0] ||
918 header
->Margins
[1] != expected
->Margins
[1])
919 printf(" Margins [%d %d], expected [%d %d]\n",
920 header
->Margins
[0], header
->Margins
[1],
921 expected
->Margins
[0], expected
->Margins
[1]);
923 if (header
->ManualFeed
!= expected
->ManualFeed
)
924 printf(" ManualFeed %d, expected %d\n", header
->ManualFeed
,
925 expected
->ManualFeed
);
927 if (header
->MediaPosition
!= expected
->MediaPosition
)
928 printf(" MediaPosition %d, expected %d\n", header
->MediaPosition
,
929 expected
->MediaPosition
);
931 if (header
->MediaWeight
!= expected
->MediaWeight
)
932 printf(" MediaWeight %d, expected %d\n", header
->MediaWeight
,
933 expected
->MediaWeight
);
935 if (header
->MirrorPrint
!= expected
->MirrorPrint
)
936 printf(" MirrorPrint %d, expected %d\n", header
->MirrorPrint
,
937 expected
->MirrorPrint
);
939 if (header
->NegativePrint
!= expected
->NegativePrint
)
940 printf(" NegativePrint %d, expected %d\n", header
->NegativePrint
,
941 expected
->NegativePrint
);
943 if (header
->NumCopies
!= expected
->NumCopies
)
944 printf(" NumCopies %d, expected %d\n", header
->NumCopies
,
945 expected
->NumCopies
);
947 if (header
->Orientation
!= expected
->Orientation
)
948 printf(" Orientation %d, expected %d\n", header
->Orientation
,
949 expected
->Orientation
);
951 if (header
->OutputFaceUp
!= expected
->OutputFaceUp
)
952 printf(" OutputFaceUp %d, expected %d\n", header
->OutputFaceUp
,
953 expected
->OutputFaceUp
);
955 if (header
->PageSize
[0] != expected
->PageSize
[0] ||
956 header
->PageSize
[1] != expected
->PageSize
[1])
957 printf(" PageSize [%d %d], expected [%d %d]\n",
958 header
->PageSize
[0], header
->PageSize
[1],
959 expected
->PageSize
[0], expected
->PageSize
[1]);
961 if (header
->Separations
!= expected
->Separations
)
962 printf(" Separations %d, expected %d\n", header
->Separations
,
963 expected
->Separations
);
965 if (header
->TraySwitch
!= expected
->TraySwitch
)
966 printf(" TraySwitch %d, expected %d\n", header
->TraySwitch
,
967 expected
->TraySwitch
);
969 if (header
->Tumble
!= expected
->Tumble
)
970 printf(" Tumble %d, expected %d\n", header
->Tumble
,
973 if (header
->cupsWidth
!= expected
->cupsWidth
)
974 printf(" cupsWidth %d, expected %d\n", header
->cupsWidth
,
975 expected
->cupsWidth
);
977 if (header
->cupsHeight
!= expected
->cupsHeight
)
978 printf(" cupsHeight %d, expected %d\n", header
->cupsHeight
,
979 expected
->cupsHeight
);
981 if (header
->cupsMediaType
!= expected
->cupsMediaType
)
982 printf(" cupsMediaType %d, expected %d\n", header
->cupsMediaType
,
983 expected
->cupsMediaType
);
985 if (header
->cupsBitsPerColor
!= expected
->cupsBitsPerColor
)
986 printf(" cupsBitsPerColor %d, expected %d\n", header
->cupsBitsPerColor
,
987 expected
->cupsBitsPerColor
);
989 if (header
->cupsBitsPerPixel
!= expected
->cupsBitsPerPixel
)
990 printf(" cupsBitsPerPixel %d, expected %d\n", header
->cupsBitsPerPixel
,
991 expected
->cupsBitsPerPixel
);
993 if (header
->cupsBytesPerLine
!= expected
->cupsBytesPerLine
)
994 printf(" cupsBytesPerLine %d, expected %d\n", header
->cupsBytesPerLine
,
995 expected
->cupsBytesPerLine
);
997 if (header
->cupsColorOrder
!= expected
->cupsColorOrder
)
998 printf(" cupsColorOrder %d, expected %d\n", header
->cupsColorOrder
,
999 expected
->cupsColorOrder
);
1001 if (header
->cupsColorSpace
!= expected
->cupsColorSpace
)
1002 printf(" cupsColorSpace %d, expected %d\n", header
->cupsColorSpace
,
1003 expected
->cupsColorSpace
);
1005 if (header
->cupsCompression
!= expected
->cupsCompression
)
1006 printf(" cupsCompression %d, expected %d\n", header
->cupsCompression
,
1007 expected
->cupsCompression
);
1009 if (header
->cupsRowCount
!= expected
->cupsRowCount
)
1010 printf(" cupsRowCount %d, expected %d\n", header
->cupsRowCount
,
1011 expected
->cupsRowCount
);
1013 if (header
->cupsRowFeed
!= expected
->cupsRowFeed
)
1014 printf(" cupsRowFeed %d, expected %d\n", header
->cupsRowFeed
,
1015 expected
->cupsRowFeed
);
1017 if (header
->cupsRowStep
!= expected
->cupsRowStep
)
1018 printf(" cupsRowStep %d, expected %d\n", header
->cupsRowStep
,
1019 expected
->cupsRowStep
);
1021 if (header
->cupsNumColors
!= expected
->cupsNumColors
)
1022 printf(" cupsNumColors %d, expected %d\n", header
->cupsNumColors
,
1023 expected
->cupsNumColors
);
1025 if (header
->cupsBorderlessScalingFactor
!=
1026 expected
->cupsBorderlessScalingFactor
)
1027 printf(" cupsBorderlessScalingFactor %g, expected %g\n",
1028 header
->cupsBorderlessScalingFactor
,
1029 expected
->cupsBorderlessScalingFactor
);
1031 if (header
->cupsPageSize
[0] != expected
->cupsPageSize
[0] ||
1032 header
->cupsPageSize
[1] != expected
->cupsPageSize
[1])
1033 printf(" cupsPageSize [%g %g], expected [%g %g]\n",
1034 header
->cupsPageSize
[0], header
->cupsPageSize
[1],
1035 expected
->cupsPageSize
[0], expected
->cupsPageSize
[1]);
1037 if (header
->cupsImagingBBox
[0] != expected
->cupsImagingBBox
[0] ||
1038 header
->cupsImagingBBox
[1] != expected
->cupsImagingBBox
[1] ||
1039 header
->cupsImagingBBox
[2] != expected
->cupsImagingBBox
[2] ||
1040 header
->cupsImagingBBox
[3] != expected
->cupsImagingBBox
[3])
1041 printf(" cupsImagingBBox [%g %g %g %g], expected [%g %g %g %g]\n",
1042 header
->cupsImagingBBox
[0], header
->cupsImagingBBox
[1],
1043 header
->cupsImagingBBox
[2], header
->cupsImagingBBox
[3],
1044 expected
->cupsImagingBBox
[0], expected
->cupsImagingBBox
[1],
1045 expected
->cupsImagingBBox
[2], expected
->cupsImagingBBox
[3]);
1047 for (i
= 0; i
< 16; i
++)
1048 if (header
->cupsInteger
[i
] != expected
->cupsInteger
[i
])
1049 printf(" cupsInteger%d %d, expected %d\n", i
, header
->cupsInteger
[i
],
1050 expected
->cupsInteger
[i
]);
1052 for (i
= 0; i
< 16; i
++)
1053 if (header
->cupsReal
[i
] != expected
->cupsReal
[i
])
1054 printf(" cupsReal%d %g, expected %g\n", i
, header
->cupsReal
[i
],
1055 expected
->cupsReal
[i
]);
1057 for (i
= 0; i
< 16; i
++)
1058 if (strcmp(header
->cupsString
[i
], expected
->cupsString
[i
]))
1059 printf(" cupsString%d (%s), expected (%s)\n", i
,
1060 header
->cupsString
[i
], expected
->cupsString
[i
]);
1062 if (strcmp(header
->cupsMarkerType
, expected
->cupsMarkerType
))
1063 printf(" cupsMarkerType (%s), expected (%s)\n", header
->cupsMarkerType
,
1064 expected
->cupsMarkerType
);
1066 if (strcmp(header
->cupsRenderingIntent
, expected
->cupsRenderingIntent
))
1067 printf(" cupsRenderingIntent (%s), expected (%s)\n",
1068 header
->cupsRenderingIntent
,
1069 expected
->cupsRenderingIntent
);
1071 if (strcmp(header
->cupsPageSizeName
, expected
->cupsPageSizeName
))
1072 printf(" cupsPageSizeName (%s), expected (%s)\n",
1073 header
->cupsPageSizeName
,
1074 expected
->cupsPageSizeName
);
1079 * End of "$Id: testraster.c 7376 2008-03-19 21:07:45Z mike $".