X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Futil%2FQuickSortTest.java;fp=test%2Fjalview%2Futil%2FQuickSortTest.java;h=bf9d16b187454184e0d23fb46d7b14b995443b6e;hb=3459a8a691cb22508d7067f240b7254e588e77d3;hp=f09dee95df66618141e48329a5867f56548edeca;hpb=5b27f1062b2203c4c31702e205f4c78e1992063e;p=jalview.git diff --git a/test/jalview/util/QuickSortTest.java b/test/jalview/util/QuickSortTest.java index f09dee9..bf9d16b 100644 --- a/test/jalview/util/QuickSortTest.java +++ b/test/jalview/util/QuickSortTest.java @@ -120,8 +120,9 @@ public class QuickSortTest String[] values = new String[] { "JOHN", "henry", "lucy", "henry", "ALISON" }; QuickSort.sort(values, things); - assertTrue(Arrays.equals(new String[] { "lucy", "henry", "henry", - "JOHN", "ALISON" }, values)); + assertTrue( + Arrays.equals(new String[] + { "lucy", "henry", "henry", "JOHN", "ALISON" }, values)); assertTrue(Arrays.equals(new Object[] { c3, c2, c4, c1, c5 }, things)); } @@ -136,8 +137,9 @@ public class QuickSortTest QuickSort.sort(values, letters); assertTrue(Arrays.equals(new int[] { 1, 2, 3, 4, 4 }, values)); // this fails - do we care? - assertTrue(Arrays.equals(new Object[] { "Z", "Y", "A", "X", "B" }, - letters)); + assertTrue( + Arrays.equals(new Object[] + { "Z", "Y", "A", "X", "B" }, letters)); } /** @@ -194,10 +196,9 @@ public class QuickSortTest QuickSort.sort(counts, residues); } long elapsed = System.currentTimeMillis() - start; - System.out - .println(String - .format("Time for %d optimised sorts of mostly zeros array length %d was %dms", - iterations, counts.length, elapsed)); + System.out.println(String.format( + "Time for %d optimised sorts of mostly zeros array length %d was %dms", + iterations, counts.length, elapsed)); /* * time it using unoptimised external sort @@ -212,10 +213,9 @@ public class QuickSortTest QuickSort.charSortByFloat(counts, residues, true); } elapsed = System.currentTimeMillis() - start; - System.out - .println(String - .format("Time for %d external sorts of mostly zeros array length %d was %dms", - iterations, counts.length, elapsed)); + System.out.println(String.format( + "Time for %d external sorts of mostly zeros array length %d was %dms", + iterations, counts.length, elapsed)); /* * optimised external sort, well-filled array @@ -234,10 +234,9 @@ public class QuickSortTest QuickSort.sort(counts, residues); } elapsed = System.currentTimeMillis() - start; - System.out - .println(String - .format("Time for %d optimised sorts of non-zeros array length %d was %dms", - iterations, counts.length, elapsed)); + System.out.println(String.format( + "Time for %d optimised sorts of non-zeros array length %d was %dms", + iterations, counts.length, elapsed)); /* * time unoptimised external sort, filled array @@ -249,10 +248,9 @@ public class QuickSortTest QuickSort.charSortByFloat(counts, residues, true); } elapsed = System.currentTimeMillis() - start; - System.out - .println(String - .format("Time for %d external sorts of non-zeros array length %d was %dms", - iterations, counts.length, elapsed)); + System.out.println(String.format( + "Time for %d external sorts of non-zeros array length %d was %dms", + iterations, counts.length, elapsed)); } /** @@ -357,16 +355,18 @@ public class QuickSortTest * sort descending */ QuickSort.sortByString(values, things, false); - assertTrue(Arrays.equals(new String[] { "lucy", "henry", "henry", - "JOHN", "ALISON" }, values)); + assertTrue( + Arrays.equals(new String[] + { "lucy", "henry", "henry", "JOHN", "ALISON" }, values)); assertTrue(Arrays.equals(new Object[] { c3, c2, c4, c1, c5 }, things)); /* * resort ascending */ QuickSort.sortByString(values, things, true); - assertTrue(Arrays.equals(new String[] { "ALISON", "JOHN", "henry", - "henry", "lucy" }, values)); + assertTrue( + Arrays.equals(new String[] + { "ALISON", "JOHN", "henry", "henry", "lucy" }, values)); // sort is stable: c2/c4 do not swap order assertTrue(Arrays.equals(new Object[] { c5, c1, c2, c4, c3 }, things)); }