src/share/vm/utilities/quickSort.cpp

changeset 3146
8ab2f4108d20
parent 2976
04760e41b01e
child 3177
e807478bf9ca
equal deleted inserted replaced
3145:558f525a6ebe 3146:8ab2f4108d20
90 sort<int, C>(arrayToSort, length, comparator, idempotent); 90 sort<int, C>(arrayToSort, length, comparator, idempotent);
91 return compare_arrays(arrayToSort, expectedResult, length); 91 return compare_arrays(arrayToSort, expectedResult, length);
92 } 92 }
93 93
94 bool QuickSort::test_quick_sort() { 94 bool QuickSort::test_quick_sort() {
95 #if 0
95 tty->print_cr("test_quick_sort\n"); 96 tty->print_cr("test_quick_sort\n");
96 { 97 {
97 int* test_array = NULL; 98 int* test_array = NULL;
98 int* expected_array = NULL; 99 int* expected_array = NULL;
99 assert(sort_and_compare(test_array, expected_array, 0, test_comparator), "Empty array not handled"); 100 assert(sort_and_compare(test_array, expected_array, 0, test_comparator), "Empty array not handled");
210 assert(compare_arrays(test_array, expected_array, length), "Sorting already sorted array changed order of elements - not idempotent"); 211 assert(compare_arrays(test_array, expected_array, length), "Sorting already sorted array changed order of elements - not idempotent");
211 212
212 delete[] test_array; 213 delete[] test_array;
213 delete[] expected_array; 214 delete[] expected_array;
214 } 215 }
216 #endif
215 return true; 217 return true;
216 } 218 }
217 219
218 #endif 220 #endif

mercurial