This project is read-only.

Understanding how OpenCppCoverage highlights codes

Sep 22, 2015 at 9:19 AM
Hi all, I just started using OpenCppCoverage and I am trying to understand how it determines whether a line of code is covered or not. I noticed some weird highlighting in my coverage report and I am not sure if it is a bug. Hopefully someone can explain it to me.

Basically, I noticed that I have some if-else constructs where the condition line (happens to both if or else) is marked as uncovered (highlighted in red) but the codes inside the construct is marked as covered. I also have some constructs where the condition line is marked as covered but the code inside the block is marked as uncovered. I do not have any jump/goto statements.

Can anyone help me understand what's the meaning of this?

Sep 23, 2015 at 11:14 PM
Edited Sep 24, 2015 at 9:28 PM

Can you provide an example of code and/or a screenshot so that I can try to reproduce the issue?
Note: You can have this kind of issue if you compile your code in release (Optimisation enabled).

Marked as answer by OpenCppCoverage on 1/2/2016 at 3:38 AM