]> Creatis software - gdcm.git/commitdiff
Test coverage
authorjpr <jpr>
Thu, 27 Jan 2005 10:43:19 +0000 (10:43 +0000)
committerjpr <jpr>
Thu, 27 Jan 2005 10:43:19 +0000 (10:43 +0000)
Testing/CMakeLists.txt
Testing/TestUtil.cxx
Testing/TestVR.cxx

index fb86ee41ca3069247ca29a8b8bb246eba8df8319..42b6ba0822abc6523d41efb0b4c808436cd211ac 100644 (file)
@@ -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
index a8393de54eb51bf7df8d216356f21df695d110d4..80a52a0727b0a152fd1a19617ca74b48da4053fc 100644 (file)
@@ -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
 
 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;
 }
index 6801c655f3c2c3436660abc2052dc669b134b6e9..1b7b047213c72da258aaca92401333e5b23c4247 100644 (file)
@@ -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
 
 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;
 }