From d14cfbd816a44d6e135decbdb25bcb991a28a0bd Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Tue, 23 Nov 2021 16:54:16 +0100 Subject: [PATCH] JAL-3066 Fix ambiguous assertEquals casting values to double. --- .../HMMProbabilityDistributionAnalyserTest.java | 34 ++++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/test/jalview/util/HMMProbabilityDistributionAnalyserTest.java b/test/jalview/util/HMMProbabilityDistributionAnalyserTest.java index 4dbf05e..ec59c14 100644 --- a/test/jalview/util/HMMProbabilityDistributionAnalyserTest.java +++ b/test/jalview/util/HMMProbabilityDistributionAnalyserTest.java @@ -1,13 +1,13 @@ package jalview.util; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNull; - import jalview.datamodel.HMMNode; import jalview.datamodel.HiddenMarkovModel; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNull; + import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; @@ -75,10 +75,10 @@ public class HMMProbabilityDistributionAnalyserTest { { analyser.readBinned("test/jalview/util/"); Map map = analyser.binned; - assertEquals(map.get("1.8"), 4.53); - assertEquals(map.get("3.4"), 2.65); - assertEquals(map.get("6.4"), 10.8); - assertEquals(map.get("0"), 5.4); + assertEquals((double) map.get("1.8"), 4.53); + assertEquals((double) map.get("3.4"), 2.65); + assertEquals((double) map.get("6.4"), 10.8); + assertEquals((double) map.get("0"), 5.4); } @Test @@ -87,11 +87,11 @@ public class HMMProbabilityDistributionAnalyserTest { analyser.readRaw("test/jalview/util/"); List> list = analyser.raw; - assertEquals(list.get(0).get(0), 1.43); + assertEquals((double) list.get(0).get(0), 1.43); assertNull(list.get(0).get(2)); - assertEquals(list.get(1).get(1), 1.2); - assertEquals(list.get(2).get(0), 5.6); - assertEquals(list.get(2).get(2), 6.8); + assertEquals((double) list.get(1).get(1), 1.2); + assertEquals((double) list.get(2).get(0), 5.6); + assertEquals((double) list.get(2).get(2), 6.8); } @@ -108,12 +108,12 @@ public class HMMProbabilityDistributionAnalyserTest { analyser.processData(6); Map map = analyser.binned; List> list = analyser.raw; - assertEquals(map.get("1.8"), 4.863, 0.001d); - assertEquals(map.get("3.4"), 2.65); - assertEquals(map.get("0"), 5.4); - assertEquals(map.get("6.4"), 10.8); - assertEquals(map.get("1.4"), 0.166667, 0.00001d); - assertEquals(map.get("4.4"), 0.5); + assertEquals((double) map.get("1.8"), 4.863d, 0.001d); + assertEquals((double) map.get("3.4"), 2.65); + assertEquals((double) map.get("0"), 5.4); + assertEquals((double) map.get("6.4"), 10.8); + assertEquals((double) map.get("1.4"), 0.166667, 0.00001d); + assertEquals((double) map.get("4.4"), 0.5); } } -- 1.7.10.2