Test of sort method, of class QuickSort.
()
| 48 | * Test of sort method, of class QuickSort. |
| 49 | */ |
| 50 | @Test |
| 51 | public void testSortD() |
| 52 | { |
| 53 | System.out.println("sort"); |
| 54 | Random rand = RandomUtil.getRandom(); |
| 55 | for(int size = 2; size < 10000; size*=2) |
| 56 | { |
| 57 | double[] x = new double[size]; |
| 58 | for(int i = 0; i < x.length; i++) |
| 59 | if(rand.nextInt(10) == 0)//force behavrio of multiple pivots with exact same value |
| 60 | x[i] = rand.nextInt(10); |
| 61 | else |
| 62 | x[i] = rand.nextDouble(); |
| 63 | QuickSort.sort(x, 0, size); |
| 64 | |
| 65 | for(int i = 0; i < x.length-1; i++) |
| 66 | assertTrue(x[i] <= x[i+1]); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | @Test |
| 71 | public void testSortDP() |
nothing calls this directly
no test coverage detected