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"
This commit is contained in:
Michael Catanzaro 2013-06-05 20:47:19 -05:00
parent 32d04f0be4
commit 8584abbec2

View file

@ -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;
}