]> Pileus Git - ~andy/gtk/commitdiff
tests: Put random number into local variable
authorBenjamin Otte <otte@redhat.com>
Sat, 10 Dec 2011 01:04:27 +0000 (02:04 +0100)
committerBenjamin Otte <otte@redhat.com>
Sat, 10 Dec 2011 07:00:25 +0000 (08:00 +0100)
This way, we can see what function had previously been called when the
checks fail.

tests/testtreechanging.c

index cb29f8493aa234dc1b2a529d7d6b4e080f1f5225..b267bb0fde2bbf23c6b891a45ad80698146de4c8 100644 (file)
@@ -259,8 +259,11 @@ dance (gpointer treeview)
     expand,
     collapse
   };
+  guint i;
+
+  i = g_random_int_range (0, G_N_ELEMENTS(funcs));
 
-  funcs[g_random_int_range (0, G_N_ELEMENTS(funcs))] (treeview);
+  funcs[i] (treeview);
 
   check_sanity (treeview);