From: jpr Date: Mon, 14 Feb 2005 10:50:00 +0000 (+0000) Subject: Add some tests X-Git-Tag: Version1.0.bp~5 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=80101e358eba3cfca1b7f597c4add6137e553bf2;p=gdcm.git Add some tests --- diff --git a/Testing/TestUtil.cxx b/Testing/TestUtil.cxx index 9574fece..26a81a4f 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/02/02 10:05:26 $ - Version: $Revision: 1.10 $ + Date: $Date: 2005/02/14 10:50:00 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -24,6 +24,25 @@ int TestUtil(int , char *[]) { + // CreateCleanString + std::string x = "a#@-bc\tdef"; + std::string y = gdcm::Util::CreateCleanString(x); + std::cout << "[" << x <<"] --> [" << y <<"]" << std::endl; + + // CountSubstring : substring id "#@-" + x = "abcd#@-wyz*@-lmn#@-uvw-#@ijk"; + std::cout << "count '#@-' in [" << x << "] : " + << gdcm::Util::CountSubstring(x, "#@-") << std::endl; + + // Tokenize : tokens are '#', '@', '-' + std::vector tokens; + gdcm::Util::Tokenize (x, tokens, "#@-"); + for (unsigned int i=0; i