Restored 1.5 compatatibility. Thanks, Gump.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1206672 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Phil Steitz 2011-11-27 07:07:56 +00:00
parent f4e3854e2f
commit 2b6b5bedbb
1 changed files with 6 additions and 4 deletions

View File

@ -17,7 +17,6 @@ s * Unless required by applicable law or agreed to in writing, software
package org.apache.commons.math.stat.descriptive;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -104,11 +103,14 @@ public abstract class UnivariateStatisticAbstractTest {
@Test
public void testEvaluateArraySegment() {
final UnivariateStatistic stat = getUnivariateStatistic();
final double[] arrayZero = Arrays.copyOfRange(testArray, 0, 5);
final double[] arrayZero = new double[5];
System.arraycopy(testArray, 0, arrayZero, 0, 5);
Assert.assertEquals(stat.evaluate(arrayZero), stat.evaluate(testArray, 0, 5), 0);
final double[] arrayOne = Arrays.copyOfRange(testArray, 5, 10);
final double[] arrayOne = new double[5];
System.arraycopy(testArray, 5, arrayOne, 0, 5);
Assert.assertEquals(stat.evaluate(arrayOne), stat.evaluate(testArray, 5, 5), 0);
final double[] arrayEnd = Arrays.copyOfRange(testArray, testArray.length - 5, testArray.length);
final double[] arrayEnd = new double[5];
System.arraycopy(testArray, testArray.length - 5, arrayEnd, 0, 5);
Assert.assertEquals(stat.evaluate(arrayEnd), stat.evaluate(testArray, testArray.length - 5, 5), 0);
}