Added test to confirm null contract. JIRA: MATH-1007.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1504656 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c6cba39616
commit
bedea0067e
|
@ -543,6 +543,14 @@ public final class StatUtilsTest {
|
||||||
final double[] nansOnly = {Double.NaN, Double.NaN};
|
final double[] nansOnly = {Double.NaN, Double.NaN};
|
||||||
final double[] modeNansOnly = StatUtils.mode(nansOnly);
|
final double[] modeNansOnly = StatUtils.mode(nansOnly);
|
||||||
Assert.assertEquals(0, modeNansOnly.length);
|
Assert.assertEquals(0, modeNansOnly.length);
|
||||||
|
|
||||||
|
final double[] nullArray = null;
|
||||||
|
try {
|
||||||
|
StatUtils.mode(nullArray);
|
||||||
|
Assert.fail("Expecting MathIllegalArgumentException");
|
||||||
|
} catch (MathIllegalArgumentException ex) {
|
||||||
|
// Expected
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue