From: regrain Date: Tue, 9 Nov 2004 16:14:20 +0000 (+0000) Subject: * src/TestAllReadCompareDicom.cxx : test the existence of the directory X-Git-Tag: Version1.0.bp~618 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=96078bd0d3edf63c984fb5bd76ee5b57601872bd;p=gdcm.git * src/TestAllReadCompareDicom.cxx : test the existence of the directory using an 'ifstream' other than a 'FILE *'. The previous solution ('FILE *') break under windows (with msvc6 compilation). -- BeNours --- diff --git a/ChangeLog b/ChangeLog index 95707955..659f0433 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2004-11-09 Benoit Regrain - * src/gdcmDicomDir.h : bug fix for the last Boix's commit (problem when + * src/TestAllReadCompareDicom.cxx : test the existence of the directory + using an 'ifstream' other than a 'FILE *'. The previous solution ('FILE *') + break under windows (with msvc6 compilation). + +2004-11-09 Benoit Regrain + * src/gdcmDicomDir.h : bug fix for the last Boix's commit (problem when compiling with MSVC6) 2004-11-09 Benoit Regrain diff --git a/Testing/TestAllReadCompareDicom.cxx b/Testing/TestAllReadCompareDicom.cxx index 2fefb6bd..a61581d7 100644 --- a/Testing/TestAllReadCompareDicom.cxx +++ b/Testing/TestAllReadCompareDicom.cxx @@ -157,7 +157,22 @@ int TestAllReadCompareDicom(int argc, char* argv[]) std::string baseLineDir = GDCM_DATA_ROOT; baseLineDir += "/BaselineDicom/"; - FILE* testFILE = fopen( baseLineDir.c_str(), "r" ); + std::ifstream* testDIR = new std::ifstream(baseLineDir.c_str(), std::ios::in | std::ios::binary); + if (!testDIR ) + { + std::cerr << " The reference baseline directory " << std::endl + << " " + << baseLineDir << std::endl + << " couldn't be opened." + << std::endl; + return 1; + } + else + { + testDIR->close(); + } + +/* FILE* testFILE = fopen( baseLineDir.c_str(), "r" ); if (!testFILE ) { std::cerr << " The reference baseline directory " << std::endl @@ -170,7 +185,7 @@ int TestAllReadCompareDicom(int argc, char* argv[]) else { fclose( testFILE ); - } + }*/ ////// Step 1 (see above description):