1 /*=========================================================================
4 Module: $RCSfile: TestAllVM.cxx,v $
6 Date: $Date: 2005/10/21 15:01:28 $
7 Version: $Revision: 1.3 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
20 #include "gdcmDataEntry.h"
23 #include "gdcmDataImages.h"
25 int TestAllVM(int, char *[])
29 while( gdcmDataImages[i] != 0 )
31 std::string filename = GDCM_DATA_ROOT;
33 filename += gdcmDataImages[i];
36 file.SetLoadMode( gdcm::LD_NOSHADOW );
37 file.SetFileName( filename );
38 if( !file.Load() ) //would be really bad...
41 gdcm::DocEntry *d = file.GetFirstEntry();
42 std::cerr << "Testing file : " << filename << std::endl;
45 if ( gdcm::DataEntry *de = dynamic_cast<gdcm::DataEntry *>(d) )
47 if( !de->IsValueCountValid() )
49 std::cerr << "Element: " << de->GetKey() <<
50 " (" << de->GetName() << ") " <<
51 "Contains a wrong VM: " << de->GetValueCount()
52 << " should be: " << de->GetVM() << std::endl;;
57 // We skip pb of SQ recursive exploration
60 d = file.GetNextEntry();
61 std::cerr << std::endl; // skip a line after each file