提交 ff51a420 编写于 作者: B brutisso

7091366: re-enable quicksort tests

Summary: Added extern "C" to make it build with JDK6 compilers
Reviewed-by: jwilhelm, kvn
上级 4a18c97a
...@@ -54,7 +54,8 @@ static int test_even_odd_comparator(int a, int b) { ...@@ -54,7 +54,8 @@ static int test_even_odd_comparator(int a, int b) {
return 1; return 1;
} }
static int test_stdlib_comparator(const void* a, const void* b) { extern "C" {
static int test_stdlib_comparator(const void* a, const void* b) {
int ai = *(int*)a; int ai = *(int*)a;
int bi = *(int*)b; int bi = *(int*)b;
if (ai == bi) { if (ai == bi) {
...@@ -64,6 +65,7 @@ static int test_stdlib_comparator(const void* a, const void* b) { ...@@ -64,6 +65,7 @@ static int test_stdlib_comparator(const void* a, const void* b) {
return -1; return -1;
} }
return 1; return 1;
}
} }
void QuickSort::print_array(const char* prefix, int* array, int length) { 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 ...@@ -92,7 +94,6 @@ bool QuickSort::sort_and_compare(int* arrayToSort, int* expectedResult, int leng
} }
bool QuickSort::test_quick_sort() { bool QuickSort::test_quick_sort() {
#if 0
tty->print_cr("test_quick_sort\n"); tty->print_cr("test_quick_sort\n");
{ {
int* test_array = NULL; int* test_array = NULL;
...@@ -213,7 +214,6 @@ bool QuickSort::test_quick_sort() { ...@@ -213,7 +214,6 @@ bool QuickSort::test_quick_sort() {
delete[] test_array; delete[] test_array;
delete[] expected_array; delete[] expected_array;
} }
#endif
return true; return true;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册