Re: RFC: GLib testing framework



> nobody has to use this syntax. you can stick to the ever simple:
>    g_assert (foo > bar);
>
> however if you want the value of 'foo' and 'bar' be printed out, instead
> of just the value of (foo > bar) which would be 0 or 1, then there are
> no other means than using something simialr to:
>    g_assert_cmpfloat (foo, >, bar);

No other way?  You just need to think outside the box^w^wcpp.  How
about a pre-cpp filter that looks at the source code, finds the g_assert,
and does a little creative rewriting?

That would be a ten-line perl script.  Plus some Makefile magic to hook
it up.  There would be no extra run-time penalty and the compile-time
penalty would be near-zero.

Note, that the filter should preserve line numbers, i.e., never remove and
never insert newlines.  Otherwise error messages with line numbers would
drive you crazy.

Morten


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