]> Creatis software - gdcm.git/blobdiff - Testing/TestDict.cxx
Looping 10000000 times should be enought
[gdcm.git] / Testing / TestDict.cxx
index 54c87a5b16d4c9fdee4a7df799a38805a34b80cc..4dd71b144d06d74fa6e2964f006f7986211a972b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestDict.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/26 16:43:10 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2005/10/25 14:52:30 $
+  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
 #include <iostream>
 #include <iomanip>
 
-int TestDict(int , char[])
+int TestDict(int , char *[])
 { 
 
-   std::cout << "-------- Test Default Dicom Dictionary : ----------" << std::endl;
+   std::cout << "----- Test Default Dicom Dictionary : ----------" << std::endl;
    // Just to improve test coverage:
-   gdcm::Dict *tempDict = new gdcm::Dict("dummyFileNameThatDoesntExist");
+   gdcm::Dict *tempDict = gdcm::Dict::New("dummyFileNameThatDoesntExist");
    // Default dict is supposed to be used.
    tempDict->Print();
-   std::cout << "-------- end Test Default Dicom Dictionary : --------" << std::endl;
+   std::cout << "---- end Test Default Dicom Dictionary : -------" << std::endl;
 
    // Lets delete it.
-   delete tempDict;
+   tempDict->Delete();
 
  
    // Print the DictSet
@@ -48,7 +48,7 @@ int TestDict(int , char* [])
 
    std::cout<<"DictSet content :\n";
 
-   gdcm::Dict *d = dicts->GetFirstEntry();
+   gdcm::Dict *d = dicts->GetFirstDict();
    if (!d)
    {
       std::cout << "Dictset is empty" << std::endl;
@@ -63,7 +63,7 @@ int TestDict(int , char* [])
    {
       std::cout << "------------- a Dict is found : ----------" << std::endl;
       d->Print();
-      d = dicts->GetNextEntry();
+      d = dicts->GetNextDict();
    }
 
    // Print the Dict (public)
@@ -81,7 +81,7 @@ int TestDict(int , char* [])
    std::cout<<"#######################################################\n";
    const int ENTRY_GR = 0x10;
    const int ENTRY_EL = 0x20;
-   std::string key=gdcm::DictEntry::TranslateToKey(ENTRY_GR,ENTRY_EL);
+   gdcm::TagKey key = gdcm::DictEntry::TranslateToKey(ENTRY_GR,ENTRY_EL);
    gdcm::DictEntry *entry=pubDict->GetEntry(ENTRY_GR,ENTRY_EL);
    if(!entry)
    {