#include "test-tool.h"
#include "mem-pool.h"
#include "mergesort.h"
#include "strbuf.h"
static uint32_t minstd_rand(uint32_t *state)
{ … }
struct line { … };
DEFINE_LIST_SORT(…) …;
static int compare_strings(const struct line *x, const struct line *y)
{ … }
static int sort_stdin(void)
{ … }
static void dist_sawtooth(int *arr, int n, int m)
{ … }
static void dist_rand(int *arr, int n, int m)
{ … }
static void dist_stagger(int *arr, int n, int m)
{ … }
static void dist_plateau(int *arr, int n, int m)
{ … }
static void dist_shuffle(int *arr, int n, int m)
{ … }
#define DIST(name) …
static struct dist { … } dist[] = …;
static const struct dist *get_dist_by_name(const char *name)
{ … }
static void mode_copy(int *arr UNUSED, int n UNUSED)
{ … }
static void mode_reverse(int *arr, int n)
{ … }
static void mode_reverse_1st_half(int *arr, int n)
{ … }
static void mode_reverse_2nd_half(int *arr, int n)
{ … }
static int compare_ints(const void *av, const void *bv)
{ … }
static void mode_sort(int *arr, int n)
{ … }
static void mode_dither(int *arr, int n)
{ … }
static void unriffle(int *arr, int n, int *tmp)
{ … }
static void unriffle_recursively(int *arr, int n, int *tmp)
{ … }
static void mode_unriffle(int *arr, int n)
{ … }
static unsigned int prev_pow2(unsigned int n)
{ … }
static void unriffle_recursively_skewed(int *arr, int n, int *tmp)
{ … }
static void mode_unriffle_skewed(int *arr, int n)
{ … }
#define MODE(name) …
static struct mode { … } mode[] = …;
static const struct mode *get_mode_by_name(const char *name)
{ … }
static int generate(int argc, const char **argv)
{ … }
static struct stats { … } stats;
struct number { … };
DEFINE_LIST_SORT_DEBUG(…) …;
static int compare_numbers(const struct number *an, const struct number *bn)
{ … }
static void clear_numbers(struct number *list)
{ … }
static int test(const struct dist *dist, const struct mode *mode, int n, int m)
{ … }
static int run_tests(int argc, const char **argv)
{ … }
int cmd__mergesort(int argc, const char **argv)
{ … }