X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=Testing%2FTestAllEntryVerify.cxx;h=089b4c1b1ed61570203d00112ff5379eb6e149e4;hb=c7f1edff8d20eac561dc6614a63ed633d49fd06d;hp=089a8ad7cced084ffbd5185de01dcbf5b8247a14;hpb=233c8b3ebb1aee6b1be6723d842eb2241b9ffb91;p=gdcm.git diff --git a/Testing/TestAllEntryVerify.cxx b/Testing/TestAllEntryVerify.cxx index 089a8ad7..089b4c1b 100644 --- a/Testing/TestAllEntryVerify.cxx +++ b/Testing/TestAllEntryVerify.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestAllEntryVerify.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 17:13:17 $ - Version: $Revision: 1.15 $ + Date: $Date: 2005/01/25 15:29:33 $ + Version: $Revision: 1.22 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -15,12 +15,13 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "gdcmHeader.h" +#include "gdcmFile.h" #include #include #include #include +#include //Generated file: #include "gdcmDataImages.h" @@ -67,12 +68,12 @@ private: bool Check( MapFileValuesType::iterator &fileIt ); std::string ExtractValue(std::string& toSplit) throw ( ParserException ); - void ParseRegularLine( std::string& line ) throw ( ParserException ); - void FirstPassReferenceFile() throw ( ParserException ); - bool SecondPassReferenceFile() throw ( ParserException ); - void HandleFileName( std::string& line ) throw ( ParserException ); - void HandleKey( std::string& line ) throw ( ParserException ); - bool HandleValue( std::string& line ) throw ( ParserException ); + void ParseRegularLine( std::string& line ) throw ( ParserException ); + void FirstPassReferenceFile() throw ( ParserException ); + bool SecondPassReferenceFile() throw ( ParserException ); + void HandleFileName( std::string& line ) throw ( ParserException ); + void HandleKey( std::string& line ) throw ( ParserException ); + bool HandleValue( std::string& line ) throw ( ParserException ); static uint16_t axtoi( char* ); private: /// The directory containing the images to check: @@ -114,12 +115,12 @@ uint16_t ReferenceFileParser::axtoi(char *hexStg) { while (n < 4) { if (hexStg[n]=='\0') break; - if (hexStg[n] > 0x29 && hexStg[n] < 0x40 ) //if 0 to 9 - digit[n] = hexStg[n] & 0x0f; //convert to int + if (hexStg[n] > 0x29 && hexStg[n] < 0x40 ) //if 0 to 9 + digit[n] = hexStg[n] & 0x0f; //convert to int else if (hexStg[n] >='a' && hexStg[n] <= 'f') //if a to f - digit[n] = (hexStg[n] & 0x0f) + 9; //convert to int + digit[n] = (hexStg[n] & 0x0f) + 9; //convert to int else if (hexStg[n] >='A' && hexStg[n] <= 'F') //if A to F - digit[n] = (hexStg[n] & 0x0f) + 9; //convert to int + digit[n] = (hexStg[n] & 0x0f) + 9; //convert to int else break; n++; } @@ -178,7 +179,7 @@ void ReferenceFileParser::Print() bool ReferenceFileParser::Check() { - int ret = true; + bool ret = true; for (MapFileValuesType::iterator i = ProducedMap.begin(); i != ProducedMap.end(); ++i) @@ -206,7 +207,7 @@ bool ReferenceFileParser::Check( MapFileValuesType::iterator &fileIt ) { std::string fileName = DataPath + fileIt->first; std::cout << Indent << "FileName: " << fileName << std::endl; - gdcm::Header* tested = new gdcm::Header( fileName.c_str() ); + gdcm::File* tested = new gdcm::File( fileName.c_str() ); if( !tested->IsReadable() ) { std::cerr << Indent << "Failed\n" @@ -229,7 +230,7 @@ bool ReferenceFileParser::Check( MapFileValuesType::iterator &fileIt ) uint16_t group = axtoi( &(groupString[0]) ); uint16_t element = axtoi( &(groupElement[0]) ); - std::string testedValue = tested->GetEntryByNumber(group, element); + std::string testedValue = tested->GetEntryValue(group, element); if ( testedValue != j->second ) { // Oops make sure this is only the \0 that differ @@ -669,7 +670,7 @@ int TestAllEntryVerify(int argc, char* argv[]) } Parser.SetDataPath(referenceDir); // Parser.Print(); - std::cout << "Reference fil loaded -->\n" + std::cout << "Reference file loaded -->\n" << "Check files : \n"; int ret;