X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestDictGroupName.cxx;h=47add5e4d81a36103500af421a1fd29f7dba1cb4;hb=f540ed5835e7b89478e6048a577d494c0e156f2a;hp=d8ee70160cd13a5b48c08541be6968ae447e7545;hpb=3a9e9df62b3198c4f93d1768074b6be828ac7308;p=gdcm.git diff --git a/Testing/TestDictGroupName.cxx b/Testing/TestDictGroupName.cxx index d8ee7016..47add5e4 100644 --- a/Testing/TestDictGroupName.cxx +++ b/Testing/TestDictGroupName.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestDictGroupName.cxx,v $ Language: C++ - Date: $Date: 2005/04/05 10:56:24 $ - Version: $Revision: 1.1 $ + Date: $Date: 2005/10/25 14:52:30 $ + 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 @@ -19,16 +19,32 @@ #include "gdcmGlobal.h" #include "gdcmCommon.h" +#include + +int CompareDictGroupName(gdcm::DictGroupName *groupName, + uint16_t group,std::string ref) +{ + std::string val = groupName->GetName(group); + std::cout << "Group : 0x" << std::hex << std::setw(4) << group + << std::dec << " : " << val << " - " + << (bool)(val==ref) << std::endl; + + return val!=ref; +} + int TestDictGroupName(int , char *[]) { - gdcm::DictGroupName groupName; - groupName.Print( std::cout ); + gdcm::DictGroupName *groupName = gdcm::DictGroupName::New(); + groupName->Print( std::cout ); + + int ret = 0; std::cout << std::endl; - std::cout << "Group : 0x0002 : " << groupName.GetName(0x0002) << " - " - << (bool)(groupName.GetName(0x0002)=="Meta Elements") << std::endl; - std::cout << "Group : 0x0007 : " << groupName.GetName(0x0007) << " - " - << (bool)(groupName.GetName(0x0007)==gdcm::GDCM_UNFOUND) << std::endl; + ret += CompareDictGroupName(groupName,0x0002,"Meta Elements"); + ret += CompareDictGroupName(groupName,0x7fe0,"Pixels"); + ret += CompareDictGroupName(groupName,0x0007,gdcm::GDCM_UNFOUND); + + groupName->Delete(); - return groupName.GetName( 0x7fe0 ) != ""; + return ret; }