6 int_cmp (const void *_a
, const void *_b
)
13 #define MIN(_x,_y) ((_x) < (_y) ? (_x) : (_y))
16 main (int argc
, char **argv
)
18 struct ptr_list
*l
= NULL
, *l2
;
20 const int N
= argv
[1] ? atoi (argv
[1]) : 10000;
23 for (i
= 0; i
< 1000; i
++)
26 for (i
= 0; i
< N
; i
++) {
27 e
= (int *)malloc (sizeof (int));
31 sort_list (&l
, int_cmp
);
32 // Sort already sorted stuff.
33 sort_list (&l
, int_cmp
);
37 l2
->nr
= MIN (l2
->nr
, rand () % 3);
38 for (i
= 0; i
< l2
->nr
; i
++)
39 *((int*)(l2
->list
[i
])) = rand();
42 sort_list (&l
, int_cmp
);