X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestUtil.cxx;h=9574fece0029b8e6bc44831d0cfb22c29506a0fb;hb=cdddc2757271f571a876ff9f402af0114c00228c;hp=9e0261dc431ec87b42de717d1b074e8895de240d;hpb=ba78e6c6d47d6db1528e8e88e5ebde7296a26692;p=gdcm.git diff --git a/Testing/TestUtil.cxx b/Testing/TestUtil.cxx index 9e0261dc..9574fece 100644 --- a/Testing/TestUtil.cxx +++ b/Testing/TestUtil.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestUtil.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:56 $ - Version: $Revision: 1.4 $ + Date: $Date: 2005/02/02 10:05:26 $ + Version: $Revision: 1.10 $ 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,31 @@ // way to test this class. #include "gdcmUtil.h" +#include "gdcmDebug.h" #include -int TestUtil(int , char * []) +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'; @@ -32,10 +51,29 @@ 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; + +// ---------------------------------------------------------- +// Let's test gdcm::Debug, now. + std::cout << "GetDebugFlag : " << gdcm::Debug::GetDebugFlag() <