X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestAllEntryVerify.cxx;h=a2dc4abc00c9b72a1150623a3b8805a3d5effd5a;hb=609c6adb9848fef0dc437626b77c72a3fb68d33f;hp=6daec820304308f7a2599d8a1d6df168ebcd91ce;hpb=1d69b92978803204089d270599133917d944c651;p=gdcm.git diff --git a/Testing/TestAllEntryVerify.cxx b/Testing/TestAllEntryVerify.cxx index 6daec820..a2dc4abc 100644 --- a/Testing/TestAllEntryVerify.cxx +++ b/Testing/TestAllEntryVerify.cxx @@ -9,7 +9,7 @@ #include "gdcmDataImages.h" typedef std::string EntryValueType; // same type as ValEntry::value -typedef std::map< TagKey, EntryValueType > MapEntryValues; +typedef std::map< gdcm::TagKey, EntryValueType > MapEntryValues; typedef MapEntryValues* MapEntryValuesPtr; typedef std::string FileNameType; typedef std::map< FileNameType, MapEntryValuesPtr > MapFileValuesType; @@ -194,11 +194,19 @@ bool ReferenceFileParser::Check() std::string testedValue = tested->GetEntryByNumber(group, element); if ( testedValue != j->second ) { - std::cout << Indent << "Uncorrect value for key " << key << std::endl - << Indent << " read value [" << testedValue << "]" << std::endl - << Indent << " reference value [" << j->second << "]" - << std::endl; + // Oops make sure this is only the \0 that differ + if( testedValue[j->second.size()] != '\0' || + strncmp(testedValue.c_str(), + j->second.c_str(), j->second.size()) != 0) + { + std::cout << Indent << "Uncorrect value for key " + << key << std::endl + << Indent << " read value [" + << testedValue << "]" << std::endl + << Indent << " reference value [" + << j->second << "]" << std::endl; return false; + } } } delete tested; @@ -306,7 +314,7 @@ void ReferenceFileParser::FirstPassReferenceFile() throw ( ParserException ) while ( ! from.eof() ) { - getline( from, line ); + std::getline( from, line ); /// This is how we usually end the parsing because we hit EOF: if ( ! from.good() ) @@ -533,7 +541,7 @@ void ReferenceFileParser::ParseRegularLine( std::string& line) bool ReferenceFileParser::SecondPassReferenceFile() throw ( ParserException ) { - TagKey key; + gdcm::TagKey key; EntryValueType value; std::string line; bool inBlock = false; @@ -541,7 +549,7 @@ bool ReferenceFileParser::SecondPassReferenceFile() while ( !from.eof() ) { - getline( from, line ); + std::getline( from, line ); lineNumber++; CleanUpLine( line );