14using namespace Magick;
16int main(
int ,
char ** argv)
20 InitializeMagick(*argv);
22 volatile int failures=0;
29 Color canvasColor(
"red" );
30 Image image( geometry, canvasColor);
37 if ( image.textAntiAlias() !=
true )
40 cout <<
"Line: " << __LINE__ <<
", textAntiAlias default not true" << endl;
44 image.textAntiAlias(
false );
45 if ( image.textAntiAlias() !=
false )
48 cout <<
"Line: " << __LINE__ <<
", textAntiAlias not false" << endl;
52 image.textAntiAlias(
true );
53 if ( image.textAntiAlias() !=
true )
56 cout <<
"Line: " << __LINE__ <<
", textAntiAlias not true" << endl;
64 if ( image.adjoin() !=
true )
67 cout <<
"Line: " << __LINE__
68 <<
", adjoin default not 'true' as expected" << endl;
72 image.adjoin(
false );
73 if ( image.adjoin() !=
false )
76 cout <<
"Line: " << __LINE__ <<
", adjoin failed set to 'false'" << endl;
81 if ( image.adjoin() !=
true )
84 cout <<
"Line: " << __LINE__ <<
", adjoin failed set to 'true'" << endl;
92 if ( image.animationDelay() != 0 )
95 cout <<
"Line: " << __LINE__ <<
", animationDelay default ("
96 << image.animationDelay()
97 <<
") not 0 as expected" << endl;
101 image.animationDelay( 0 );
102 if ( image.animationDelay() != 0 )
105 cout <<
"Line: " << __LINE__
106 <<
", failed to set animationDelay to 0" << endl;
110 image.animationDelay( 100 );
111 if ( image.animationDelay() != 100 )
114 cout <<
"Line: " << __LINE__
115 <<
", failed to set animationDelay to 100" << endl;
117 image.animationDelay(0);
124 if ( image.animationIterations() != 0 )
127 cout <<
"Line: " << __LINE__
128 <<
", animationIterations default ("
129 << image.animationIterations()
130 <<
") not 0 as expected" << endl;
134 image.animationIterations( 0 );
135 if ( image.animationIterations() != 0 )
138 cout <<
"Line: " << __LINE__
139 <<
", failed to set animationIterations to 0" << endl;
143 image.animationIterations( 100 );
144 if ( image.animationIterations() != 100 )
147 cout <<
"Line: " << __LINE__
148 <<
", failed to set animationIterations to 100" << endl;
150 image.animationIterations( 0 );
157 if (
string(image.backgroundColor()) !=
string(
ColorRGB(
"white")) )
160 cout <<
"Line: " << __LINE__ <<
", backgroundColor default ("
161 << string(image.backgroundColor())
162 <<
") is incorrect" << endl;
166 image.backgroundColor(
"blue");
167 if ( !image.backgroundColor().isValid() )
170 cout <<
"Line: " << __LINE__ <<
", backgroundColor ("
171 << string(image.backgroundColor())
172 <<
") failed set to 'blue'" << endl;
175 if (
string(image.backgroundColor()) !=
"#0000FF" &&
176 string(image.backgroundColor()) !=
"#00000000FFFF" &&
177 string(image.backgroundColor()) !=
"#0000000000000000FFFFFFFF" &&
178 string(image.backgroundColor()) !=
"#00000000000000000000000000000000FFFFFFFFFFFFFFFF" )
181 cout <<
"Line: " << __LINE__ <<
", backgroundColor ("
182 << string(image.backgroundColor()) <<
") is incorrect"
187 image.backgroundColor(
"#00AAFF");
188 if ( !image.backgroundColor().isValid() )
191 cout <<
"Line: " << __LINE__ <<
", backgroundColor ("
192 << string(image.backgroundColor())
193 <<
") is incorrectly invalid" << endl;
196 if (
string(image.backgroundColor()) !=
"#00AAFF" &&
197 string(image.backgroundColor()) !=
"#0000AAAAFFFF" &&
198 string(image.backgroundColor()) !=
"#00000000AAAAAAAAFFFFFFFF" &&
199 string(image.backgroundColor()) !=
"#0000000000000000AAAAAAAAAAAAAAAAFFFFFFFFFFFFFFFF" )
202 cout <<
"Line: " << __LINE__
203 <<
", backgroundColor ("
204 << string(image.backgroundColor())
214 if ( image.backgroundTexture() !=
"" )
217 cout <<
"Line: " << __LINE__ <<
", backgroundTexture default ("
218 << image.backgroundTexture()
219 <<
") is incorrect" << endl;
223 image.backgroundTexture(
"afile.jpg");
224 if ( image.backgroundTexture() !=
"afile.jpg" )
227 cout <<
"Line: " << __LINE__ <<
", backgroundTexture ("
228 << image.backgroundTexture()
229 <<
") is incorrect" << endl;
233 image.backgroundTexture(
"");
234 if ( image.backgroundTexture() !=
"" )
237 cout <<
"Line: " << __LINE__
238 <<
", backgroundTexture ("
239 << image.backgroundTexture()
240 <<
") failed to set to \"\"" << endl;
246 if ( image.baseColumns() != columns )
249 cout <<
"Line: " << __LINE__
251 << image.baseColumns()
252 <<
") is not equal to "
263 if ( image.baseFilename() !=
"xc:#FF0000" &&
264 image.baseFilename() !=
"xc:#FFFF00000000" &&
265 image.baseFilename() !=
"xc:#FFFFFFFF0000000000000000" &&
266 image.baseFilename() !=
"xc:#FFFFFFFFFFFFFFFF00000000000000000000000000000000")
269 cout <<
"Line: " << __LINE__
270 <<
", baseFilename ("
271 << image.baseFilename()
279 if ( image.baseRows() != rows )
282 cout <<
"Line: " << __LINE__
294 if ( image.borderColor() !=
ColorRGB(
"#dfdfdf") )
297 cout <<
"Line: " << __LINE__
298 <<
", borderColor default ("
299 << string(image.borderColor())
300 <<
") is incorrect" << endl;
303 image.borderColor(
"#FF0000");
304 if ( image.borderColor() !=
Color(
"#FF0000") )
307 cout <<
"Line: " << __LINE__
308 <<
", failed to set borderColor ("
309 << string(image.borderColor())
313 image.borderColor(
"black");
314 if ( image.borderColor() !=
Color(
"#000000") )
317 cout <<
"Line: " << __LINE__
318 <<
", failed to set borderColor ("
319 << string(image.borderColor())
327 image.boxColor(
"#FF0000");
328 if ( image.boxColor() !=
Color(
"#FF0000") )
331 cout <<
"Line: " << __LINE__
332 <<
", failed to set boxColor ("
333 << string(image.boxColor())
338 image.boxColor(
"black");
339 if ( image.boxColor() !=
Color(
"#000000") )
342 cout <<
"Line: " << __LINE__
343 <<
", failed to set boxColor ("
344 << string(image.boxColor())
355 image.chromaBluePrimary(&x, &y, &z);
356 if ( x == 0.0f || y == 0.0f )
359 cout <<
"Line: " << __LINE__
360 <<
", chromaBluePrimary x/y defaults are zero"
365 image.chromaBluePrimary(50, 100, 150 );
366 image.chromaBluePrimary(&x, &y, &z);
367 if ( x != 50 || y != 100 || z != 150 )
370 cout <<
"Line: " << __LINE__
371 <<
", chromaBluePrimary x/y failed set/get" << endl;
381 image.chromaGreenPrimary(&x, &y, &z);
382 if ( x == 0.0f || y == 0.0f )
385 cout <<
"Line: " << __LINE__
386 <<
", chromaGreenPrimary x/y defaults are zero" << endl;
390 image.chromaGreenPrimary(50, 100, 150);
391 image.chromaGreenPrimary(&x, &y, &z);
392 if (x != 50 || y != 100 || z != 150)
395 cout <<
"Line: " << __LINE__
396 <<
", chromaGreenPrimary x/y failed set/get" << endl;
406 image.chromaRedPrimary(&x, &y, &z);
407 if ( x == 0.0f || y == 0.0f )
410 cout <<
"Line: " << __LINE__
411 <<
", chromaRedPrimary x/y defaults are zero" << endl;
415 image.chromaRedPrimary(50, 100, 150);
416 image.chromaRedPrimary(&x, &y, &z);
417 if (x != 50 || y != 100 || z != 150)
420 cout <<
"Line: " << __LINE__
421 <<
", chromaRedPrimary x/y failed set/get" << endl;
431 image.chromaWhitePoint(&x, &y, &z);
432 if ( x == 0.0f || y == 0.0f )
435 cout <<
"Line: " << __LINE__
436 <<
", chromaWhitePoint x/y defaults are zero" << endl;
440 image.chromaWhitePoint(50, 100, 150);
441 image.chromaWhitePoint(&x, &y, &z);
442 if (x != 50 || y != 100 || z != 150)
445 cout <<
"Line: " << __LINE__
446 <<
", chromaWhitePoint x/y failed set/get" << endl;
453 if ( image.classType() != DirectClass )
456 cout <<
"Line: " << __LINE__ <<
", classType is not DirectClass" << endl;
464 if ( image.colorFuzz() != 0 )
467 cout <<
"Line: " << __LINE__ <<
", colorFuzz default is non-zero" << endl;
471 image.colorFuzz( 2 );
472 if ( image.colorFuzz() != 2 )
475 cout <<
"Line: " << __LINE__ <<
", colorFuzz failed to set/get" << endl;
477 image.colorFuzz( 0 );
482 if ( image.columns() != columns )
485 cout <<
"Line: " << __LINE__
486 <<
", columns is not equal to canvas image columns" << endl;
493 if ( image.comment().length() != 0 )
496 cout <<
"Line: " << __LINE__
497 <<
", comment default non-zero length" << endl;
502 std::string comment(
"This is a comment.");
503 image.comment( comment );
504 if ( image.comment() != comment )
507 cout <<
"Line: " << __LINE__ <<
", comment set/get failed" << endl;
512 image.comment(
string() );
513 if ( image.comment().length() != 0 )
516 cout <<
"Line: " << __LINE__ <<
", comment failed to reset" << endl;
523 if ( image.compressType() != UndefinedCompression )
526 cout <<
"Line: " << __LINE__
527 <<
", compressType default is incorrect" << endl;
531 image.compressType(RLECompression);
532 if ( image.compressType() != RLECompression )
535 cout <<
"Line: " << __LINE__ <<
", compressType set/get failed" << endl;
537 image.compressType(UndefinedCompression);
544 if ( image.density() !=
Point(72) )
547 cout <<
"Line: " << __LINE__
548 <<
", density default is not 72x72 as expected" << endl;
552 Point density(150,75);
553 image.density(density);
554 if ( image.density() != density )
557 cout <<
"Line: " << __LINE__ <<
", density set/get failed" << endl;
561 if ( image.xResolution() != 150 ||
562 image.yResolution() != 75 )
565 cout <<
"Line: " << __LINE__ <<
", density set/get failed" << endl;
568 image.density(
"72x72");
575 if (image.defineSet(
"foo",
"bar"))
578 cout <<
"Line: " << __LINE__
579 <<
", define for foo:bar incorrectly reports set."
583 image.defineSet(
"foo",
"bar",
true);
584 if (!image.defineSet(
"foo",
"bar"))
587 cout <<
"Line: " << __LINE__
588 <<
", define for foo:bar incorrectly reports not set."
592 image.defineSet(
"foo",
"bar",
false);
593 if (image.defineSet(
"foo",
"bar"))
596 cout <<
"Line: " << __LINE__
597 <<
", define for foo:bar incorrectly reports set."
601 image.defineValue(
"foo",
"bar",
"value");
602 std::string value = image.defineValue(
"foo",
"bar");
603 if (image.defineValue(
"foo",
"bar") !=
"value")
606 cout <<
"Line: " << __LINE__
607 <<
", define for foo:bar incorrectly reports value \""
612 image.defineSet(
"foo",
"bar",
false);
613 if (image.defineSet(
"foo",
"bar"))
616 cout <<
"Line: " << __LINE__
617 <<
", define for foo:bar incorrectly reports set."
624 if ( image.depth() != MAGICKCORE_QUANTUM_DEPTH )
627 cout <<
"Line: " << __LINE__
630 <<
") is not equal to " << MAGICKCORE_QUANTUM_DEPTH << endl;
638 bool caughtException =
false;
639 cout <<
"Testing throwing and catching exceptions. A program crash or a message" << endl
640 <<
"that the exception was not caught indicates a test failure. A properly" << endl
641 <<
"formatted exception message indicates success:" << endl;
649 cout <<
"Caught exception, good!:" << endl
650 <<
" \"" << exception_.what() <<
"\"" << endl;
651 caughtException =
true;
653 if ( caughtException !=
true )
656 cout <<
"failed to catch exception!" << endl;
664 if ( image.fileName() !=
string(
"xc:") +
string(canvasColor) )
671 <<
") is not canvas color ("
672 << string(canvasColor)
673 <<
") as expected" << endl;
677 image.fileName(
"filename.jpg");
678 if ( image.fileName() !=
"filename.jpg" )
685 <<
") failed to set/get" << endl;
687 image.fileName(canvasColor);
693 if ( image.fileSize() != 0 )
696 cout <<
"Line: " << __LINE__ <<
", fileSize ("
697 <<
static_cast<ssize_t
>(image.fileSize())
698 <<
") is not zero as expected" << endl;
705 if ( image.filterType() != UndefinedFilter )
708 cout <<
"Line: " << __LINE__
709 <<
", filterType default ("
710 << (int)image.filterType()
711 <<
") is incorrect" << endl;
715 image.filterType( TriangleFilter );
716 if ( image.filterType() != TriangleFilter )
719 cout <<
"Line: " << __LINE__ <<
", filterType set/get failed"
728 image.font(
"helvetica");
729 if ( image.font() !=
"helvetica" )
732 cout <<
"Line: " << __LINE__ <<
", font set/get failed" << endl;
735 image.font(
string() );
736 if ( image.font().length() != 0 )
739 cout <<
"Line: " << __LINE__ <<
", font failed to unset" << endl;
746 if ( image.fontPointsize() != 0 )
749 cout <<
"Line: " << __LINE__
750 <<
", fontPointsize ("
751 << image.fontPointsize()
752 <<
") is not default of 0 as expected"
757 image.fontPointsize(10);
758 if ( image.fontPointsize() != 10 )
761 cout <<
"Line: " << __LINE__
762 <<
", fontPointsize set/get failed" << endl;
764 image.fontPointsize(12);
769 if ( image.format() !=
"Constant image uniform color" )
772 cout <<
"Line: " << __LINE__
773 <<
", format (" << image.format() <<
") is not expected value" << endl;
779 if ( image.gamma() == 1.0f)
782 cout <<
"Line: " << __LINE__
783 <<
", gamma correction is unity as expected" << endl;
790 bool caughtException =
false;
797 caughtException =
true;
799 if ( caughtException !=
true )
802 cout <<
"Line: " << __LINE__
803 <<
", geometry failed to report missing image geometry";
811 if ( image.gifDisposeMethod() != 0 )
814 cout <<
"Line: " << __LINE__
815 <<
", gifDisposeMethod default is not zero as expected" << endl;
819 image.gifDisposeMethod(BackgroundDispose);
820 if ( image.gifDisposeMethod() != BackgroundDispose )
823 cout <<
"Line: " << __LINE__
824 <<
", gifDisposeMethod set/get failed" << endl;
826 image.gifDisposeMethod(UndefinedDispose);
832 if ( image.interlaceType() != NoInterlace )
835 cout <<
"Line: " << __LINE__
836 <<
", interlaceType default is not NoInterlace as expected" << endl;
840 image.interlaceType( PlaneInterlace );
841 if ( image.interlaceType() != PlaneInterlace )
844 cout <<
"Line: " << __LINE__ <<
", interlaceType set/get failed" << endl;
846 image.interlaceType(NoInterlace);
852 if ( image.label().length() != 0 )
855 cout <<
"Line: " << __LINE__
856 <<
", label default is not empty string as expected" << endl;
860 image.label(
"How now brown cow?");
861 if ( image.label() !=
"How now brown cow?" )
864 cout <<
"Line: " << __LINE__ <<
", label set/get failed" << endl;
867 image.label(
string() );
868 if ( image.label().length() != 0 )
871 cout <<
"Line: " << __LINE__ <<
", label failed to unset" << endl;
878 if ( image.strokeWidth() != 1 )
881 cout <<
"Line: " << __LINE__
882 <<
", strokeWidth default is not 1 as expected" << endl;
886 image.strokeWidth(2);
887 if ( image.strokeWidth() != 2 )
890 cout <<
"Line: " << __LINE__ <<
", strokeWidth set/get failed" << endl;
892 image.strokeWidth(1);
898 if ( image.magick() !=
"XC" )
901 cout <<
"Line: " << __LINE__
902 <<
", magick canvas default is not XC as expected" << endl;
907 if ( image.magick() !=
"GIF" )
910 cout <<
"Line: " << __LINE__ <<
", magick set/get failed" << endl;
919 if ( image.alpha() != false )
922 cout <<
"Line: " << __LINE__
923 <<
", alpha default is not false as expected" << endl;
928 if ( image.alpha() != true )
931 cout <<
"Line: " << __LINE__ <<
", alpha set/get failed" << endl;
939 if ( image.matteColor() !=
Color(
"#BDBDBD") )
942 cout <<
"Line: " << __LINE__
943 <<
", matteColor default is not #BDBDBD as expected" << endl;
947 image.matteColor(
ColorRGB(0.5,0.5,1));
948 if ( image.matteColor() !=
ColorRGB(0.5,0.5,1) )
951 cout <<
"Line: " << __LINE__ <<
", matteColor set/get failed" << endl;
955 image.matteColor(
Color() );
957 image.matteColor(
"#BDBDBD");
962 if ( image.meanErrorPerPixel() != 0 )
965 cout <<
"Line: " << __LINE__
966 <<
", meanErrorPerPixel is not zero as expected" << endl;
973 bool caughtException =
false;
976 image.montageGeometry();
980 caughtException =
true;
982 if ( caughtException !=
true )
985 cout <<
"Line: " << __LINE__
986 <<
", montageGeometry failed to report missing montage geometry";
994 if ( image.monochrome() != false )
997 cout <<
"Line: " << __LINE__
998 <<
", monochrome is not false as expected" << endl;
1002 image.monochrome(
true);
1003 if ( image.monochrome() != true )
1006 cout <<
"Line: " << __LINE__ <<
", monochrome get/set failed" << endl;
1008 image.monochrome(
false);
1013 if ( image.normalizedMaxError() != 0 )
1016 cout <<
"Line: " << __LINE__
1017 <<
",normalizedMaxError is not zero as expected" << endl;
1023 if ( image.normalizedMeanError() != 0 )
1026 cout <<
"Line: " << __LINE__
1027 <<
", normalizedMeanError is not zero as expected" << endl;
1034 image.strokeColor(
ColorRGB(0.5,0.5,1));
1035 if ( image.strokeColor() !=
ColorRGB(0.5,0.5,1) )
1038 cout <<
"Line: " << __LINE__ <<
", strokeColor ("
1039 << string(image.strokeColor())
1040 <<
") set/get failed" << endl;
1048 image.fillColor(
ColorRGB(0.5,0.5,1));
1049 if ( image.fillColor() !=
ColorRGB(0.5,0.5,1) )
1052 cout <<
"Line: " << __LINE__ <<
", fillColor ("
1053 << string(image.fillColor())
1054 <<
") set/get failed" << endl;
1061 if ( image.pixelColor(40,60) !=
string(canvasColor) )
1064 cout <<
"Line: " << __LINE__ <<
", pixelColor default ("
1065 << string(image.pixelColor(40,60))
1066 <<
") is not canvas color ("
1067 << string(canvasColor)
1068 <<
") as expected" << endl;
1072 image.pixelColor(40,60,
ColorRGB(0.5,1,1));
1073 if ( image.pixelColor(40,60) !=
ColorRGB(0.5,1,1) )
1076 cout <<
"Line: " << __LINE__ <<
", pixelColor set/get failed" << endl;
1083 if ( image.page() !=
Geometry(640,480,0,0) )
1086 cout <<
"Line: " << __LINE__ <<
", page default "
1087 <<
"(" << string(image.page()) <<
")"
1088 <<
" is not 640x480 as expected" << endl;
1092 image.page(
"letter+43+43>");
1093 if ( image.page() !=
"612x792+43+43" )
1096 cout <<
"Line: " << __LINE__
1097 <<
", page set/get failed (" << string(image.page()) <<
")" << endl;
1104 if ( image.quality() != 0 )
1107 cout <<
"Line: " << __LINE__
1108 <<
", quality default is not 0 as expected" << endl;
1113 if ( image.quality() != 65 )
1116 cout <<
"Line: " << __LINE__ <<
", quality set/get failed" << endl;
1124 if ( image.quantizeColors() != 256 )
1127 cout <<
"Line: " << __LINE__
1128 <<
", quantizeColors is not 256 as expected" << endl;
1132 image.quantizeColors(200);
1133 if ( image.quantizeColors() != 200 )
1136 cout <<
"Line: " << __LINE__ <<
", quantizeColors set/get failed" << endl;
1138 image.quantizeColors(0);
1144 if ( image.quantizeColorSpace() != UndefinedColorspace )
1147 cout <<
"Line: " << __LINE__
1148 <<
", quantizeColorSpace is not RGBColorspace as expected" << endl;
1152 image.quantizeColorSpace(YIQColorspace);
1153 if ( image.quantizeColorSpace() != YIQColorspace )
1156 cout <<
"Line: " << __LINE__
1157 <<
", quantizeColorSpace set/get failed" << endl;
1159 image.quantizeColorSpace(RGBColorspace);
1165 if ( image.quantizeDither() ==
false )
1168 cout <<
"Line: " << __LINE__
1169 <<
", quantizeDither is not false as expected" << endl;
1173 image.quantizeDither(
false);
1174 if ( image.quantizeDither() !=
false )
1177 cout <<
"Line: " << __LINE__
1178 <<
", quantizeDither get/set failed" << endl;
1180 image.quantizeDither(
true);
1185 if ( image.quantizeTreeDepth() != 0 )
1188 cout <<
"Line: " << __LINE__ <<
", quantizeTreeDepth default is "
1189 << image.quantizeTreeDepth()
1190 <<
" rather than zero as expected" << endl;
1193 image.quantizeTreeDepth(7);
1194 if ( image.quantizeTreeDepth() != 7 )
1197 cout <<
"Line: " << __LINE__
1198 <<
", quantizeTreeDepth set/get failed" << endl;
1200 image.quantizeTreeDepth(8);
1205 if ( image.renderingIntent() == UndefinedIntent )
1208 cout <<
"Line: " << __LINE__
1209 <<
", renderingIntent default is UndefinedIntent as expected"
1213 image.renderingIntent(PerceptualIntent);
1214 if ( image.renderingIntent() != PerceptualIntent )
1217 cout <<
"Line: " << __LINE__
1218 <<
", renderingIntent set/get failed" << endl;
1220 image.renderingIntent(UndefinedIntent);
1225 if ( image.resolutionUnits() != UndefinedResolution )
1228 cout <<
"Line: " << __LINE__
1229 <<
", resolutionUnits default is not UndefinedResolution as expected"
1233 image.resolutionUnits(PixelsPerCentimeterResolution);
1234 if ( image.resolutionUnits() != PixelsPerCentimeterResolution )
1237 cout <<
"Line: " << __LINE__
1238 <<
", resolutionUnits set/get failed" << endl;
1240 image.resolutionUnits(UndefinedResolution);
1245 if ( image.rows() != rows )
1248 cout <<
"Line: " << __LINE__
1249 <<
", rows is canvas rows as expected" << endl;
1255 if ( image.scene() != 0 )
1258 cout <<
"Line: " << __LINE__
1259 <<
", scene default is not zero as expected" << endl;
1263 if ( image.scene() != 5 )
1266 cout <<
"Line: " << __LINE__
1267 <<
", scene set/get failed" << endl;
1276 ( image.signature() !=
"6b08f7559b92760e8945b924f514a2e997753eb4408ddf571dd5222a782b8b48") &&
1277 ( image.signature() !=
"5e32612a0a3f2f1632d135f8c2df360604b0b84e9f082ddc20efbb0de752a53e") &&
1278 ( image.signature() !=
"dba5480face4d9eb973a116fe32ef37a7b47211e563900d21f47d6f0904aba22") &&
1279 ( image.signature() !=
"eccb7a8ac230b0deb76c8dd10ddeeb76a0918cbe6e3469d2d9f223d35c66498b") &&
1280 ( image.signature() !=
"a0747a8a5a0e6a1ec960ab8994986ba087d518db97db6f17e7bb4da3bbc3c91d") &&
1281 ( image.signature() !=
"6857675cd7d967e1e3ff094e1b3e5f4bb3fb9ba2557eb6d083d37881db0a2039")
1285 cout <<
"Line: " << __LINE__ <<
", signature ("
1286 << image.signature()
1287 <<
") is incorrect" << endl;
1294 if ( image.size() != geometry )
1297 cout <<
"Line: " << __LINE__ <<
", size ("
1298 << string(image.size())
1299 <<
") is not equal to geometry ("
1305 image.size(
"800x600");
1306 if ( image.size() !=
Geometry(
"800x600") )
1309 cout <<
"Line: " << __LINE__ <<
", size set/get failed" << endl;
1311 image.size( geometry );
1316 if ( image.subImage() != 0 )
1319 cout <<
"Line: " << __LINE__
1320 <<
", subImage default is not zero as expected" << endl;
1324 if ( image.subImage() != 5 )
1327 cout <<
"Line: " << __LINE__
1328 <<
", subImage set/get failed" << endl;
1335 if ( image.subRange() != 0 )
1338 cout <<
"Line: " << __LINE__
1339 <<
", subRange default is not zero as expected" << endl;
1343 if ( image.subRange() != 5 )
1346 cout <<
"Line: " << __LINE__
1347 <<
", subRange set/get failed" << endl;
1354 if ( image.totalColors() != 2 )
1357 cout <<
"Line: " << __LINE__ <<
", totalColors is " << image.totalColors()
1358 <<
" rather than 2 as expected" << endl;
1364 image.type(PaletteType);
1365 if ( image.type() != PaletteType )
1368 cout <<
"Line: " << __LINE__
1369 <<
", type is not PaletteType as expected. Reported type "
1370 << (int) image.type() << endl;
1377 if ( image.verbose() != false )
1380 cout <<
"Line: " << __LINE__
1381 <<
", verbose is not false as expected" << endl;
1387 if ( image.x11Display().length() != 0 )
1390 cout <<
"Line: " << __LINE__
1391 <<
", x11Display default is not empty string as expected" << endl;
1394 image.x11Display(
":0.0");
1395 if ( image.x11Display() !=
":0.0" )
1398 cout <<
"Line: " << __LINE__
1399 <<
", x11Display set/get failed" << endl;
1402 image.x11Display(
string() );
1403 if ( image.x11Display().length() != 0 )
1406 cout <<
"Line: " << __LINE__
1407 <<
", x11Display failed to unset" << endl;
1413 if ( image.xResolution() != 72 )
1416 cout <<
"Line: " << __LINE__
1417 <<
", xResolution default (" << image.xResolution()
1418 <<
") is not zero as expected" << endl;
1424 if ( image.yResolution() != 72 )
1427 cout <<
"Line: " << __LINE__
1428 <<
", yResolution default (" << image.yResolution()
1429 <<
") is not zero as expected" << endl;
1434 cout <<
"Caught exception: " << error_.what() << endl;
1437 catch( exception &error_ )
1439 cout <<
"Caught exception: " << error_.what() << endl;
1445 cout << failures <<
" failures" << endl;