[systemd-devel] tests

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Thu Jan 31 06:42:45 PST 2013


On Thu, Jan 31, 2013 at 08:35:56AM +0100, Thomas H.P. Andersen wrote:
> Hi Zbigniew,

Hi,

> _cleanup_free_ only cleans up when the variable goes out of scope
> right? So just using it on "r" here would leak all but the last use of
> it?
Yes.

> Using individual variables for each test case like r1, r2, r3, etc
> could be a solution. Or using something like your recent "#define
> expect" would work as well. But for a case as simple as this I think
> the code might be more readable as it is.
Probably. The '#define expect' thing is not particularly nice, but saves
a lot of lines. In this case it is probably fine as it is.

> What do you suggest?
It's OK as is.

Zbyszek


More information about the systemd-devel mailing list