Program: gdcm
Module: $RCSfile: TestUtil.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 16:07:54 $
- Version: $Revision: 1.7 $
+ 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
// way to test this class.
#include "gdcmUtil.h"
+#include "gdcmDebug.h"
#include <iostream>
-int TestUtil(int , char * [])
+int TestUtil(int , char *[])
{
+ // 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::cout << gdcm::Util::CreateUniqueUID("") << std::endl;
+ 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";
if( gdcm::Util::DicomStringEqual(d,ref) )
return 1;
- // MAC Adress
- std::cout << "Mac Address:" << gdcm::Util::GetMACAddress() << std::endl;
-
- std::cout << "Time:" << gdcm::Util::GetCurrentDateTime() << std::endl;
+// ----------------------------------------------------------
+// Let's test gdcm::Debug, now.
+ std::cout << "GetDebugFlag : " << gdcm::Debug::GetDebugFlag() <<std::endl;
+ gdcm::Debug::SetDebugFilename ("DummyFileNameToWriteTo.txt");
+ std::cout << "We set a Debug file" <<std::endl;
+ if ( !gdcm::Debug::GetDebugFlag() )
+ {
+ std::cout << "Debug Flag should be TRUE... " << std::endl;
+ return 1;
+ }
+ std::cout << "GetDebugFlag : " << gdcm::Debug::GetDebugFlag()<<std::endl;
+ gdcm::Debug::SetDebugFlag ( false );
+ std::cout << "GetDebugFlag : " << gdcm::Debug::GetDebugFlag()<<std::endl;
+ gdcm::Debug::SetDebugFilename ("DummyFileNameToWriteTo2.txt");
return 0;
}