From 6b2e514c26133cdcb9aacbddbde84aa901c66bdf Mon Sep 17 00:00:00 2001 From: Sebastian Baunsgaard Date: Sun, 20 Aug 2023 13:30:42 +0200 Subject: [PATCH] count Nan fix --- .../test/component/compress/util/CountMapTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/apache/sysds/test/component/compress/util/CountMapTest.java b/src/test/java/org/apache/sysds/test/component/compress/util/CountMapTest.java index 334553ea831..fecaf28d07c 100644 --- a/src/test/java/org/apache/sysds/test/component/compress/util/CountMapTest.java +++ b/src/test/java/org/apache/sysds/test/component/compress/util/CountMapTest.java @@ -217,9 +217,15 @@ public void getDictionary() { assertEquals((double) i, d[i], 0.0); } - @Test(expected = NullPointerException.class) + @Test() public void getNan() { m.increment(Double.NaN); - m.getId(Double.NaN); + assertEquals(0, m.getId(Double.NaN)); + m.increment(Double.NaN); + assertEquals(0, m.getId(Double.NaN)); + m.increment(1.0); + assertEquals(0, m.getId(Double.NaN)); + m.increment(Double.NaN); + assertEquals(0, m.getId(Double.NaN)); } }