gtestutils Re: reftests



On 05/05/11 04:18, Kristian Rietveld wrote:
>         g_assert (allocation.y == rect.y + ((rect.height - allocation.height) / 2));
> 
> The output of this failed assertion is not really nice to the eyes.  It would be nice if the assertion macros could be improved to also accept a human-readable string of what's going wrong together with the expected and received value.  But perhaps this is already present in the gtestutils and I missed it.

You can do:

  g_assert_cmpint (allocation.y, ==, rect.y + ((rect.height -
allocation.height) / 2));

and that gives you "expected ..., got ..." part, but not a message.  What I do
now in HarfBuzz is to do g_test_message() earlier in the code about what's
going on, and then run the test with --verbose and make sense of it.  Far from
what other test frameworks provide, which is a message to print only when the
test fails.

b


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