diff options
Diffstat (limited to 'testcases.c')
-rw-r--r-- | testcases.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/testcases.c b/testcases.c index 25a2769..1a50632 100644 --- a/testcases.c +++ b/testcases.c @@ -52,6 +52,13 @@ static void init_sorted(size_t size) for (size_t i = 0; i < size; i++) buffer[i] = i; } +static void init_sorted2(size_t size) +{ + size_t half = size / 2; + for (size_t i = 0; i < half; i++) buffer[i] = i; + for (size_t i = 0; i < size - half; i++) buffer[half+i] = i; +} + static void init_reverse(size_t size) { for (size_t i = 0; i < size; i++) buffer[i] = size - i - 1; @@ -120,6 +127,7 @@ static int qsk_compare(const void *a, const void *b) const struct testcase testcases[] = { { .name = "random", .init = init_random, .cmp = compare }, { .name = "sorted", .init = init_sorted, .cmp = compare }, + { .name = "sorted-sorted", .init = init_sorted2, .cmp = compare }, { .name = "reverse", .init = init_reverse, .cmp = compare }, { .name = "constant", .init = init_constant, .cmp = compare }, { .name = "sorted+noise", .init = init_sorted_noise, .cmp = compare }, |