Powered by Pair ImageMagick logo
Image Magick
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages

ImageMagick-6.1.1/Magick++/tests/coderInfo.cpp File Reference

#include <Magick++.h>
#include <string>
#include <iostream>
#include <list>

Include dependency graph for coderInfo.cpp:

Include dependency graph

Go to the source code of this file.

Functions

int test (CoderInfo::MatchType isReadable_, CoderInfo::MatchType isWritable_, CoderInfo::MatchType isMultiFrame_)
int main (int, char **argv)


Function Documentation

int main int  ,
char **  argv
 

Definition at line 75 of file coderInfo.cpp.

References InitializeMagick(), _CoderInfo::name, and test().

00076 { 00077 00078 // Initialize ImageMagick install location for Windows 00079 InitializeMagick(*argv); 00080 00081 int failures=0; 00082 00083 try { 00084 00085 CoderInfo coderInfo("GIF"); 00086 if ( coderInfo.name() != string("GIF") ) 00087 { 00088 cout << "Unexpected coder name \"" 00089 << coderInfo.name() 00090 << "\"" 00091 << endl; 00092 ++failures; 00093 } 00094 00095 if( coderInfo.description() != string("CompuServe graphics interchange format") ) 00096 { 00097 cout << "Unexpected coder description \"" 00098 << coderInfo.description() 00099 << "\"" 00100 << endl; 00101 ++failures; 00102 } 00103 00104 failures += test(CoderInfo::AnyMatch,CoderInfo::AnyMatch,CoderInfo::AnyMatch); 00105 failures += test(CoderInfo::FalseMatch,CoderInfo::FalseMatch,CoderInfo::FalseMatch); 00106 00107 failures += test(CoderInfo::TrueMatch,CoderInfo::AnyMatch,CoderInfo::AnyMatch); 00108 failures += test(CoderInfo::FalseMatch,CoderInfo::AnyMatch,CoderInfo::AnyMatch); 00109 00110 failures += test(CoderInfo::AnyMatch,CoderInfo::TrueMatch,CoderInfo::AnyMatch); 00111 failures += test(CoderInfo::AnyMatch,CoderInfo::FalseMatch,CoderInfo::AnyMatch); 00112 00113 failures += test(CoderInfo::AnyMatch,CoderInfo::AnyMatch,CoderInfo::TrueMatch); 00114 failures += test(CoderInfo::AnyMatch,CoderInfo::AnyMatch,CoderInfo::FalseMatch); 00115 } 00116 catch( Exception &error_ ) 00117 { 00118 cout << "Caught exception: " << error_.what() << endl; 00119 return 1; 00120 } 00121 catch( exception &error_ ) 00122 { 00123 cout << "Caught exception: " << error_.what() << endl; 00124 return 1; 00125 } 00126 00127 if ( failures ) 00128 { 00129 cout << failures << " failures" << endl; 00130 return 1; 00131 } 00132 00133 return 0; 00134 }

Here is the call graph for this function:

int test CoderInfo::MatchType  isReadable_,
CoderInfo::MatchType  isWritable_,
CoderInfo::MatchType  isMultiFrame_
 

Definition at line 17 of file coderInfo.cpp.

References Magick::coderInfoList().

Referenced by main().

00020 { 00021 int result = 0; 00022 list<CoderInfo> coderList; 00023 coderInfoList( &coderList, isReadable_, isWritable_, isMultiFrame_ ); 00024 list<CoderInfo>::iterator entry = coderList.begin(); 00025 while( entry != coderList.end() ) 00026 { 00027 // Readable 00028 if ( isReadable_ != CoderInfo::AnyMatch && 00029 (( entry->isReadable() && isReadable_ != CoderInfo::TrueMatch ) || 00030 ( !entry->isReadable() && isReadable_ != CoderInfo::FalseMatch )) ) 00031 { 00032 cout << "Entry \"" 00033 << entry->name() 00034 << "\" has unexpected readablity state (" 00035 << static_cast<int>(entry->isReadable()) 00036 << ")" 00037 << endl; 00038 ++result; 00039 } 00040 00041 // Writable 00042 if ( isWritable_ != CoderInfo::AnyMatch && 00043 (( entry->isWritable() && isWritable_ != CoderInfo::TrueMatch ) || 00044 ( !entry->isWritable() && isWritable_ != CoderInfo::FalseMatch )) ) 00045 { 00046 cout << "Entry \"" 00047 << entry->name() 00048 << "\" has unexpected writablity state (" 00049 << static_cast<int>(entry->isWritable()) 00050 << ")" 00051 << endl; 00052 ++result; 00053 } 00054 00055 // MultiFrame 00056 if ( isMultiFrame_ != CoderInfo::AnyMatch && 00057 (( entry->isMultiFrame() && isMultiFrame_ != CoderInfo::TrueMatch ) || 00058 ( !entry->isMultiFrame() && isMultiFrame_ != CoderInfo::FalseMatch )) ) 00059 { 00060 cout << "Entry \"" 00061 << entry->name() 00062 << "\" has unexpected multiframe state (" 00063 << static_cast<int>(entry->isMultiFrame()) 00064 << ")" 00065 << endl; 00066 ++result; 00067 } 00068 00069 entry++; 00070 } 00071 00072 return result; 00073 }

Here is the call graph for this function:


Generated on Mon Oct 25 13:43:25 2004 for ImageMagick by doxygen 1.3.7
ImageMagick Copyright © 2004, ImageMagick Studio LLC