views:

41

answers:

1

I have a strange scenario... while doing a EMMA coverage for UT, I get the total block coverage size more than line coverage size.

For block coverage, the total size is some 50,000 while the line coverage is out of 18,000.

I get (block-coverage-value) / 50,000 and (line-coverage-value) / 18,000 in the report.

Is it possible? How can the number of blocks be more than the number of lines in code?

btw, you can assume that I know what Block Coverage is: http://emma.sourceforge.net/faq.html#q.blockcoverage

+1  A: 

It's easy to get multiple blocks on the same line, for example:

int i = j > 0 ? j : -j;

contains 3 blocks (guestimate). If you like dense code blocks can outnumber the lines.

iwein
But very rarely we have this code.
MasterGaurav
Yes, just an example, there are other ways to get multiple blocks on a single line.
iwein