[gnome-chess] tests: print unexpected results as strings



commit 8584abbec27b9855586fd2640dbe8a2158efd067
Author: Michael Catanzaro <mike catanzaro gmail com>
Date:   Wed Jun 5 20:47:19 2013 -0500

    tests: print unexpected results as strings
    
    Vala enums have a to_string method, so if a test produces an unexpected
    game result, we can print the symbolic constant instead of just saying
    something helpful like "game has result 1 not 3"

 src/test-chess-game.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/test-chess-game.vala b/src/test-chess-game.vala
index fc43b1f..735c3b1 100644
--- a/src/test-chess-game.vala
+++ b/src/test-chess-game.vala
@@ -37,7 +37,7 @@ class GlChess
         var move_result = state.get_result (out move_rule);
         if (move_result != result || move_rule != rule)
         {
-            stderr.printf ("%d. FAIL %s + %s has result %d not %d\n", test_count, fen, move, move_result, 
result);
+            stderr.printf ("%d. FAIL %s + %s has result %s not %s\n", test_count, fen, move, 
move_result.to_string (), result.to_string ());
             failure_count++;
             return;
         }


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