X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestBug.cxx;h=db95841aaf5f597b12410f955b615814ac511289;hb=209f09716365d35c7cdc5b94684d1d1fb00335c7;hp=a7fc6b9bc09a8edad1cbe9a145d4e2799141b954;hpb=a92be72817889f80324ce6f29ad69c0412d31024;p=gdcm.git diff --git a/Testing/TestBug.cxx b/Testing/TestBug.cxx index a7fc6b9b..db95841a 100644 --- a/Testing/TestBug.cxx +++ b/Testing/TestBug.cxx @@ -1,16 +1,44 @@ +/*========================================================================= + + Program: gdcm + Module: $RCSfile: TestBug.cxx,v $ + Language: C++ + Date: $Date: 2006/04/07 10:58:51 $ + Version: $Revision: 1.22 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ // The following crashes on Win32 -#include "gdcm.h" - -int main(int argc, char* argv[]) -{ - gdcmHeader* e1; - - if (argc > 1) - e1 = new gdcmHeader(argv[1]); - else - e1 = new gdcmHeader("test.acr"); - e1->PrintPubDict(); -} +// We have to be carefull when the code both use cout + printf VC++ gets +// confused, thus make sure we use only one kind of iostream +#include "gdcmFile.h" +int TestBug(int argc, char *argv[]) +{ + gdcm::File *f; + f = gdcm::File::New(); + + if (argc > 1) + f->SetFileName( argv[1] ); + else { + std::string filename = GDCM_DATA_ROOT; + filename += "/test.acr"; + f->SetFileName( filename.c_str() ); + } + f->Load( ); + f->Print(); + std::cout << "-------------End of Print file ------------" << std::cout; + f->GetPubDict()->Print(); + std::cout << "-------------End of Print Dict ------------" << std::cout; + f->Delete(); + return 0; +}