[gnome-nibbles] Add a couple more good assertions



commit 26bc8b47b04745a5eb2668e976459c4c8b31f15f
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Jul 20 12:47:18 2014 -0500

    Add a couple more good assertions
    
    After we finish moving, the square our tail is on ought to be marked as
    such. This assertion likes to fail when we trigger the teleporter bug.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=733429

 src/worm.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/worm.c b/src/worm.c
index 90f52ba..2a046c1 100644
--- a/src/worm.c
+++ b/src/worm.c
@@ -399,6 +399,8 @@ gnibbles_worm_move_head_pointer (GnibblesWorm *worm)
 
   gnibbles_worm_handle_bonus (worm);
   gnibbles_worm_add_actor (worm);
+
+  g_assert_cmpint (board->walls[worm->xhead][worm->yhead], ==, worm->number + WORMCHAR);
 }
 
 static void
@@ -438,6 +440,7 @@ gnibbles_worm_move_tail_pointer (GnibblesWorm *worm)
     board->walls[worm->xtail][worm->ytail] = worm->number + WORMCHAR;
   }
 
+  g_assert_cmpint (board->walls[worm->xtail][worm->ytail], ==, worm->number + WORMCHAR);
 }
 
 static void


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