[glib/gsettings] Fix a broken test, make the tests faster



commit dffeed2e9610cdc3e214f1d96b11b4b5e78e7340
Author: Ryan Lortie <desrt desrt ca>
Date:   Tue Sep 8 18:43:14 2009 -0400

    Fix a broken test, make the tests faster

 glib/tests/gvariant-big.c            |    4 ++--
 glib/tests/gvariant-fuzz.c           |    2 +-
 glib/tests/gvariant-printer-parser.c |    7 +++----
 glib/tests/gvariant-random.c         |    2 +-
 4 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/glib/tests/gvariant-big.c b/glib/tests/gvariant-big.c
index ddaaa42..be334e9 100644
--- a/glib/tests/gvariant-big.c
+++ b/glib/tests/gvariant-big.c
@@ -26,7 +26,7 @@ static void
 verify2 (GVariant *value,
          GRand    *rand)
 {
-  gsize length = g_rand_int_range (rand, 1, 100000);
+  gsize length = g_rand_int_range (rand, 1, 1000);
   const gchar *possible = "ybquds";
   const GVariantType *type;
   GVariantTypeClass class;
@@ -89,7 +89,7 @@ verify2 (GVariant *value,
 static GVariant *
 generate2 (GRand *rand)
 {
-  gsize length = g_rand_int_range (rand, 1, 100000);
+  gsize length = g_rand_int_range (rand, 1, 1000);
   const gchar *possible = "ybquds";
   const GVariantType *type;
   GVariantTypeClass class;
diff --git a/glib/tests/gvariant-fuzz.c b/glib/tests/gvariant-fuzz.c
index 3fb778d..fa00b8d 100644
--- a/glib/tests/gvariant-fuzz.c
+++ b/glib/tests/gvariant-fuzz.c
@@ -2,7 +2,7 @@
 #include <glib/gstdio.h>
 #include <string.h>
 
-#define TESTS                     10000
+#define TESTS                     500
 #define MAXIMUM_DEPTH             5
 #define MAXIMUM_ARRAY_SIZE        8
 #define MAXIMUM_STRUCT_SIZE       8
diff --git a/glib/tests/gvariant-printer-parser.c b/glib/tests/gvariant-printer-parser.c
index b88bd7d..c6179ed 100644
--- a/glib/tests/gvariant-printer-parser.c
+++ b/glib/tests/gvariant-printer-parser.c
@@ -20,12 +20,11 @@ const char *verbatim_tests[] = {
   "-34",
 
   /* Floats are printed at the minimum precision to lose no accuracy. */
-  "4.3",
+  "37.5",
   
   /* FIXME: use sf when it makes sense */
   /*"4.3e16",*/
-
-  "3.141592653589793",
+  "3.1415926535897931",
 
   "\"Hello\"",
 
@@ -37,7 +36,7 @@ const char *verbatim_tests[] = {
 
   "<@ai []>",
 
-  "<@an [1, -1, 2, -3, -1, -2, 1, -3, 4, -7, 3, -10, 13, -23, 26]>"
+  "<[int16 1, -1, 2, -3, -1, -2, 1, -3, 4, -7, 3, -10, 13, -23, 26]>"
 };
 
 static void
diff --git a/glib/tests/gvariant-random.c b/glib/tests/gvariant-random.c
index 7aa080e..0b6e37a 100644
--- a/glib/tests/gvariant-random.c
+++ b/glib/tests/gvariant-random.c
@@ -1,6 +1,6 @@
 #include <glib.h>
 
-#define TESTS                     1024
+#define TESTS                     100
 #define MAXIMUM_DEPTH             16
 #define MAXIMUM_ARRAY_SIZE        8
 #define MAXIMUM_STRUCT_SIZE       8



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]