]> Creatis software - gdcm.git/blob - Testing/TestAllVM.cxx
BUG: TestAllPrint actually is doing something now. Update to compile TestAllVM
[gdcm.git] / Testing / TestAllVM.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: TestAllVM.cxx,v $
5   Language:  C++
6   Date:      $Date: 2005/10/21 14:51:36 $
7   Version:   $Revision: 1.2 $
8                                                                                 
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.
12                                                                                 
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.
16                                                                                 
17 =========================================================================*/
18
19 #include "gdcmFile.h"
20 #include "gdcmDataEntry.h"
21
22 //Generated file:
23 #include "gdcmDataImages.h"
24
25 int TestAllVM(int, char *[])
26 {
27    int i = 0;
28
29    while( gdcmDataImages[i] != 0 )
30    {
31       std::string filename = GDCM_DATA_ROOT;
32       filename += "/";
33       filename += gdcmDataImages[i];
34
35       gdcm::File file;
36       file.SetLoadMode( gdcm::LD_ALL );
37       file.SetFileName( filename );
38       if( !file.Load() ) //would be really bad...
39         return 1;
40
41       gdcm::DocEntry *d = file.GetFirstEntry();
42       while(d)
43       {
44          if ( gdcm::DataEntry *de = dynamic_cast<gdcm::DataEntry *>(d) )
45          {
46            if(! de->IsValueCountValid() )
47              std::cerr << "Filename:" << filename << std::endl;
48          }
49          else
50          {
51           // We skip pb of SQ recursive exploration
52          }
53
54          d = file.GetNextEntry();
55       }
56
57       i++;
58    }
59    return 0;
60 }
61