Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only start of file is reported as covered #75

Open
nhnb opened this issue Sep 13, 2013 · 2 comments
Open

Only start of file is reported as covered #75

nhnb opened this issue Sep 13, 2013 · 2 comments

Comments

@nhnb
Copy link

nhnb commented Sep 13, 2013

Hi,

I have a case in which only the the start of a file is reported covered, but the end is reported as uncovered.

http://filebin.ca/utptb3660di/half-covered.zip contains a report.html (including the source code), the instrumented .class file and the cobertura.ser from the test run.

The uncovered section starts around line 500. The first method there is checkVersionConflict in line 506. It is shown as uncovered. In line 409, however, this method is invoked 44 times.

In the past, the coverage report was correct on Java 6 with Cobertura 1.9. The issues occurs on Java 7 with Cobertura 2.0.3 and Cobertura 2.0.4-snapshot.

@christ66
Copy link
Member

I see where the bug is. If you use a decompiler like JD, you will see that there is something that is happening where "__cobertura_counters[i] += 1; i = 0;" is being inserted. This should never happen as that i variable should not be around, and the __cobertura_counters should be using a constant integer instead. Maybe it's trying to use the i value when the file is very large or has a lot of complexity. I will investigate how to reproduce this for the weekend.

@dwdyer
Copy link

dwdyer commented Oct 31, 2013

I'm seeing a similar problem. Upgrading from 1.9 to 2.0.3 sees my coverage drop from 79.3% to 77.1% and there are certain sections of code that are clearly being executed but are being reported as uncovered.

The project is open source so if you need a way to reproduce the problem, I can provide that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants