X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=Testing%2FTestUtil.cxx;h=80a52a0727b0a152fd1a19617ca74b48da4053fc;hb=bf15a99667fae49047bb72ba0bfda6e129bb045e;hp=8804c72023331645535fb37023808a19d5abd150;hpb=a0091d68a2eaa1a0c128f962030bb6c45cc0c366;p=gdcm.git diff --git a/Testing/TestUtil.cxx b/Testing/TestUtil.cxx index 8804c720..80a52a07 100644 --- a/Testing/TestUtil.cxx +++ b/Testing/TestUtil.cxx @@ -1,12 +1,48 @@ +/*========================================================================= + + Program: gdcm + Module: $RCSfile: TestUtil.cxx,v $ + Language: C++ + Date: $Date: 2005/01/27 10:43:19 $ + Version: $Revision: 1.8 $ + + 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. + +=========================================================================*/ // This test should test everything in Util, since I didn't know any other // way to test this class. -#include "gdcm.h" +#include "gdcmUtil.h" +#include int TestUtil(int , char * []) { - std::cout << gdcm::Util::CreateUniqueUID("") << std::endl; + // Time + std::cout << "Time:" << gdcm::Util::GetCurrentDateTime() << std::endl; + + // Processor ID + unsigned int processorID;; + processorID = gdcm::Util::GetCurrentProcessID(); + std::cout << "Current Processor ID " << processorID << std::endl; + + // MAC Adress + std::cout << "Mac Address:" << gdcm::Util::GetMACAddress() << std::endl; + + // Unique UID test + std::string gdcmUid; + for (int i=0; i<10; i++) + { + gdcmUid = gdcm::Util::CreateUniqueUID(); + std::cout << "Current UID for gdcm " << gdcmUid << std::endl; + } + // DicomString test const char ref[] = "MONOCHROME1"; std::string a = "MONOCHROME1"; a += '\0'; @@ -14,10 +50,14 @@ int TestUtil(int , char * []) std::string c = gdcm::Util::DicomString("MONOCHROME1"); std::string d = "MONOCHROME1"; - if( !gdcm::Util::DicomStringEqual(a,ref) ) return 1; - if( !gdcm::Util::DicomStringEqual(b,ref) ) return 1; - if( !gdcm::Util::DicomStringEqual(c,ref) ) return 1; - if( gdcm::Util::DicomStringEqual(d,ref) ) return 1; + if( !gdcm::Util::DicomStringEqual(a,ref) ) + return 1; + if( !gdcm::Util::DicomStringEqual(b,ref) ) + return 1; + if( !gdcm::Util::DicomStringEqual(c,ref) ) + return 1; + if( gdcm::Util::DicomStringEqual(d,ref) ) + return 1; return 0; }