mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 23:58:54 +02:00
tests: Reduce number of iterations in queue test
Unless `-m thorough` is passed to the tests, reduce the number of iterations in the random test. This one test case takes the bulk of the time to run the `queue` test suite, and is sometimes causing timeouts when running on CI (particularly under valgrind). Reduce it to a fifth. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
@@ -228,7 +228,7 @@ random_test (gconstpointer d)
|
|||||||
LINK_INDEX, UNLINK, DELETE_LINK, LAST_OP
|
LINK_INDEX, UNLINK, DELETE_LINK, LAST_OP
|
||||||
} QueueOp;
|
} QueueOp;
|
||||||
|
|
||||||
#define N_ITERATIONS 500000
|
const guint n_iterations = g_test_thorough () ? 500000 : 100000;
|
||||||
#define N_QUEUES 3
|
#define N_QUEUES 3
|
||||||
|
|
||||||
#define RANDOM_QUEUE() &(queues[g_random_int_range(0, N_QUEUES)])
|
#define RANDOM_QUEUE() &(queues[g_random_int_range(0, N_QUEUES)])
|
||||||
@@ -256,7 +256,7 @@ random_test (gconstpointer d)
|
|||||||
queues[i].length = 0;
|
queues[i].length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < N_ITERATIONS; ++i)
|
for (i = 0; i < n_iterations; ++i)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
QueueInfo *qinf = RANDOM_QUEUE();
|
QueueInfo *qinf = RANDOM_QUEUE();
|
||||||
|
Reference in New Issue
Block a user