comparison UnitTestsSources/ServerIndexTests.cpp @ 2898:e5e3253a1164

DicomInstanceToStore::GetHasher()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 18 Oct 2018 11:44:17 +0200
parents 859a4950d48f
children 22524fd06225
comparison
equal deleted inserted replaced
2897:9ff17eb830ec 2898:e5e3253a1164
818 DicomInstanceHasher hasher(instance); 818 DicomInstanceHasher hasher(instance);
819 ids.push_back(hasher.HashPatient()); 819 ids.push_back(hasher.HashPatient());
820 ids.push_back(hasher.HashStudy()); 820 ids.push_back(hasher.HashStudy());
821 ids.push_back(hasher.HashSeries()); 821 ids.push_back(hasher.HashSeries());
822 ids.push_back(hasher.HashInstance()); 822 ids.push_back(hasher.HashInstance());
823
824 ASSERT_EQ(hasher.HashPatient(), toStore.GetHasher().HashPatient());
825 ASSERT_EQ(hasher.HashStudy(), toStore.GetHasher().HashStudy());
826 ASSERT_EQ(hasher.HashSeries(), toStore.GetHasher().HashSeries());
827 ASSERT_EQ(hasher.HashInstance(), toStore.GetHasher().HashInstance());
823 } 828 }
824 829
825 index.ComputeStatistics(tmp); 830 index.ComputeStatistics(tmp);
826 ASSERT_EQ(10, tmp["CountPatients"].asInt()); 831 ASSERT_EQ(10, tmp["CountPatients"].asInt());
827 ASSERT_EQ(0, boost::lexical_cast<int>(tmp["TotalDiskSize"].asString())); 832 ASSERT_EQ(0, boost::lexical_cast<int>(tmp["TotalDiskSize"].asString()));
882 887
883 { 888 {
884 DicomInstanceToStore toStore; 889 DicomInstanceToStore toStore;
885 toStore.SetSummary(instance); 890 toStore.SetSummary(instance);
886 toStore.SetOrigin(DicomInstanceOrigin::FromPlugins()); 891 toStore.SetOrigin(DicomInstanceOrigin::FromPlugins());
892 ASSERT_EQ(id, toStore.GetHasher().HashInstance());
887 893
888 std::string id2; 894 std::string id2;
889 ASSERT_EQ(StoreStatus_Success, context.Store(id2, toStore)); 895 ASSERT_EQ(StoreStatus_Success, context.Store(id2, toStore));
890 ASSERT_EQ(id, id2); 896 ASSERT_EQ(id, id2);
891 } 897 }