[glib] Add a test for the previous fix
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Add a test for the previous fix
- Date: Sat, 4 Jun 2011 03:39:14 +0000 (UTC)
commit 1e88c5321c1fede65e150898f3e298052add241c
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jun 3 23:38:46 2011 -0400
Add a test for the previous fix
glib/tests/rand.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/glib/tests/rand.c b/glib/tests/rand.c
index f1ff08d..1e3a2eb 100644
--- a/glib/tests/rand.c
+++ b/glib/tests/rand.c
@@ -149,13 +149,28 @@ test_rand (void)
g_rand_free (copy);
}
+static void
+test_double_range (void)
+{
+ gdouble d;
+
+ g_test_bug ("502560");
+
+ d = g_random_double_range (-G_MAXDOUBLE, G_MAXDOUBLE);
+
+ g_assert (-G_MAXDOUBLE <= d);
+ g_assert (d < G_MAXDOUBLE);
+}
+
int
main (int argc,
char *argv[])
{
g_test_init (&argc, &argv, NULL);
+ g_test_bug_base ("http://bugzilla.gnome.org/");
g_test_add_func ("/rand/test-rand", test_rand);
+ g_test_add_func ("/rand/double-range", test_double_range);
return g_test_run();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]