@GwtIncompatible // works with real browsers but fails with HtmlUnit public void testSortWorksWithNaNNonGwt() { assertTrue(sortWorksWithNaN()); }
public void testSortDescending() { testSortDescending(new double[] {}, new double[] {}); testSortDescending(new double[] {1}, new double[] {1}); testSortDescending(new double[] {1, 2}, new double[] {2, 1}); testSortDescending(new double[] {1, 3, 1}, new double[] {3, 1, 1}); testSortDescending(new double[] {-1, 1, -2, 2}, new double[] {2, 1, -1, -2}); if (sortWorksWithNaN()) { testSortDescending( new double[] {-1, 1, Double.NaN, -2, -0, 0, 2}, new double[] {Double.NaN, 2, 1, 0, -0, -1, -2}); } }
public void testSortDescendingIndexed() { testSortDescending(new double[] {}, 0, 0, new double[] {}); testSortDescending(new double[] {1}, 0, 1, new double[] {1}); testSortDescending(new double[] {1, 2}, 0, 2, new double[] {2, 1}); testSortDescending(new double[] {1, 3, 1}, 0, 2, new double[] {3, 1, 1}); testSortDescending(new double[] {1, 3, 1}, 0, 1, new double[] {1, 3, 1}); testSortDescending(new double[] {-1, -2, 1, 2}, 1, 3, new double[] {-1, 1, -2, 2}); if (sortWorksWithNaN()) { testSortDescending( new double[] {-1, 1, Double.NaN, -2, 2}, 1, 4, new double[] {-1, Double.NaN, 1, -2, 2}); } }