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

Negative coverage when integer overflows #1267

Merged

Conversation

daveMueller
Copy link
Collaborator

closes #1266

@daveMueller
Copy link
Collaborator Author

I'm not so sure about the test. The loop to int.MaxValue takes quite some time and slows down the build job.

Copy link
Collaborator

@petli petli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree the test seems overkill. The interesting logic is in the collection of the hit results, can that be tested by a unit test that just reads negative hits, rather than a full integration test?

@petli
Copy link
Collaborator

petli commented Dec 16, 2021

I have deleted two review comments (and updated the third) as I realised I did my sums wrong and the situation I was thinking about couldn't happen.

@daveMueller
Copy link
Collaborator Author

Thanks @petli. I will try to somehow mock a InstrumenterResult instead but I'm always having a hard time when I want to do this.

Copy link
Collaborator

@petli petli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good unit test!

@MarcoRossignoli MarcoRossignoli merged commit 8582925 into coverlet-coverage:master Dec 20, 2021
@MarcoRossignoli
Copy link
Collaborator

Thanks to all!

@daveMueller daveMueller deleted the 1266_IntegerOverflow branch December 20, 2021 22:48
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

Successfully merging this pull request may close these issues.

Negative sequence point coverage when line executions exceed int.MaxValue
3 participants