1 #undef G_DISABLE_ASSERT
11 sort (gconstpointer a
, gconstpointer b
, gpointer user_data
)
13 return *(guint32
*)a
< *(guint32
*)b
? -1 : 1;
17 main (int argc
, char **argv
)
21 for (i
= 0; i
< SIZE
; i
++)
22 array
[i
] = g_random_int ();
24 g_qsort_with_data (array
, SIZE
, sizeof (guint32
), sort
, NULL
);
26 for (i
= 0; i
< SIZE
- 1; i
++)
27 g_assert (array
[i
] <= array
[i
+1]);
29 /* 0 elements is a valid case */
30 g_qsort_with_data (array
, 0, sizeof (guint32
), sort
, NULL
);