[dconf/wip/reorg: 510/523] gvdb test: fix logic for infinite walks



commit 0d25676ca1f7721564687cb4eabf43c5dfadd8ea
Author: Ryan Lortie <desrt desrt ca>
Date:   Sun Jul 8 10:42:09 2012 -0400

    gvdb test: fix logic for infinite walks
    
    We were using a negative variable for the value of a counter designed to
    bound the number of open() calls in a walk.  We were decrementing it in
    that case (which is fine since it would never reach zero again anyway).
    It was a bit ugly, though.

 tests/gvdb.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/tests/gvdb.c b/tests/gvdb.c
index 4f9c398..35a16a2 100644
--- a/tests/gvdb.c
+++ b/tests/gvdb.c
@@ -204,7 +204,8 @@ walk_open (const gchar *name,
 
   if (accept_this_many_opens)
     {
-      accept_this_many_opens--;
+      if (accept_this_many_opens > 0)
+        accept_this_many_opens--;
       return TRUE;
     }
 



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