From: jpr Date: Thu, 27 Jan 2005 10:43:19 +0000 (+0000) Subject: Test coverage X-Git-Tag: Version1.0.bp~176 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=bf15a99667fae49047bb72ba0bfda6e129bb045e;p=gdcm.git Test coverage --- diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt index fb86ee41..42b6ba08 100644 --- a/Testing/CMakeLists.txt +++ b/Testing/CMakeLists.txt @@ -8,12 +8,12 @@ SET(GDCM_TESTS ${CXX_TEST_PATH}/gdcmTests) # add test that does not require data: # They usally return if no argument is given SET(TEST_SOURCES + TestUtil.cxx TestBug.cxx TestHash.cxx TestTS.cxx TestVR.cxx TestDicomDirElement.cxx - TestUtil.cxx TestDicomString.cxx TestDict.cxx TestWriteSimple.cxx diff --git a/Testing/TestUtil.cxx b/Testing/TestUtil.cxx index a8393de5..80a52a07 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/21 16:07:54 $ - Version: $Revision: 1.7 $ + 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 @@ -23,9 +23,24 @@ 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"; @@ -44,10 +59,5 @@ int TestUtil(int , char * []) 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; - return 0; } diff --git a/Testing/TestVR.cxx b/Testing/TestVR.cxx index 6801c655..1b7b0472 100644 --- a/Testing/TestVR.cxx +++ b/Testing/TestVR.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestVR.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 20:03:26 $ - Version: $Revision: 1.4 $ + Date: $Date: 2005/01/27 10:43:19 $ + Version: $Revision: 1.5 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -19,13 +19,28 @@ int TestVR(int , char *[]) { - gdcm::VR vr; + gdcm::VR *tempVrDict=0; + std::cout << "------ Test Default VR Dictionary : ----------" << std::endl; + // Just to improve test coverage: + // tempVrDict = new gdcm::Dict("dummyFileNameThatDoesntExist"); + // tempVrDict->Print(); + // std::cout << "----- end Test Default VR Dictionary : -----" << std::endl; + + // Lets delete it. + delete tempVrDict; + + gdcm::VR *vr = new gdcm::VR(); + // There should be 16 entries - vr.Print( std::cout ); + vr->Print( std::cout ); + + vr->IsVROfStringRepresentable( "PN" ); + vr->IsVROfStringRepresentable( "FD" ); + + vr->IsVROfBinaryRepresentable( "FD" ); + vr->IsVROfBinaryRepresentable( "PN" ); - vr.IsVROfStringRepresentable( "" ); - vr.IsVROfBinaryRepresentable( "" ); - vr.IsVROfSequence( "" ); + vr->IsVROfSequence( "" ); return 0; }