changeset 4736:bf852fd773b7

fix unit test FromDcmtkBridge.VisitorRemoveTag on DCMTK 3.6.6
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 05 Jul 2021 17:50:58 +0200
parents e17fdc43ef6c
children 979ae3ea3381
files OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp
diffstat 1 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp	Mon Jul 05 17:03:46 2021 +0200
+++ b/OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp	Mon Jul 05 17:50:58 2021 +0200
@@ -61,7 +61,7 @@
 #include <dcmtk/dcmdata/dcdeftag.h>
 #include <dcmtk/dcmdata/dcelem.h>
 #include <dcmtk/dcmdata/dcvrat.h>
-#include <dcmtk/dcmdata/dcbytstr.h>
+#include <dcmtk/dcmdata/dcpxitem.h>
 #include <dcmtk/dcmdata/dcvrss.h>
 #include <dcmtk/dcmdata/dcvrfl.h>
 
@@ -2927,25 +2927,24 @@
       dicom->GetDcmtkObject().getDataset()->insert(s.release());
     }
   
+    DcmItem *parent = NULL;
+    ASSERT_TRUE(dicom->GetDcmtkObject().getDataset()->findAndGetSequenceItem(DCM_ReferencedImageSequence, parent, 0).good());
+
     {
       const float a[] = { 42, 43, 47 };
       std::unique_ptr<DcmFloatingPointSingle> s(new DcmFloatingPointSingle(DCM_ExaminedBodyThickness));  // VisitDoubles()
       ASSERT_TRUE(s->putFloat32Array(a, 3).good());
-      DcmItem *item = NULL;
-      ASSERT_TRUE(dicom->GetDcmtkObject().getDataset()->findAndGetSequenceItem(DCM_ReferencedImageSequence, item, 0).good());
-      item->insert(s.release());
+      parent->insert(s.release());
     }
   
     {
       const uint16_t a[] = { 0x0008, 0x0020, 0x0008, 0x0030 };
       std::unique_ptr<DcmAttributeTag> s(new DcmAttributeTag(DCM_DimensionIndexPointer));  // VisitAttributes()
       ASSERT_TRUE(s->putUint16Array(a, 2).good());
-      DcmItem *item = NULL;
-      ASSERT_TRUE(dicom->GetDcmtkObject().getDataset()->findAndGetSequenceItem(DCM_ReferencedImageSequence, item, 0).good());
-      item->insert(s.release());
+      parent->insert(s.release());
     }
-  
-    ASSERT_TRUE(dicom->GetDcmtkObject().getDataset()->insert(new DcmByteString(DCM_PixelData)).good());  // VisitNotSupported()
+
+    ASSERT_TRUE(dicom->GetDcmtkObject().getDataset()->insert(new DcmPixelItem(DCM_PixelData)).good());  // VisitNotSupported()
   }
 
   {