struct test_case { char *name; int *unsorted; int *sorted; int len; }; #define TEST_ARR_INIT(arrname) \ struct test_case arrname[] = { \ {"null_array_test", _test0, _res0, ARRSZ(_test0)}, \ {"single_element_test", _test1, _res1, ARRSZ(_test1)}, \ {"simple1", _test2, _res2, ARRSZ(_test2)}, \ {"simple2", _test3, _res3, ARRSZ(_test3)}, \ } int _test0[] = {}; int _res0[] = {}; int _test1[] = {0}; int _res1[] = {0}; int _test2[] = { 504, 9245, 3289, 7184, 5410, 2261, 6503, 4235, 8415, 827, 3420, 9730, 9428, 7215, 273, 8245, 6529, 7690, 2846, 4412 }; int _res2[] = { 273, 504, 827, 2261, 2846, 3289, 3420, 4235, 4412, 5410, 6503, 6529, 7184, 7215, 7690, 8245, 8415, 9245, 9428, 9730 }; int _test3[] = { 98331, 13683, 97511, 15357, 56393, 89831, 7904, 74770, 15487, 23946, 32739, 1128, 56514, 33644, 19980, 52769, 56319, 26639, 88561, 67117, 73982, 75835, 40059, 77485, 71858, 92894, 73648, 96021, 7269, 15689, 44994, 49276, 17429, 46491, 10271, 16281, 97307, 86615, 10603, 8643, 18066, 79695, 82937, 52337, 42199, 44473, 96145, 19807, 17431, 91971, 18274, 54676, 6445, 65513, 26458, 88252, 83712, 66622, 76657, 57946, 98056, 16875, 40892, 19293, 14820, 19020, 46293, 66041, 25840, 18989, 89892, 12201, 34180, 59271, 14512, 35198, 94562, 11379, 96972, 64998, 21820, 24021, 44192, 87773, 93483, 22016, 96859, 43760, 33447, 29202, 93463, 57147, 87856, 24973, 14629, 68993, 96040, 63305, 97917, 2874, }; int _res3[] = { 1128, 2874, 6445, 7269, 7904, 8643, 10271, 10603, 11379, 12201, 13683, 14512, 14629, 14820, 15357, 15487, 15689, 16281, 16875, 17429, 17431, 18066, 18274, 18989, 19020, 19293, 19807, 19980, 21820, 22016, 23946, 24021, 24973, 25840, 26458, 26639, 29202, 32739, 33447, 33644, 34180, 35198, 40059, 40892, 42199, 43760, 44192, 44473, 44994, 46293, 46491, 49276, 52337, 52769, 54676, 56319, 56393, 56514, 57147, 57946, 59271, 63305, 64998, 65513, 66041, 66622, 67117, 68993, 71858, 73648, 73982, 74770, 75835, 76657, 77485, 79695, 82937, 83712, 86615, 87773, 87856, 88252, 88561, 89831, 89892, 91971, 92894, 93463, 93483, 94562, 96021, 96040, 96145, 96859, 96972, 97307, 97511, 97917, 98056, 98331 };