mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-02 22:48:35 +00:00
7091366: re-enable quicksort tests
Added extern "C" to make it build with JDK6 compilers Reviewed-by: jwilhelm, kvn
This commit is contained in:
parent
55c503aea2
commit
cc177fd515
@ -54,16 +54,18 @@ static int test_even_odd_comparator(int a, int b) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int test_stdlib_comparator(const void* a, const void* b) {
|
||||
int ai = *(int*)a;
|
||||
int bi = *(int*)b;
|
||||
if (ai == bi) {
|
||||
return 0;
|
||||
extern "C" {
|
||||
static int test_stdlib_comparator(const void* a, const void* b) {
|
||||
int ai = *(int*)a;
|
||||
int bi = *(int*)b;
|
||||
if (ai == bi) {
|
||||
return 0;
|
||||
}
|
||||
if (ai < bi) {
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (ai < bi) {
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void QuickSort::print_array(const char* prefix, int* array, int length) {
|
||||
@ -92,7 +94,6 @@ bool QuickSort::sort_and_compare(int* arrayToSort, int* expectedResult, int leng
|
||||
}
|
||||
|
||||
bool QuickSort::test_quick_sort() {
|
||||
#if 0
|
||||
tty->print_cr("test_quick_sort\n");
|
||||
{
|
||||
int* test_array = NULL;
|
||||
@ -213,7 +214,6 @@ bool QuickSort::test_quick_sort() {
|
||||
delete[] test_array;
|
||||
delete[] expected_array;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user