code coverage misses instruction that is on two lines

37 views
Skip to first unread message

oly...@gmail.com

unread,
Mar 24, 2015, 5:26:18 PM3/24/15
to jac...@googlegroups.com
I noticed if I have a method call that looks like this:

myClass.
myMethod();

the code doesn't show as being covered, when I know it was. However, if I put it on one line:

myClass.myMethod();

it shows as being covered.

oly...@gmail.com

unread,
Mar 24, 2015, 5:28:44 PM3/24/15
to jac...@googlegroups.com, oly...@gmail.com
Actually I noticed it shows covered if just the class name and method name are on the same line:

myClass.myMethod(blah, blah, blah, blah,
blah, blah);

shows as covered.

Marc Hoffmann

unread,
Mar 25, 2015, 4:38:22 AM3/25/15
to jac...@googlegroups.com
Hi,

can you please show screenshots of the problem?

JaCoCo is based on the debug line numbers within the class files. So it
fully depends on the compiler. If I remember correctly JDK's javac
assigns all lines of a multi-line expression to a single line, see for
example:

http://www.eclemma.org/jacoco/trunk/coverage/org.jacoco.agent.rt/org.jacoco.agent.rt.internal/CoverageTransformer.java.html#L143

Best regards,
-marc

John Crutcher

unread,
Mar 25, 2015, 1:55:54 PM3/25/15
to jac...@googlegroups.com
ok, I can see you're right. That's what my code coverage looks like. Sorry for the trouble.


--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/HoSGgq7nyss/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/49f12f014cfd5ddc4d0f5774594aa2b5%40mountainminds.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages