7 int_cmp (const void *_a
, const void *_b
)
14 #define MIN(_x,_y) ((_x) < (_y) ? (_x) : (_y))
17 main (int argc
, char **argv
)
19 struct ptr_list
*l
= NULL
, *l2
;
21 const int N
= argv
[1] ? atoi (argv
[1]) : 10000;
24 for (i
= 0; i
< 1000; i
++)
27 for (i
= 0; i
< N
; i
++) {
28 e
= (int *)malloc (sizeof (int));
32 sort_list (&l
, int_cmp
);
33 // Sort already sorted stuff.
34 sort_list (&l
, int_cmp
);
38 l2
->nr
= MIN (l2
->nr
, rand () % 3);
39 for (i
= 0; i
< l2
->nr
; i
++)
40 *((int*)(l2
->list
[i
])) = rand();
43 sort_list (&l
, int_cmp
);