Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-exini committed May 20, 2020
1 parent 1f8e534 commit 9ddd166
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/main/scala/com/exini/dicom/streams/CollectFlow.scala
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,14 @@ object CollectFlow {

case valueChunk: ValueChunk =>
bytes = bytes ++ valueChunk.bytes
if (valueChunk.last)
if (valueChunk.last) {
if (inFragments)
currentFragment.map(_.copy(value = Value(bytes))).foreach(maybeAdd)
else
currentValue.map(_.copy(value = Value(bytes))).foreach(maybeAdd)
currentFragment = None
currentValue = None
}
Nil

case sequence: SequencePart =>
Expand Down
3 changes: 2 additions & 1 deletion src/test/scala/com/exini/dicom/streams/CollectFlowTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class CollectFlowTest
e.elements.size shouldBe 2
e.elements(Tag.PatientID) should not be empty
e.elements(Tag.DerivationCodeSequence) should not be empty
e.elements.getSequence(Tag.DerivationCodeSequence).get.item(1).size shouldBe 1
e.elements.getSequence(Tag.DerivationCodeSequence).get.item(1).get.elements.size shouldBe 3
}
}

Expand All @@ -188,6 +188,7 @@ class CollectFlowTest
val f = e.elements.getFragments(Tag.PixelData)
f should not be empty
f.get.offsets shouldBe defined
f.get.offsets.get should have length 1
f.get.fragments should have length 1
}
}
Expand Down

0 comments on commit 9ddd166

Please sign in to comment.