gtestutils Re: reftests
- From: Behdad Esfahbod <behdad behdad org>
- To: Kristian Rietveld <kris gtk org>
- Cc: gtk-devel-list <gtk-devel-list gnome org>, Benjamin Otte <otte gnome org>
- Subject: gtestutils Re: reftests
- Date: Thu, 05 May 2011 10:37:07 -0400
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]