1 // This may look like C code, but it is really -*- C++ -*-
3 // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
5 // Tests for setting/getting Magick::Image attributes
14 using namespace Magick;
16 int main( int /*argc*/, char ** argv)
19 // Initialize ImageMagick install location for Windows
20 InitializeMagick(*argv);
22 volatile int failures=0;
28 Geometry geometry(columns,rows);
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;
109 // Test setting to 100
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);
120 // animationIterations
123 // Test default value
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;
142 // Test setting to 100
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 );
156 // Test default value.
157 if ( image.backgroundColor() != ColorRGB("white") )
160 cout << "Line: " << __LINE__ << ", backgroundColor default ("
161 << string(image.backgroundColor())
162 << ") is incorrect" << endl;
165 // Test setting to blue
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"
185 // Test setting using hex color
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())
211 // Test default value
212 if ( image.backgroundTexture() != "" )
215 cout << "Line: " << __LINE__ << ", backgroundTexture default ("
216 << image.backgroundTexture()
217 << ") is incorrect" << endl;
220 // Test setting/getting value
221 image.backgroundTexture("afile.jpg");
222 if ( image.backgroundTexture() != "afile.jpg" )
225 cout << "Line: " << __LINE__ << ", backgroundTexture ("
226 << image.backgroundTexture()
227 << ") is incorrect" << endl;
230 // Test setting back to default
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 "
260 // Base filename is color for xc images
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())
350 // Test default setting
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;
373 // chromaGreenPrimary
376 // Test default setting
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;
401 // Test default setting
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;
426 // Test default setting
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;
508 // Test resetting comment
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;
549 Geometry density(150,75);
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");
570 // Format specific defines
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;
634 // Since this is not a montage image, simply verify error report
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;
642 Magick::Image bad_image("foo");
644 catch ( Exception &exception_)
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;
731 // Test set to null font
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 not 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;
863 // Test set to default
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;
894 // Test canvas default
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);
1008 // normalizedMaxError
1010 if ( image.normalizedMaxError() != 0 )
1013 cout << "Line: " << __LINE__
1014 << ",normalizedMaxError is not zero as expected" << endl;
1018 // normalizedMeanError
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) != 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);
1151 // quantizeColorSpace
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);
1193 // quantizeTreeDepth
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() != "b89bff8473dd6fe2302bcfd365e7d20daf7bd97ad667fe42d1a87469fce0d138")
1288 cout << "Line: " << __LINE__ << ", signature ("
1289 << image.signature()
1290 << ") is incorrect" << endl;
1297 if ( image.size() != geometry )
1300 cout << "Line: " << __LINE__ << ", size ("
1301 << string(image.size())
1302 << ") is not equal to geometry ("
1308 image.size("800x600");
1309 if ( image.size() != Geometry("800x600") )
1312 cout << "Line: " << __LINE__ << ", size set/get failed" << endl;
1314 image.size( geometry );
1319 if ( image.subImage() != 0 )
1322 cout << "Line: " << __LINE__
1323 << ", subImage default is not zero as expected" << endl;
1327 if ( image.subImage() != 5 )
1330 cout << "Line: " << __LINE__
1331 << ", subImage set/get failed" << endl;
1338 if ( image.subRange() != 0 )
1341 cout << "Line: " << __LINE__
1342 << ", subRange default is not zero as expected" << endl;
1346 if ( image.subRange() != 5 )
1349 cout << "Line: " << __LINE__
1350 << ", subRange set/get failed" << endl;
1357 if ( image.totalColors() != 2 )
1360 cout << "Line: " << __LINE__ << ", totalColors is " << image.totalColors()
1361 << " rather than 2 as expected" << endl;
1367 image.type(PaletteType);
1368 if ( image.type() != PaletteType )
1371 cout << "Line: " << __LINE__
1372 << ", type is not PaletteType as expected. Reported type "
1373 << (int) image.type() << endl;
1380 if ( image.verbose() != false )
1383 cout << "Line: " << __LINE__
1384 << ", verbose is not false as expected" << endl;
1390 if ( image.view().length() != 0 )
1393 cout << "Line: " << __LINE__
1394 << ", view default is not empty string as expected" << endl;
1397 image.view("How now brown cow?");
1398 if ( image.view() != "How now brown cow?" )
1401 cout << "Line: " << __LINE__
1402 << ", view set/get failed" << endl;
1405 image.view( string() );
1406 if ( image.view().length() != 0 )
1409 cout << "Line: " << __LINE__
1410 << ", view failed to unset" << endl;
1416 if ( image.x11Display().length() != 0 )
1419 cout << "Line: " << __LINE__
1420 << ", x11Display default is not empty string as expected" << endl;
1423 image.x11Display(":0.0");
1424 if ( image.x11Display() != ":0.0" )
1427 cout << "Line: " << __LINE__
1428 << ", x11Display set/get failed" << endl;
1431 image.x11Display( string() );
1432 if ( image.x11Display().length() != 0 )
1435 cout << "Line: " << __LINE__
1436 << ", x11Display failed to unset" << endl;
1442 if ( image.xResolution() != 72 )
1445 cout << "Line: " << __LINE__
1446 << ", xResolution default (" << image.xResolution()
1447 << ") is not zero as expected" << endl;
1453 if ( image.yResolution() != 72 )
1456 cout << "Line: " << __LINE__
1457 << ", yResolution default (" << image.yResolution()
1458 << ") is not zero as expected" << endl;
1461 catch( Exception &error_ )
1463 cout << "Caught exception: " << error_.what() << endl;
1466 catch( exception &error_ )
1468 cout << "Caught exception: " << error_.what() << endl;
1474 cout << failures << " failures" << endl;