comparison UnitTestsSources/ServerIndexTests.cpp @ 3075:ead8576a02ef db-changes

IDatabaseWrapper::ApplyLookupResources now returns lists
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 02 Jan 2019 18:39:25 +0100
parents 0e9d1731b1b0
children 1a75595d8e44
comparison
equal deleted inserted replaced
3074:495c5edce708 3075:ead8576a02ef
247 throw OrthancException(ErrorCode_InternalError); 247 throw OrthancException(ErrorCode_InternalError);
248 } 248 }
249 } 249 }
250 250
251 251
252 void DoLookupIdentifier(std::vector<std::string>& result, 252 void DoLookupIdentifier(std::list<std::string>& result,
253 ResourceType level, 253 ResourceType level,
254 const DicomTag& tag, 254 const DicomTag& tag,
255 ConstraintType type, 255 ConstraintType type,
256 const std::string& value) 256 const std::string& value)
257 { 257 {
264 264
265 index_->ApplyLookupResources(result, NULL, lookup, level, 0 /* no limit */); 265 index_->ApplyLookupResources(result, NULL, lookup, level, 0 /* no limit */);
266 } 266 }
267 267
268 268
269 void DoLookupIdentifier2(std::vector<std::string>& result, 269 void DoLookupIdentifier2(std::list<std::string>& result,
270 ResourceType level, 270 ResourceType level,
271 const DicomTag& tag, 271 const DicomTag& tag,
272 ConstraintType type1, 272 ConstraintType type1,
273 const std::string& value1, 273 const std::string& value1,
274 ConstraintType type2, 274 ConstraintType type2,
738 index_->SetIdentifierTag(a[0], DICOM_TAG_STUDY_INSTANCE_UID, "0"); 738 index_->SetIdentifierTag(a[0], DICOM_TAG_STUDY_INSTANCE_UID, "0");
739 index_->SetIdentifierTag(a[1], DICOM_TAG_STUDY_INSTANCE_UID, "1"); 739 index_->SetIdentifierTag(a[1], DICOM_TAG_STUDY_INSTANCE_UID, "1");
740 index_->SetIdentifierTag(a[2], DICOM_TAG_STUDY_INSTANCE_UID, "0"); 740 index_->SetIdentifierTag(a[2], DICOM_TAG_STUDY_INSTANCE_UID, "0");
741 index_->SetIdentifierTag(a[3], DICOM_TAG_SERIES_INSTANCE_UID, "0"); 741 index_->SetIdentifierTag(a[3], DICOM_TAG_SERIES_INSTANCE_UID, "0");
742 742
743 std::vector<std::string> s; 743 std::list<std::string> s;
744 744
745 DoLookupIdentifier(s, ResourceType_Study, DICOM_TAG_STUDY_INSTANCE_UID, ConstraintType_Equal, "0"); 745 DoLookupIdentifier(s, ResourceType_Study, DICOM_TAG_STUDY_INSTANCE_UID, ConstraintType_Equal, "0");
746 ASSERT_EQ(2u, s.size()); 746 ASSERT_EQ(2u, s.size());
747 ASSERT_TRUE(std::find(s.begin(), s.end(), "a") != s.end()); 747 ASSERT_TRUE(std::find(s.begin(), s.end(), "a") != s.end());
748 ASSERT_TRUE(std::find(s.begin(), s.end(), "c") != s.end()); 748 ASSERT_TRUE(std::find(s.begin(), s.end(), "c") != s.end());