[bind10-dev] style thingy wrt unit test code coverage

Jelte Jansen jelte at isc.org
Tue Feb 23 15:59:04 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi,

i just 'discovered' we can cheat on the code coverage reports; since it
counts lines, having a statement like

if (condition) { do_something; }

on one line will always be counted, because the condition is executed,
but we might miss the fact that do_something might not be.

I don't know about the rest but i tend to put simple things like this on
the same line, and perhaps we should make it a style issue to not do
that, as the coverage result gets skewed.

This may or may not be a problem, if it's something simple it might not
matter much, and if it's something complicated then it should show up in
other parts of the coverage results anyway, but still it gives wrong
results (one the wrong side of wrong imo; falsely counted statements)

The more interesting ones is the same issue in header files; 'simple'
functions we can do there, but as soon as branching gets involved can we
still call it simple?

Perhaps we should add a point that multiple statements (or anything else
than straight assignment) should not go into the header but to a .cc?

Jelte
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkuD+0gACgkQ4nZCKsdOncX2nQCfehTg9/h9mPkvF1edULgvZWl3
vSgAn3k94oPBoVZ4PANKg3QDoHjg4BcJ
=bRUT
-----END PGP SIGNATURE-----



More information about the bind10-dev mailing list