X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestUtil.cxx;h=2f4f47ae4cafaf566954b2620799bbfa3dec9b31;hb=c556c62e38ad8f5b0423a91d919c13ac85a23f32;hp=24c285d540078f46cfa6bd7ce1e88ddb5569440b;hpb=3306c0c4d4513e73e1ca1ab60922ca02dc86a870;p=gdcm.git diff --git a/Testing/TestUtil.cxx b/Testing/TestUtil.cxx index 24c285d5..2f4f47ae 100644 --- a/Testing/TestUtil.cxx +++ b/Testing/TestUtil.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestUtil.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 19:10:07 $ - Version: $Revision: 1.6 $ + Date: $Date: 2005/10/21 08:35:13 $ + Version: $Revision: 1.16 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -19,12 +19,117 @@ // way to test this class. #include "gdcmUtil.h" +#include "gdcmDebug.h" #include -int TestUtil(int , char * []) +int TestUtil(int , char *[]) { + unsigned int i; + + // Seeing at a glance HOW int16, int32, float, double, + // are implanted in memory + uint16_t u16 = 0x0102; + uint32_t u32 = 0x01020304; + float flt; + double dbl=1.0; + + std::cout << "This is gdcm version: " << gdcm::Util::GetVersion() << std::endl; + + std::cout << "---------- uint16 : " << std::dec << u16 << " = 0x" + << std::hex << u16 << std::endl; + for (i=0;i [" << y <<"]" << std::endl; + + + // CountSubstring : substring id "#@-" + x = "abcd#@-wyz*@-lmn#@-uvw-#@ijk"; + std::cout << "in [" << x << "] " << std::endl; + std::cout << " - count '#@-' : " + << gdcm::Util::CountSubstring(x, "#@-") << std::endl; + + // Tokenize : tokens are '#', '@', '-' + std::vector tokens; + std::cout << " - use tokens '#@-' :" << std::endl; + gdcm::Util::Tokenize (x, tokens, "#@-"); + for (unsigned int ui=0; ui