-
Notifications
You must be signed in to change notification settings - Fork 53
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
Same test suite, but different instruction coverage measurements exist #685
Comments
In fact, before reporting this bug, I encountered another similar bug. Due to the company's security issues, I cannot attach entire code. So I tried to reproduce it, but failed. The first bug discovered was as follows : Describe the bug
Expected behavior
Reports
val nullableVal: Something?
when (someEnum) {
A -> { // test suite execute all branch and all instruction and it is all green(covered), also if i remove certain branch it changes to red properly
if (nullableVal != null) {
doSomething()
} else {
doSomething()
}
}
B -> {
if (nullableVal != null) {
doSomething() // test suite only covered nullableVal equal null case, but it is marked as green(covered)
}
}
} But if i add else branch it looks normal when (someEnum) {
A -> { ... }
B -> {
if (nullableVal != null) {
doSomething() // Despite being the same test suite, this turns to red(not covered)
} else {
doSomething() // and this branch is marked as green(looks normal)
}
}
} Environment
|
Thanks for the reproducer! |
@shanshin If you need anything, please feel free to tell me 😄 I also have the following questions: Is it a bug that the null checking inside the if statement branch is marked green even though both the true and false results are not tested? (with upper repository, it is only tested |
Yes, it should be yellow. |
Thanks for answering! If there is anything I can contribute, I am happy to do so 😃 |
Describe the bug
Same test suite, but different instruction coverage measurements exist
Expected behavior
coverage measurements should be equal
Reproducer
build-with-oneline
folderbuild-with-multiline
folderReports
With same test suite, but difference instruction coverage
Environment
The text was updated successfully, but these errors were encountered: