1 #undef G_DISABLE_ASSERT
6 const gint32 first_numbers[] =
31 const gint length = sizeof (first_numbers) / sizeof (first_numbers[0]);
37 GRand* rand = g_rand_new_with_seed (first_numbers[0]);
39 for (n = 1; n < length; n++)
40 g_assert (first_numbers[n] == g_rand_int (rand));
42 for (n = 1; n < 100000; n++)
48 i = g_rand_int_range (rand, 8,16);
49 g_assert (i >= 8 && i < 16);
51 i = g_random_int_range (8,16);
52 g_assert (i >= 8 && i < 16);
54 d = g_rand_double (rand);
55 g_assert (d >= 0 && d < 1);
57 d = g_random_double ();
58 g_assert (d >= 0 && d < 1);
60 d = g_rand_double_range (rand, -8, 32);
61 g_assert (d >= -8 && d < 32);
63 d = g_random_double_range (-8, 32);
64 g_assert (d >= -8 && d < 32);
66 b = g_random_boolean ();
67 g_assert (b == TRUE || b == FALSE);
69 b = g_rand_boolean (rand);
70 g_assert (b == TRUE || b == FALSE);