@Test public void testLongsSortByDouble() { final int n = X1L.length; final long[] x2 = Arrays.copyOf(X2L, n); final double[] y2 = Arrays.copyOf(Y2D, n); ParallelArrayBinarySort.parallelBinarySort(x2, y2); assertTrue(Arrays.equals(X1L, x2)); assertTrue(Arrays.equals(Y1D, y2)); }
@Test public void testDoubleObject() { final int n = X2D.length; final double[] x2 = Arrays.copyOf(X2D, n); final Double[] y4 = Arrays.copyOf(Y4, n); ParallelArrayBinarySort.parallelBinarySort(x2, y4); assertArrayEquals(X1D, x2, 0); assertArrayEquals(Y3, y4); }
@Test public void testObjects() { final int n = F2.length; final Float[] f2 = Arrays.copyOf(F2, n); final Double[] y4 = Arrays.copyOf(Y4, n); ParallelArrayBinarySort.parallelBinarySort(f2, y4); assertArrayEquals(F1, f2); assertArrayEquals(Y3, y4); }
@Test public void testDoublesSortByInts() { final int n = X1D.length; final double[] x2 = Arrays.copyOf(X2D, n); final int[] y2 = Arrays.copyOf(Y2I, n); ParallelArrayBinarySort.parallelBinarySort(x2, y2); assertTrue(Arrays.equals(X1D, x2)); assertTrue(Arrays.equals(Y1I, y2)); }
@Test public void testFloatsSortByInts() { final int n = X1F.length; final float[] x2 = Arrays.copyOf(X2F, n); final int[] y2 = Arrays.copyOf(Y2I, n); ParallelArrayBinarySort.parallelBinarySort(x2, y2); assertTrue(Arrays.equals(X1F, x2)); assertTrue(Arrays.equals(Y1I, y2)); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testObjectDifferentLengths() { ParallelArrayBinarySort.parallelBinarySort(F1, new Double[] {2., 4., 6.}); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testObjectNullValues() { ParallelArrayBinarySort.parallelBinarySort(F1, null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testObjectNullKeys() { ParallelArrayBinarySort.parallelBinarySort((String[]) null, Y3); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDoubleObjectDifferentLengths() { ParallelArrayBinarySort.parallelBinarySort(X1D, new Object[] {2, 4, 6}); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDoubleObjectNullKeys() { ParallelArrayBinarySort.parallelBinarySort((double[]) null, Y1D); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDoubleNullValues() { ParallelArrayBinarySort.parallelBinarySort(X1D, (double[]) null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDoubleNullKeys() { double[] t = null; ParallelArrayBinarySort.parallelBinarySort(t, Y1D); }