# HG changeset patch
# User Alain Mazy <am@osimis.io>
# Date 1692719401 -7200
# Node ID aa56dcf599b975e5a09f425cd0c67e988c4b5c77
# Parent  7381a7674b363b94a87e1aecb1887df3bc17f090
fix unit tests

diff -r 7381a7674b36 -r aa56dcf599b9 Plugin/ResourceHierarchyCache.cpp
--- a/Plugin/ResourceHierarchyCache.cpp	Fri Aug 18 12:08:49 2023 +0200
+++ b/Plugin/ResourceHierarchyCache.cpp	Tue Aug 22 17:50:01 2023 +0200
@@ -250,6 +250,14 @@
   {
     cache_->Store(ComputeKey(childLevel, childOrthancId), parentOrthancId, 0 /* no expiration */);
   }
+
+  void ResourceHierarchyCache::AddLabels(Orthanc::ResourceType level,
+                                         const std::string& orthancId,
+                                         const std::string& serializedLabels)
+  {
+    labels_->Store(ComputeKey(level, orthancId), serializedLabels, 0 /* no expiration */);
+  }
+
 #endif
 
 }
diff -r 7381a7674b36 -r aa56dcf599b9 Plugin/ResourceHierarchyCache.h
--- a/Plugin/ResourceHierarchyCache.h	Fri Aug 18 12:08:49 2023 +0200
+++ b/Plugin/ResourceHierarchyCache.h	Tue Aug 22 17:50:01 2023 +0200
@@ -107,6 +107,10 @@
     void AddParentLink(Orthanc::ResourceType childLevel,
                        const std::string& childOrthancId,
                        const std::string& parentOrthancId);
+
+    void AddLabels(Orthanc::ResourceType level,
+                   const std::string& orthancId,
+                   const std::string& serializedLabels);
 #endif
   };
 }
diff -r 7381a7674b36 -r aa56dcf599b9 UnitTestsSources/UnitTestsMain.cpp
--- a/UnitTestsSources/UnitTestsMain.cpp	Fri Aug 18 12:08:49 2023 +0200
+++ b/UnitTestsSources/UnitTestsMain.cpp	Tue Aug 22 17:50:01 2023 +0200
@@ -74,6 +74,11 @@
   cache->AddParentLink(Orthanc::ResourceType_Series, seriesOrthancId, studyOrthancId);
   cache->AddParentLink(Orthanc::ResourceType_Study, studyOrthancId, patientOrthancId);
 
+  cache->AddLabels(Orthanc::ResourceType_Series, seriesOrthancId, "series-label");
+  cache->AddLabels(Orthanc::ResourceType_Study, studyOrthancId, "study-label");
+  cache->AddLabels(Orthanc::ResourceType_Instance, instanceOrthancId, "instance-label");
+  cache->AddLabels(Orthanc::ResourceType_Patient, patientOrthancId, "patient-label");
+
   IAuthorizationParser::AccessedResources accesses;
   AssociativeArray noGetArguments(0, NULL, NULL, false);