From 0e7b1a139c4071daa78b6a3b2144df02f0b904a9 Mon Sep 17 00:00:00 2001 From: malaterre Date: Fri, 21 Oct 2005 14:42:12 +0000 Subject: [PATCH] ENH: Adding a test for VM and validity... should allow us to check our own dict :-P --- Testing/TestAllVM.cxx | 69 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 Testing/TestAllVM.cxx diff --git a/Testing/TestAllVM.cxx b/Testing/TestAllVM.cxx new file mode 100644 index 00000000..74bab901 --- /dev/null +++ b/Testing/TestAllVM.cxx @@ -0,0 +1,69 @@ +/*========================================================================= + + Program: gdcm + Module: $RCSfile: TestAllVM.cxx,v $ + Language: C++ + Date: $Date: 2005/10/21 14:42:12 $ + Version: $Revision: 1.1 $ + + 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. + +=========================================================================*/ + +#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" + +//Generated file: +#include "gdcmDataImages.h" + +int TestAllVM(int, char *[]) +{ + int i = 0; + + while( gdcmDataImages[i] != 0 ) + { + std::string filename = gdcmDataImages[i]; + + gdcm::File file; + //file.SetLoadMode( gdcm::LD_NOSEQ ); + file.SetFileName( filename ); + file.Load(); + + gdcm::DocEntry *d = file.GetFirstEntry(); + while(d) + { + if ( gdcm::DataEntry *de = dynamic_cast(d) ) + { + if(! de->IsValueCountValid() ) + std::cerr << "Filename:" << filename << std::endl; + } + else + { + // We skip pb of SQ recursive exploration + } + + d = file->GetNextEntry(); + } + + i++; + } + return 0; +} + -- 2.48.1