X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestBuildUpDicomDir.cxx;h=64efd4b0e89217b6f6856c06d88911ab061cd81e;hb=67747c7bb4d55b6d9c862ad50b8de6f034df9367;hp=1aa9cb6fcf95cc0873c0a785bd55a13bf68e8d97;hpb=2ce6422178e709073fc24aa2e3d4f5069711cd18;p=gdcm.git diff --git a/Testing/TestBuildUpDicomDir.cxx b/Testing/TestBuildUpDicomDir.cxx index 1aa9cb6f..64efd4b0 100644 --- a/Testing/TestBuildUpDicomDir.cxx +++ b/Testing/TestBuildUpDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestBuildUpDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/10/19 13:15:36 $ - Version: $Revision: 1.6 $ + Date: $Date: 2005/10/25 14:52:30 $ + Version: $Revision: 1.8 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -40,10 +40,11 @@ int TestBuildUpDicomDir(int argc, char *argv[]) std::cerr << "Usage: " << argv[0] << " dummy " << std::endl; } + bool errorFound = false; gdcm::DicomDir *dcmdir; std::string dirName; - dcmdir = new gdcm::DicomDir(); + dcmdir = gdcm::DicomDir::New(); gdcm::DicomDirPatient *p1; // --- Forget these 4 lines : @@ -170,7 +171,7 @@ int TestBuildUpDicomDir(int argc, char *argv[]) <<" is not readable"<Delete(); return 1; } @@ -183,10 +184,10 @@ int TestBuildUpDicomDir(int argc, char *argv[]) // Write it on disc dcmdir->Write("NewDICOMDIR"); - delete dcmdir; + dcmdir->Delete(); // Read the newly written DicomDir - gdcm::DicomDir *newDicomDir = new gdcm::DicomDir(); + gdcm::DicomDir *newDicomDir = gdcm::DicomDir::New(); newDicomDir->SetFileName("NewDICOMDIR"); newDicomDir->Load( ); if( !newDicomDir->IsReadable() ) @@ -195,7 +196,7 @@ int TestBuildUpDicomDir(int argc, char *argv[]) <<" is not readable"<Delete(); return 1; } // Check some value we are sure @@ -207,7 +208,7 @@ int TestBuildUpDicomDir(int argc, char *argv[]) { std::cout << "A patient is missing in written DicomDir" << std::endl; - delete newDicomDir; + newDicomDir->Delete(); return 1; } @@ -215,7 +216,6 @@ int TestBuildUpDicomDir(int argc, char *argv[]) << "----------Final Check ---------------------" <Delete(); + + return errorFound; }