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.antiAlias() !=
true )
40 cout <<
"Line: " << __LINE__ <<
", antiAlias default not true" << endl;
44 image.antiAlias(
false );
45 if ( image.antiAlias() !=
false )
48 cout <<
"Line: " << __LINE__ <<
", antiAlias not false" << endl;
52 image.antiAlias(
true );
53 if ( image.antiAlias() !=
true )
56 cout <<
"Line: " << __LINE__ <<
", antiAlias 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 (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" )
180 cout <<
"Line: " << __LINE__ <<
", backgroundColor ("
181 << string(image.backgroundColor()) <<
") is incorrect"
186 image.backgroundColor(
"#00AAFF");
187 if ( !image.backgroundColor().isValid() )
190 cout <<
"Line: " << __LINE__ <<
", backgroundColor ("
191 << string(image.backgroundColor())
192 <<
") is incorrectly invalid" << endl;
195 if (
string(image.backgroundColor()) !=
"#00AAFF" &&
196 string(image.backgroundColor()) !=
"#0000AAAAFFFF" &&
197 string(image.backgroundColor()) !=
"#00000000AAAAAAAAFFFFFFFF" )
200 cout <<
"Line: " << __LINE__
201 <<
", backgroundColor ("
202 << string(image.backgroundColor())
212 if ( image.backgroundTexture() !=
"" )
215 cout <<
"Line: " << __LINE__ <<
", backgroundTexture default ("
216 << image.backgroundTexture()
217 <<
") is incorrect" << endl;
221 image.backgroundTexture(
"afile.jpg");
222 if ( image.backgroundTexture() !=
"afile.jpg" )
225 cout <<
"Line: " << __LINE__ <<
", backgroundTexture ("
226 << image.backgroundTexture()
227 <<
") is incorrect" << endl;
231 image.backgroundTexture(
"");
232 if ( image.backgroundTexture() !=
"" )
235 cout <<
"Line: " << __LINE__
236 <<
", backgroundTexture ("
237 << image.backgroundTexture()
238 <<
") failed to set to \"\"" << endl;
244 if ( image.baseColumns() != columns )
247 cout <<
"Line: " << __LINE__
249 << image.baseColumns()
250 <<
") is not equal to "
261 if ( image.baseFilename() !=
"xc:#FF0000" &&
262 image.baseFilename() !=
"xc:#FFFF00000000" &&
263 image.baseFilename() !=
"xc:#FFFFFFFF0000000000000000")
266 cout <<
"Line: " << __LINE__
267 <<
", baseFilename ("
268 << image.baseFilename()
276 if ( image.baseRows() != rows )
279 cout <<
"Line: " << __LINE__
291 if ( image.borderColor() !=
ColorRGB(
"#dfdfdf") )
294 cout <<
"Line: " << __LINE__
295 <<
", borderColor default ("
296 << string(image.borderColor())
297 <<
") is incorrect" << endl;
300 image.borderColor(
"#FF0000");
301 if ( image.borderColor() !=
Color(
"#FF0000") )
304 cout <<
"Line: " << __LINE__
305 <<
", failed to set borderColor ("
306 << string(image.borderColor())
310 image.borderColor(
"black");
311 if ( image.borderColor() !=
Color(
"#000000") )
314 cout <<
"Line: " << __LINE__
315 <<
", failed to set borderColor ("
316 << string(image.borderColor())
324 image.boxColor(
"#FF0000");
325 if ( image.boxColor() !=
Color(
"#FF0000") )
328 cout <<
"Line: " << __LINE__
329 <<
", failed to set boxColor ("
330 << string(image.boxColor())
335 image.boxColor(
"black");
336 if ( image.boxColor() !=
Color(
"#000000") )
339 cout <<
"Line: " << __LINE__
340 <<
", failed to set boxColor ("
341 << string(image.boxColor())
352 image.chromaBluePrimary( &x, &y );
353 if ( x == 0.0f || y == 0.0f )
356 cout <<
"Line: " << __LINE__
357 <<
", chromaBluePrimary x/y defaults are zero"
362 image.chromaBluePrimary( 50, 100 );
363 image.chromaBluePrimary( &x, &y );
364 if ( x != 50 || y != 100 )
367 cout <<
"Line: " << __LINE__
368 <<
", chromaBluePrimary x/y failed set/get" << endl;
378 image.chromaGreenPrimary( &x, &y );
379 if ( x == 0.0f || y == 0.0f )
382 cout <<
"Line: " << __LINE__
383 <<
", chromaGreenPrimary x/y defaults are zero" << endl;
387 image.chromaGreenPrimary( 50, 100 );
388 image.chromaGreenPrimary( &x, &y );
389 if ( x != 50 || y != 100 )
392 cout <<
"Line: " << __LINE__
393 <<
", chromaGreenPrimary x/y failed set/get" << endl;
403 image.chromaRedPrimary( &x, &y );
404 if ( x == 0.0f || y == 0.0f )
407 cout <<
"Line: " << __LINE__
408 <<
", chromaRedPrimary x/y defaults are zero" << endl;
412 image.chromaRedPrimary( 50, 100 );
413 image.chromaRedPrimary( &x, &y );
414 if ( x != 50 || y != 100 )
417 cout <<
"Line: " << __LINE__
418 <<
", chromaRedPrimary x/y failed set/get" << endl;
428 image.chromaWhitePoint( &x, &y );
429 if ( x == 0.0f || y == 0.0f )
432 cout <<
"Line: " << __LINE__
433 <<
", chromaWhitePoint x/y defaults are zero" << endl;
437 image.chromaWhitePoint( 50, 100 );
438 image.chromaWhitePoint( &x, &y );
439 if ( x != 50 || y != 100 )
442 cout <<
"Line: " << __LINE__
443 <<
", chromaWhitePoint x/y failed set/get" << endl;
450 if ( image.classType() != DirectClass )
453 cout <<
"Line: " << __LINE__ <<
", classType is not DirectClass" << endl;
461 if ( image.colorFuzz() != 0 )
464 cout <<
"Line: " << __LINE__ <<
", colorFuzz default is non-zero" << endl;
468 image.colorFuzz( 2 );
469 if ( image.colorFuzz() != 2 )
472 cout <<
"Line: " << __LINE__ <<
", colorFuzz failed to set/get" << endl;
474 image.colorFuzz( 0 );
479 if ( image.columns() != columns )
482 cout <<
"Line: " << __LINE__
483 <<
", columns is not equal to canvas image columns" << endl;
490 if ( image.comment().length() != 0 )
493 cout <<
"Line: " << __LINE__
494 <<
", comment default non-zero length" << endl;
499 std::string comment(
"This is a comment.");
500 image.comment( comment );
501 if ( image.comment() != comment )
504 cout <<
"Line: " << __LINE__ <<
", comment set/get failed" << endl;
509 image.comment(
string() );
510 if ( image.comment().length() != 0 )
513 cout <<
"Line: " << __LINE__ <<
", comment failed to reset" << endl;
520 if ( image.compressType() != UndefinedCompression )
523 cout <<
"Line: " << __LINE__
524 <<
", compressType default is incorrect" << endl;
528 image.compressType(RLECompression);
529 if ( image.compressType() != RLECompression )
532 cout <<
"Line: " << __LINE__ <<
", compressType set/get failed" << endl;
534 image.compressType(UndefinedCompression);
541 if ( image.density() !=
Geometry(72,72) )
544 cout <<
"Line: " << __LINE__
545 <<
", density default is not 72x72 as expected" << endl;
550 image.density(density);
551 if ( image.density() != density )
554 cout <<
"Line: " << __LINE__ <<
", density set/get failed" << endl;
558 if ( image.xResolution() != 150 ||
559 image.yResolution() != 75 )
562 cout <<
"Line: " << __LINE__ <<
", density set/get failed" << endl;
565 image.density(
"72x72");
572 if (image.defineSet(
"foo",
"bar"))
575 cout <<
"Line: " << __LINE__
576 <<
", define for foo:bar incorrectly reports set."
580 image.defineSet(
"foo",
"bar",
true);
581 if (!image.defineSet(
"foo",
"bar"))
584 cout <<
"Line: " << __LINE__
585 <<
", define for foo:bar incorrectly reports not set."
589 image.defineSet(
"foo",
"bar",
false);
590 if (image.defineSet(
"foo",
"bar"))
593 cout <<
"Line: " << __LINE__
594 <<
", define for foo:bar incorrectly reports set."
598 image.defineValue(
"foo",
"bar",
"value");
599 std::string value = image.defineValue(
"foo",
"bar");
600 if (image.defineValue(
"foo",
"bar") !=
"value")
603 cout <<
"Line: " << __LINE__
604 <<
", define for foo:bar incorrectly reports value \""
609 image.defineSet(
"foo",
"bar",
false);
610 if (image.defineSet(
"foo",
"bar"))
613 cout <<
"Line: " << __LINE__
614 <<
", define for foo:bar incorrectly reports set."
621 if ( image.depth() != MAGICKCORE_QUANTUM_DEPTH )
624 cout <<
"Line: " << __LINE__
627 <<
") is not equal to " << MAGICKCORE_QUANTUM_DEPTH << endl;
635 bool caughtException =
false;
636 cout <<
"Testing throwing and catching exceptions. A program crash or a message" << endl
637 <<
"that the exception was not caught indicates a test failure. A properly" << endl
638 <<
"formatted exception message indicates success:" << endl;
646 cout <<
"Caught exception, good!:" << endl
647 <<
" \"" << exception_.what() <<
"\"" << endl;
648 caughtException =
true;
650 if ( caughtException !=
true )
653 cout <<
"failed to catch exception!" << endl;
661 if ( image.fileName() !=
string(
"xc:") +
string(canvasColor) )
668 <<
") is not canvas color ("
669 << string(canvasColor)
670 <<
") as expected" << endl;
674 image.fileName(
"filename.jpg");
675 if ( image.fileName() !=
"filename.jpg" )
682 <<
") failed to set/get" << endl;
684 image.fileName(canvasColor);
690 if ( image.fileSize() != 0 )
693 cout <<
"Line: " << __LINE__ <<
", fileSize ("
694 <<
static_cast<ssize_t
>(image.fileSize())
695 <<
") is not zero as expected" << endl;
702 if ( image.filterType() != UndefinedFilter )
705 cout <<
"Line: " << __LINE__
706 <<
", filterType default ("
707 << (int)image.filterType()
708 <<
") is incorrect" << endl;
712 image.filterType( TriangleFilter );
713 if ( image.filterType() != TriangleFilter )
716 cout <<
"Line: " << __LINE__ <<
", filterType set/get failed"
725 image.font(
"helvetica");
726 if ( image.font() !=
"helvetica" )
729 cout <<
"Line: " << __LINE__ <<
", font set/get failed" << endl;
732 image.font(
string() );
733 if ( image.font().length() != 0 )
736 cout <<
"Line: " << __LINE__ <<
", font failed to unset" << endl;
743 if ( image.fontPointsize() != 0 )
746 cout <<
"Line: " << __LINE__
747 <<
", fontPointsize ("
748 << image.fontPointsize()
749 <<
") is not default of 0 as expected"
754 image.fontPointsize(10);
755 if ( image.fontPointsize() != 10 )
758 cout <<
"Line: " << __LINE__
759 <<
", fontPointsize set/get failed" << endl;
761 image.fontPointsize(12);
766 if ( image.format() !=
"Constant image uniform color" )
769 cout <<
"Line: " << __LINE__
770 <<
", format (" << image.format() <<
") is not expected value" << endl;
776 if ( image.gamma() == 1.0f)
779 cout <<
"Line: " << __LINE__
780 <<
", gamma correction is unity as expected" << endl;
787 bool caughtException =
false;
794 caughtException =
true;
796 if ( caughtException !=
true )
799 cout <<
"Line: " << __LINE__
800 <<
", geometry failed to report missing image geometry";
808 if ( image.gifDisposeMethod() != 0 )
811 cout <<
"Line: " << __LINE__
812 <<
", gifDisposeMethod default is not zero as expected" << endl;
816 image.gifDisposeMethod(4);
817 if ( image.gifDisposeMethod() != 4 )
820 cout <<
"Line: " << __LINE__
821 <<
", gifDisposeMethod set/get failed" << endl;
823 image.gifDisposeMethod(0);
829 if ( image.interlaceType() != NoInterlace )
832 cout <<
"Line: " << __LINE__
833 <<
", interlaceType default is not NoInterlace as expected" << endl;
837 image.interlaceType( PlaneInterlace );
838 if ( image.interlaceType() != PlaneInterlace )
841 cout <<
"Line: " << __LINE__ <<
", interlaceType set/get failed" << endl;
843 image.interlaceType(NoInterlace);
849 if ( image.label().length() != 0 )
852 cout <<
"Line: " << __LINE__
853 <<
", label default is not empty string as expected" << endl;
857 image.label(
"How now brown cow?");
858 if ( image.label() !=
"How now brown cow?" )
861 cout <<
"Line: " << __LINE__ <<
", label set/get failed" << endl;
864 image.label(
string() );
865 if ( image.label().length() != 0 )
868 cout <<
"Line: " << __LINE__ <<
", label failed to unset" << endl;
875 if ( image.lineWidth() != 1 )
878 cout <<
"Line: " << __LINE__
879 <<
", lineWidth default is not 1 as expected" << endl;
884 if ( image.lineWidth() != 2 )
887 cout <<
"Line: " << __LINE__ <<
", lineWidth set/get failed" << endl;
895 if ( image.magick() !=
"XC" )
898 cout <<
"Line: " << __LINE__
899 <<
", magick canvas default is not XC as expected" << endl;
904 if ( image.magick() !=
"GIF" )
907 cout <<
"Line: " << __LINE__ <<
", magick set/get failed" << endl;
916 if ( image.matte() !=
false )
919 cout <<
"Line: " << __LINE__
920 <<
", matte default is not false as expected" << endl;
925 if ( image.matte() !=
true )
928 cout <<
"Line: " << __LINE__ <<
", matte set/get failed" << endl;
936 if ( image.matteColor() !=
Color(
"#BDBDBD") )
939 cout <<
"Line: " << __LINE__
940 <<
", matteColor default is not #BDBDBD as expected" << endl;
944 image.matteColor(
ColorRGB(0.5,0.5,1));
945 if ( image.matteColor() !=
ColorRGB(0.5,0.5,1) )
948 cout <<
"Line: " << __LINE__ <<
", matteColor set/get failed" << endl;
952 image.matteColor(
Color() );
954 image.matteColor(
"#BDBDBD");
959 if ( image.meanErrorPerPixel() != 0 )
962 cout <<
"Line: " << __LINE__
963 <<
", meanErrorPerPixel is not zero as expected" << endl;
970 bool caughtException =
false;
973 image.montageGeometry();
977 caughtException =
true;
979 if ( caughtException !=
true )
982 cout <<
"Line: " << __LINE__
983 <<
", montageGeometry failed to report missing montage geometry";
991 if ( image.monochrome() !=
false )
994 cout <<
"Line: " << __LINE__
995 <<
", monochrome is not false as expected" << endl;
999 image.monochrome(
true);
1000 if ( image.monochrome() !=
true )
1003 cout <<
"Line: " << __LINE__ <<
", monochrome get/set failed" << endl;
1005 image.monochrome(
false);
1010 if ( image.normalizedMaxError() != 0 )
1013 cout <<
"Line: " << __LINE__
1014 <<
",normalizedMaxError is not zero as expected" << endl;
1020 if ( image.normalizedMeanError() != 0 )
1023 cout <<
"Line: " << __LINE__
1024 <<
", normalizedMeanError is not zero as expected" << endl;
1031 image.penColor(
ColorRGB(0.5,0.5,1));
1032 if ( image.penColor() !=
ColorRGB(0.5,0.5,1) )
1035 cout <<
"Line: " << __LINE__ <<
", penColor ("
1036 << string(image.penColor())
1037 <<
") set/get failed" << endl;
1044 image.strokeColor(
ColorRGB(0.5,0.5,1));
1045 if ( image.strokeColor() !=
ColorRGB(0.5,0.5,1) )
1048 cout <<
"Line: " << __LINE__ <<
", strokeColor ("
1049 << string(image.strokeColor())
1050 <<
") set/get failed" << endl;
1058 image.fillColor(
ColorRGB(0.5,0.5,1));
1059 if ( image.fillColor() !=
ColorRGB(0.5,0.5,1) )
1062 cout <<
"Line: " << __LINE__ <<
", fillColor ("
1063 << string(image.fillColor())
1064 <<
") set/get failed" << endl;
1071 if (image.pixelColor(40,60) !=
string(canvasColor))
1074 cout <<
"Line: " << __LINE__ <<
", pixelColor default ("
1075 << string(image.pixelColor(40,60))
1076 <<
") is not canvas color ("
1077 << string(canvasColor)
1078 <<
") as expected" << endl;
1082 image.pixelColor(40,60,
ColorRGB(0.5,1,1));
1083 if ( image.pixelColor(40,60) !=
ColorRGB(0.5,1,1) )
1086 cout <<
"Line: " << __LINE__ <<
", pixelColor set/get failed" << endl;
1093 if ( image.page() !=
Geometry(640,480,0,0) )
1096 cout <<
"Line: " << __LINE__ <<
", page default "
1097 <<
"(" << string(image.page()) <<
")"
1098 <<
" is not 640x480 as expected" << endl;
1102 image.page(
"letter+43+43>");
1103 if ( image.page() !=
"612x792+43+43" )
1106 cout <<
"Line: " << __LINE__
1107 <<
", page set/get failed (" << string(image.page()) <<
")" << endl;
1114 if ( image.quality() != 0 )
1117 cout <<
"Line: " << __LINE__
1118 <<
", quality default is not 0 as expected" << endl;
1123 if ( image.quality() != 65 )
1126 cout <<
"Line: " << __LINE__ <<
", quality set/get failed" << endl;
1134 if ( image.quantizeColors() != 256 )
1137 cout <<
"Line: " << __LINE__
1138 <<
", quantizeColors is not 256 as expected" << endl;
1142 image.quantizeColors(200);
1143 if ( image.quantizeColors() != 200 )
1146 cout <<
"Line: " << __LINE__ <<
", quantizeColors set/get failed" << endl;
1148 image.quantizeColors(0);
1154 if ( image.quantizeColorSpace() != UndefinedColorspace )
1157 cout <<
"Line: " << __LINE__
1158 <<
", quantizeColorSpace is not RGBColorspace as expected" << endl;
1162 image.quantizeColorSpace(YIQColorspace);
1163 if ( image.quantizeColorSpace() != YIQColorspace )
1166 cout <<
"Line: " << __LINE__
1167 <<
", quantizeColorSpace set/get failed" << endl;
1169 image.quantizeColorSpace(RGBColorspace);
1175 if ( image.quantizeDither() ==
false )
1178 cout <<
"Line: " << __LINE__
1179 <<
", quantizeDither is not false as expected" << endl;
1183 image.quantizeDither(
false);
1184 if ( image.quantizeDither() !=
false )
1187 cout <<
"Line: " << __LINE__
1188 <<
", quantizeDither get/set failed" << endl;
1190 image.quantizeDither(
true);
1195 if ( image.quantizeTreeDepth() != 0 )
1198 cout <<
"Line: " << __LINE__ <<
", quantizeTreeDepth default is "
1199 << image.quantizeTreeDepth()
1200 <<
" rather than zero as expected" << endl;
1203 image.quantizeTreeDepth(7);
1204 if ( image.quantizeTreeDepth() != 7 )
1207 cout <<
"Line: " << __LINE__
1208 <<
", quantizeTreeDepth set/get failed" << endl;
1210 image.quantizeTreeDepth(8);
1215 if ( image.renderingIntent() == UndefinedIntent )
1218 cout <<
"Line: " << __LINE__
1219 <<
", renderingIntent default is UndefinedIntent as expected"
1223 image.renderingIntent(PerceptualIntent);
1224 if ( image.renderingIntent() != PerceptualIntent )
1227 cout <<
"Line: " << __LINE__
1228 <<
", renderingIntent set/get failed" << endl;
1230 image.renderingIntent(UndefinedIntent);
1235 if ( image.resolutionUnits() != UndefinedResolution )
1238 cout <<
"Line: " << __LINE__
1239 <<
", resolutionUnits default is not UndefinedResolution as expected"
1243 image.resolutionUnits(PixelsPerCentimeterResolution);
1244 if ( image.resolutionUnits() != PixelsPerCentimeterResolution )
1247 cout <<
"Line: " << __LINE__
1248 <<
", resolutionUnits set/get failed" << endl;
1250 image.resolutionUnits(UndefinedResolution);
1255 if ( image.rows() != rows )
1258 cout <<
"Line: " << __LINE__
1259 <<
", rows is canvas rows as expected" << endl;
1265 if ( image.scene() != 0 )
1268 cout <<
"Line: " << __LINE__
1269 <<
", scene default is not zero as expected" << endl;
1273 if ( image.scene() != 5 )
1276 cout <<
"Line: " << __LINE__
1277 <<
", scene set/get failed" << endl;
1285 if ( image.signature() !=
"c7ac1ef7b47015c6ea6c1fb1d736eba4f8c3fe81dbfe511fbce104cedfce7588" &&
1286 image.signature() !=
"d9464cd4d0c02f25166909726d6548db51d25fa91bd3cff642813f8a464bcfc7" &&
1287 image.signature() !=
"e073572dfa4ad28f2f8dd3c6d37dfb14585e60c94cfae910149e97eff2fd895f" &&
1288 image.signature() !=
"ed06047a79b5b298515538db3fb8186d79e94758ed07a9b411637ba3a79fb4a0" &&
1289 image.signature() !=
"e12b9781b3a5025628567a4eabf970d16d42560e1b86189caceb03ec358dd8e6" &&
1290 image.signature() !=
"ea9aaf29023c4c1c801e05483423a4a4266918e3a464b6a5155f11a0c581dedb" &&
1291 image.signature() !=
"6a989010d8ea958934ff8be44a42e0848f7c5e7e46cd53e04c4a90452c15d34c" &&
1292 image.signature() !=
"7e5977b8bce5c40b858c84344803dae61feae0ef7a21739b2d068c9cdb72f95b" &&
1293 image.signature() !=
"c8aed4b60d666e449f5c29d0fb32f089e3257422a1f11a4712451c5340362df0" &&
1294 image.signature() !=
"bc272b75794971f4a3ade1bf524c0aee375765e9fb15d65278a8b9452b551ea6" &&
1295 image.signature() !=
"482690062c78a9e78c9f5f3db514197a067028e9f1bec577b787fb9e9b044567" &&
1296 image.signature() !=
"8610fd1c5ef905c05bf75438aaab8729d3e1277b8ec1e86927777bd3382702e5" &&
1297 image.signature() !=
"b891ddb1d32cd45c6329180e5bd733eebb8dd06c401a9c721841ec43e4a662f8")
1300 cout <<
"Line: " << __LINE__ <<
", signature ("
1301 << image.signature()
1302 <<
") is incorrect" << endl;
1309 if ( image.size() != geometry )
1312 cout <<
"Line: " << __LINE__ <<
", size ("
1313 << string(image.size())
1314 <<
") is not equal to geometry ("
1320 image.size(
"800x600");
1321 if ( image.size() !=
Geometry(
"800x600") )
1324 cout <<
"Line: " << __LINE__ <<
", size set/get failed" << endl;
1326 image.size( geometry );
1331 if ( image.subImage() != 0 )
1334 cout <<
"Line: " << __LINE__
1335 <<
", subImage default is not zero as expected" << endl;
1339 if ( image.subImage() != 5 )
1342 cout <<
"Line: " << __LINE__
1343 <<
", subImage set/get failed" << endl;
1350 if ( image.subRange() != 0 )
1353 cout <<
"Line: " << __LINE__
1354 <<
", subRange default is not zero as expected" << endl;
1358 if ( image.subRange() != 5 )
1361 cout <<
"Line: " << __LINE__
1362 <<
", subRange set/get failed" << endl;
1369 if ( image.tileName().length() != 0 )
1372 cout <<
"Line: " << __LINE__
1373 <<
", tileName default is not empty string as expected" << endl;
1376 image.tileName(
"How now brown cow?");
1377 if ( image.tileName() !=
"How now brown cow?" )
1380 cout <<
"Line: " << __LINE__
1381 <<
", tileName set/get failed" << endl;
1384 image.tileName(
string() );
1385 if ( image.tileName().length() != 0 )
1388 cout <<
"Line: " << __LINE__
1389 <<
", tileName failed to unset" << endl;
1395 if ( image.totalColors() != 2 )
1398 cout <<
"Line: " << __LINE__ <<
", totalColors is " << image.totalColors()
1399 <<
" rather than 2 as expected" << endl;
1405 image.type(PaletteType);
1406 if ( image.type() != PaletteType )
1409 cout <<
"Line: " << __LINE__
1410 <<
", type is not PaletteType as expected. Reported type "
1411 << (int) image.type() << endl;
1418 if ( image.verbose() !=
false )
1421 cout <<
"Line: " << __LINE__
1422 <<
", verbose is not false as expected" << endl;
1428 if ( image.view().length() != 0 )
1431 cout <<
"Line: " << __LINE__
1432 <<
", view default is not empty string as expected" << endl;
1435 image.view(
"How now brown cow?");
1436 if ( image.view() !=
"How now brown cow?" )
1439 cout <<
"Line: " << __LINE__
1440 <<
", view set/get failed" << endl;
1443 image.view(
string() );
1444 if ( image.view().length() != 0 )
1447 cout <<
"Line: " << __LINE__
1448 <<
", view failed to unset" << endl;
1454 if ( image.x11Display().length() != 0 )
1457 cout <<
"Line: " << __LINE__
1458 <<
", x11Display default is not empty string as expected" << endl;
1461 image.x11Display(
":0.0");
1462 if ( image.x11Display() !=
":0.0" )
1465 cout <<
"Line: " << __LINE__
1466 <<
", x11Display set/get failed" << endl;
1469 image.x11Display(
string() );
1470 if ( image.x11Display().length() != 0 )
1473 cout <<
"Line: " << __LINE__
1474 <<
", x11Display failed to unset" << endl;
1480 if ( image.xResolution() != 72 )
1483 cout <<
"Line: " << __LINE__
1484 <<
", xResolution default (" << image.xResolution()
1485 <<
") is not zero as expected" << endl;
1491 if ( image.yResolution() != 72 )
1494 cout <<
"Line: " << __LINE__
1495 <<
", yResolution default (" << image.yResolution()
1496 <<
") is not zero as expected" << endl;
1501 cout <<
"Caught exception: " << error_.what() << endl;
1504 catch( exception &error_ )
1506 cout <<
"Caught exception: " << error_.what() << endl;
1512 cout << failures <<
" failures" << endl;