X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestAllVM.cxx;h=1dce8206204ea1a16d8749ad6ea56ba45a726ab6;hb=e2082e5dd226bbb809aa5957dc12e1ceb85fb849;hp=425567e2ced1cb50dd08ca86bb48ba09646033b6;hpb=9e3f678ba17cc24e8ee3972a6367b53bcd4d23d4;p=gdcm.git diff --git a/Testing/TestAllVM.cxx b/Testing/TestAllVM.cxx index 425567e2..1dce8206 100644 --- a/Testing/TestAllVM.cxx +++ b/Testing/TestAllVM.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestAllVM.cxx,v $ Language: C++ - Date: $Date: 2005/10/21 15:16:22 $ - Version: $Revision: 1.5 $ + Date: $Date: 2005/10/23 14:53:51 $ + Version: $Revision: 1.7 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -24,35 +24,40 @@ int DoTheVMTest(std::string const &filename) { - gdcm::File file; - // Do not test unknow VM ... - file.SetLoadMode( gdcm::LD_NOSHADOW | gdcm::LD_NOSHADOWSEQ ); - file.SetFileName( filename ); - if( !file.Load() ) //would be really bad... - return 1; + gdcm::File file; + // - Do not test unknow VM in shadow groups (if element 0x0000 is present) + // - Skip Sequences (if they are 'True Length'); loading will be quicker + // (anyway, Sequences are skipped at processing time ...) + file.SetLoadMode( gdcm::LD_NOSHADOW | gdcm::LD_NOSEQ ); + + file.SetFileName( filename ); + if( !file.Load() ) //would be really bad... + return 1; - gdcm::DocEntry *d = file.GetFirstEntry(); - std::cerr << "Testing file : " << filename << std::endl; - while(d) + gdcm::DocEntry *d = file.GetFirstEntry(); + std::cerr << "Testing file : " << filename << std::endl; + while(d) + { + if ( gdcm::DataEntry *de = dynamic_cast(d) ) { - if ( gdcm::DataEntry *de = dynamic_cast(d) ) - { - if( !de->IsValueCountValid() ) - { - std::cerr << "Element: " << de->GetKey() << - " (" << de->GetName() << ") " << - "Contains a wrong VM: " << de->GetValueCount() - << " should be: " << de->GetVM() << std::endl;; - } + if ( !(de->GetGroup() % 2) ) // Don't check shadow elements. Righ now, + // Private Dictionnary are not dealt with + { + if( !de->IsValueCountValid() ) + { + std::cerr << "Element: " << de->GetKey() << + " (" << de->GetName() << ") " << + "Contains a wrong VM: " << de->GetValueCount() + << " should be: " << de->GetVM() << std::endl;; + } } - else - { + } + else + { // We skip pb of SQ recursive exploration - } - - d = file.GetNextEntry(); } - + d = file.GetNextEntry(); + } return 0; }