Skip to content

Commit

Permalink
hashCode overridden and test updated
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrik-exini committed Oct 31, 2018
1 parent f56c0c2 commit 9deb3d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/scala/se/nimsa/dicom/data/CharacterSets.scala
Expand Up @@ -78,6 +78,8 @@ class CharacterSets(val charsetNames: Seq[String]) {
case thatCharSets: CharacterSets => charsetNames == thatCharSets.charsetNames
case _ => this == that
}

override def hashCode(): Int = charsetNames.hashCode
}

object CharacterSets {
Expand Down
1 change: 1 addition & 0 deletions src/test/scala/se/nimsa/dicom/data/CharacterSetsTest.scala
Expand Up @@ -107,6 +107,7 @@ class CharacterSetsTest extends TestKit(ActorSystem("CharacterSetsSpec")) with F
val cs1 = new CharacterSets(Seq("ISO 2022 IR 13", "ISO 2022 IR 87"))
val cs2 = new CharacterSets(Seq("ISO 2022 IR 13", "ISO 2022 IR 87"))
cs1 shouldBe cs2
cs1.hashCode shouldBe cs2.hashCode
}

private def checkPatientName(name: String, expectedCodePoints: Array[Int]): Unit = {
Expand Down

0 comments on commit 9deb3d0

Please sign in to comment.