comparison UnitTestsSources/DicomMapTests.cpp @ 1276:6164f7200c43

refactoring modules
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 23 Jan 2015 14:42:33 +0100
parents dfc076546821
children 6e7e5ed91c2d
comparison
equal deleted inserted replaced
1275:4287285709d1 1276:6164f7200c43
131 } 131 }
132 132
133 133
134 134
135 135
136 static void TestModule(ResourceType level) 136 static void TestModule(ResourceType level,
137 DicomModule module)
137 { 138 {
138 std::set<DicomTag> module, main; 139 std::set<DicomTag> moduleTags, main;
139 DicomTag::GetTagsForModule(module, level); 140 DicomTag::GetTagsForModule(moduleTags, module);
140 DicomMap::GetMainDicomTags(main, level); 141 DicomMap::GetMainDicomTags(main, level);
141 142
142 // The main dicom tags are a subset of the module 143 // The main dicom tags are a subset of the module
143 for (std::set<DicomTag>::const_iterator it = main.begin(); it != main.end(); it++) 144 for (std::set<DicomTag>::const_iterator it = main.begin(); it != main.end(); it++)
144 { 145 {
145 bool ok = module.find(*it) != module.end(); 146 bool ok = moduleTags.find(*it) != moduleTags.end();
146 147
147 // Exceptions for the Series level 148 // Exceptions for the Series level
148 /*if ((// 149 /*if ((//
149 *it == DicomTag(0x, 0x) && 150 *it == DicomTag(0x, 0x) &&
150 level == ResourceType_Series)) 151 level == ResourceType_Series))
180 } 181 }
181 182
182 183
183 TEST(DicomMap, Modules) 184 TEST(DicomMap, Modules)
184 { 185 {
185 TestModule(ResourceType_Patient); 186 TestModule(ResourceType_Patient, DicomModule_Patient);
186 TestModule(ResourceType_Study); 187 TestModule(ResourceType_Study, DicomModule_Study);
187 //TestModule(ResourceType_Series); // TODO 188 //TestModule(ResourceType_Series, DicomModule_Series); // TODO
188 TestModule(ResourceType_Instance); 189 TestModule(ResourceType_Instance, DicomModule_Instance);
189 } 190 }