]> Creatis software - gdcm.git/blobdiff - Testing/TestAllEntryVerify.cxx
ENH: Add license to tests since they belong to gdcm
[gdcm.git] / Testing / TestAllEntryVerify.cxx
index 995dcf26ac838a5a76fc2bbca008d716c200476d..0490f35291a66e7a0d57a4e60733ad00efa30d35 100644 (file)
@@ -1,3 +1,20 @@
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: TestAllEntryVerify.cxx,v $
+  Language:  C++
+  Date:      $Date: 2004/11/16 04:28:20 $
+  Version:   $Revision: 1.14 $
+                                                                                
+  Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+  l'Image). All rights reserved. See Doc/License.txt or
+  http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*/
 #include "gdcmHeader.h"
 
 #include <map>
@@ -194,11 +211,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;