You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After integrating diff-cover, a line of code appears to be commented out, and the incremental code coverage is 0. How to solve this?
I think adding a line of comment code, this line of code will not be compiled, then the denominator of the incremental coverage should be 0, so the coverage should be 100%
The text was updated successfully, but these errors were encountered:
for example:
Unmodified code:
src/test.cpp
#include
using namespace std;
int main()
{
int a = 10;
int b= 20;
int c = a + b;
cout << (a + b) << endl;
return 0;
}
Modified code:
src/test.cpp
#include
using namespace std;
int main()
{
int a = 10;
int b= 20;
// int c = a + b;
cout << (a + b) << endl;
return 0;
}
The comparison can be found, int c = a + b; is blocked
but,This line of code should not be calculated into the incremental code, so that is 100% coverage
However, in the actual test, this line of blocked code is calculated as incremental code and is not covered by the google test unit test case
After integrating diff-cover, a line of code appears to be commented out, and the incremental code coverage is 0. How to solve this?
I think adding a line of comment code, this line of code will not be compiled, then the denominator of the incremental coverage should be 0, so the coverage should be 100%
The text was updated successfully, but these errors were encountered: