]> Creatis software - gdcm.git/commitdiff
BUG: TestAllPrint actually is doing something now. Update to compile TestAllVM
authormalaterre <malaterre>
Fri, 21 Oct 2005 14:51:36 +0000 (14:51 +0000)
committermalaterre <malaterre>
Fri, 21 Oct 2005 14:51:36 +0000 (14:51 +0000)
Testing/CMakeLists.txt
Testing/TestAllPrint.cxx
Testing/TestAllVM.cxx

index 25eafebc17ff89b285a00ad65e5418ab2a8e40a7..a845c7479a1a91d52aeb15476f1025441dffcfc5 100644 (file)
@@ -42,6 +42,7 @@ IF (GDCM_DATA_ROOT)
     TestBuildUpDicomDir.cxx          # writes a file named "NewDICOMDIR"
     TestMakeDicomDir.cxx             # writes a file named "NewDICOMDIR"
     TestSerieHelper.cxx              # uses gdcmData as a default root directory    
+    TestAllVM.cxx
   )
   # add test that require VTK:
   IF(GDCM_VTK)
index e1d59cb277e417ecac0e797f3053bf3b8d3d8662..9635bad865dad8e9ce3ffb124d295f543e3d0647 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestAllPrint.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/18 08:35:46 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2005/10/21 14:51:36 $
+  Version:   $Revision: 1.6 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -43,12 +43,15 @@ int TestAllPrint(int, char *[])
 
    while( gdcmDataImages[i] != 0 )
    {
-      std::string filename = gdcmDataImages[i];
+      std::string filename = GDCM_DATA_ROOT;
+      filename += "/";
+      filename += gdcmDataImages[i];
 
       gdcm::File file;
       file.SetLoadMode( gdcm::LD_NOSEQ );
       file.SetFileName( filename );
-      file.Load();
+      if( !file.Load() )
+        return 1;
       //file.Print( std::cout ); //just for debug
       i++;
    }
index 74bab90117f3f5e8d965021bee84e773454c69d2..be2e7973fffc5cbbd4bd91b41a2af5f26b82342a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestAllVM.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/21 14:42:12 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2005/10/21 14:51:36 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
                                                                                 
 =========================================================================*/
 
-#include "gdcmDictEntry.h"
-#include "gdcmDict.h"
-#include "gdcmDictSet.h"
 #include "gdcmFile.h"
-#include "gdcmFileHelper.h"
-#include "gdcmUtil.h"
-#include "gdcmCommon.h"
-#include "gdcmDocEntry.h" 
-#include "gdcmDocEntrySet.h"           
-#include "gdcmDocument.h"          
-#include "gdcmElementSet.h"        
-#include "gdcmSeqEntry.h" 
-#include "gdcmSQItem.h" 
+#include "gdcmDataEntry.h"
 
 //Generated file:
 #include "gdcmDataImages.h"
@@ -39,12 +28,15 @@ int TestAllVM(int, char *[])
 
    while( gdcmDataImages[i] != 0 )
    {
-      std::string filename = gdcmDataImages[i];
+      std::string filename = GDCM_DATA_ROOT;
+      filename += "/";
+      filename += gdcmDataImages[i];
 
       gdcm::File file;
-      //file.SetLoadMode( gdcm::LD_NOSEQ );
+      file.SetLoadMode( gdcm::LD_ALL );
       file.SetFileName( filename );
-      file.Load();
+      if( !file.Load() ) //would be really bad...
+        return 1;
 
       gdcm::DocEntry *d = file.GetFirstEntry();
       while(d)
@@ -59,7 +51,7 @@ int TestAllVM(int, char *[])
           // We skip pb of SQ recursive exploration
          }
 
-         d = file->GetNextEntry();
+         d = file.GetNextEntry();
       }
 
       i++;