Move hash tests to the test framework
[platform/upstream/glib.git] / tests / queue-test.c
index aeb1df3..448e8bd 100644 (file)
@@ -1,14 +1,15 @@
 #undef G_DISABLE_ASSERT
 #undef G_LOG_DOMAIN
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-#include <glib.h>
-
 #include <time.h>
 #include <stdlib.h>
 
+#include <glib.h>
+
+
+static gboolean verbose = FALSE;
+
+
 static void
 check_integrity (GQueue *queue)
 {
@@ -225,7 +226,9 @@ random_test (int seed)
   QueueOp op;
   QueueInfo queues[N_QUEUES];
 
-  g_print ("seed: %d\n", seed);
+  if (verbose)
+    g_print ("seed: %d\n", seed);
+
   g_random_set_seed (seed);
   
   for (i = 0; i < N_QUEUES; ++i)
@@ -748,6 +751,9 @@ int main(int argc, gchar *args[])
   gpointer data;
   int i;
   
+  if (argc > 1 && args[1][0] == '-' && args[1][1] == 'v')
+    verbose = TRUE;
+
   q = g_queue_new ();
   
   g_assert (g_queue_is_empty (q) == TRUE);
@@ -944,6 +950,8 @@ int main(int argc, gchar *args[])
   
   g_queue_free (q);
 
+  if (argc > 2 && args[1][0] == '-' && args[1][1] == 'v')
+    random_test (strtol (args[2], NULL, 0));    
   if (argc > 1)
     random_test (strtol (args[1], NULL, 0));
   else