[gtk+] tests: Put random number into local variable



commit 2a59265df11422bce5a017d338e3bfb68ff2dedf
Author: Benjamin Otte <otte redhat com>
Date:   Sat Dec 10 02:04:27 2011 +0100

    tests: Put random number into local variable
    
    This way, we can see what function had previously been called when the
    checks fail.

 tests/testtreechanging.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/tests/testtreechanging.c b/tests/testtreechanging.c
index cb29f84..b267bb0 100644
--- a/tests/testtreechanging.c
+++ b/tests/testtreechanging.c
@@ -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);
 



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