Lines Matching defs:expected_array
99 int* expected_array = NULL;
100 assert(sort_and_compare(test_array, expected_array, 0, test_comparator), "Empty array not handled");
104 int expected_array[] = {3};
105 assert(sort_and_compare(test_array, expected_array, 1, test_comparator), "Single value array not handled");
109 int expected_array[] = {2,3};
110 assert(sort_and_compare(test_array, expected_array, 2, test_comparator), "Array with 2 values not correctly sorted");
114 int expected_array[] = {1,2,3};
115 assert(sort_and_compare(test_array, expected_array, 3, test_comparator), "Array with 3 values not correctly sorted");
119 int expected_array[] = {1,2,3,4};
120 assert(sort_and_compare(test_array, expected_array, 4, test_comparator), "Array with 4 values not correctly sorted");
124 int expected_array[] = {0,1,2,3,4,5,6,7,8,9};
125 assert(sort_and_compare(test_array, expected_array, 10, test_comparator), "Array with 10 values not correctly sorted");
129 int expected_array[] = {1,4,4,4};
130 assert(sort_and_compare(test_array, expected_array, 4, test_comparator), "3 duplicates not sorted correctly");
134 int expected_array[] = {0,1,2,3,4,5,6,7,8,9};
135 assert(sort_and_compare(test_array, expected_array, 10, test_comparator), "Already sorted array not correctly sorted");
140 int expected_array[] = {6,7,8,8,9,9,11,11,13,21,22,24,24,25,27,27,28,31,32,39,40,40,40,41,44,46,51,55,56,59,64,64,65,69,71,74,75,75,76,78,81,82};
141 assert(sort_and_compare(test_array, expected_array, 42, test_comparator), "Not correctly sorted");
145 int expected_array[] = {1,4,2,8};
146 assert(sort_and_compare(test_array, expected_array, 4, test_even_odd_comparator), "Even/odd not sorted correctly");
152 int expected_array[] = {1,4,8};
153 assert(sort_and_compare(test_array, expected_array, 3, test_even_odd_comparator, true), "Even/odd not idempotent");
157 int expected_array[] = {1,7,9,4,8,2};
158 assert(sort_and_compare(test_array, expected_array, 6, test_even_odd_comparator, true), "Even/odd not idempotent");
162 int expected_array[] = {1,9,7,4,2,8};
163 assert(sort_and_compare(test_array, expected_array, 6, test_even_odd_comparator, true), "Even/odd not idempotent");
167 int expected_array[] = {7,9,1,2,8,4};
168 assert(sort_and_compare(test_array, expected_array, 6, test_even_odd_comparator, true), "Even/odd not idempotent");
172 int expected_array[] = {7,1,9,2,4,8};
173 assert(sort_and_compare(test_array, expected_array, 6, test_even_odd_comparator, true), "Even/odd not idempotent");
177 int expected_array[] = {9,1,7,4,8,2};
178 assert(sort_and_compare(test_array, expected_array, 6, test_even_odd_comparator, true), "Even/odd not idempotent");
182 int expected_array[] = {9,7,1,4,2,8};
183 assert(sort_and_compare(test_array, expected_array, 6, test_even_odd_comparator, true), "Even/odd not idempotent");
191 int* expected_array = new int[length];
195 expected_array[j] = test_array[j];
199 qsort(expected_array, length, sizeof(int), test_stdlib_comparator);
200 assert(sort_and_compare(test_array, expected_array, length, test_comparator), "Random array not correctly sorted");
203 // Both test_array and expected_array are sorted by the test_comparator.
207 sort(expected_array, length, test_even_odd_comparator, true);
209 assert(compare_arrays(test_array, expected_array, length), "Sorting identical arrays rendered different results");
211 assert(compare_arrays(test_array, expected_array, length), "Sorting already sorted array changed order of elements - not idempotent");
214 delete[] expected_array;