]> Creatis software - gdcm.git/blobdiff - Testing/TestDict.cxx
ENH: Add new test using dciodvfy from the dicom3tools package (David Clunie)
[gdcm.git] / Testing / TestDict.cxx
index cd0601e60d5857a1a51bdc0136d83d67e6562779..6d5b4e207fe7bf7a3dde828beb0486c14b4ffda8 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestDict.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/14 11:28:29 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2005/01/18 07:56:21 $
+  Version:   $Revision: 1.4 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 #include <iostream>
 #include <iomanip>
 
-int TestDict(int argc, char* argv[])
+int TestDict(int , char* [])
 {  
    // Print the DictSet
    std::cout<<"#######################################################\n";
    gdcm::DictSet *dicts=gdcm::Global::GetDicts();
    if(!dicts)
    {
-      std::cout<<"The DictSet hasn't be found... Failed\n";
+      std::cout<<"DictSet hasn't be found... Failed\n";
       return(1);
    }
+
    std::cout<<"DictSet content :\n";
-//   dicts->Print(std::cout);
+
+   gdcm::Dict *d = dicts->GetFirstEntry();
+   if (!d)
+   {
+      std::cout << "Dictset is empty" << std::endl;
+      return 1;
+   }
+   while (d)
+   {
+      std::cout << "------------- a Dict is found : ----------" << std::endl;
+      d->Print();
+      d = dicts->GetNextEntry();
+   }
 
    // Print the Dict (public)
    std::cout<<"#######################################################\n";
@@ -45,7 +58,7 @@ int TestDict(int argc, char* argv[])
       return(1);
    }
    std::cout<<"Public Dict content :\n";
-//   pubDict->Print(std::cout);
+//   pubDict->Print();
 
    // Print the DictEntry (0x10,0x20)
    std::cout<<"#######################################################\n";
@@ -59,15 +72,14 @@ int TestDict(int argc, char* argv[])
       return(1);
    }
    std::cout<<"Entry "<<key<<" content :\n";
-   entry->Print(std::cout);
+   entry->Print();
 
    // Print all the DictEntry
    std::cout<<"#######################################################\n";
-   pubDict->InitTraversal();
-   entry=pubDict->GetNextEntry();
+   entry=pubDict->GetFirstEntry();
    while(entry)
    {
-      entry->Print(std::cout);
+      entry->Print();
       entry=pubDict->GetNextEntry();
    }