question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Negative sequence point coverage when line executions exceed int.MaxValue

See original GitHub issue

Package: coverlet.msbuild Version: 3.1.0 Format: opencover

In a project where a particular line of code gets called a lot, the sequence point coverage value for that line can become negative if the line is hit more than int.MaxValue times. The value in the XML is negative and shows in the generated report as uncovered.

I created a simple repro of this because I cannot show the actual code that caused the problem (it’s from my job).

XML: image

Report: image

Repro code: https://github.com/Malivil/Coverlet1266Repro

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
daveMuellercommented, Dec 8, 2021

An alternative is to translate negative numbers to int.MaxValue when collecting the results.

Then should we go with this solution? I could prepare a PR in the next days.

1reaction
daveMuellercommented, Dec 7, 2021

Thanks for reporting and thanks for the repro. 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I generate random integers within a specific range ...
MAX_VALUE it is possible to overflow ,resulting into a java.lang.IllegalArgumentException . You can try with : randInt(0, Integer.MAX_VALUE) .
Read more >
Java Basics - Java Programming Tutorial
An int variable stores an integer (or whole number or fixed-point number); a double variable stores a floating-point number (or real number); a...
Read more >
The GNU C Reference Manual
An integer constant is a sequence of digits, with an optional prefix to denote a number base ... Full coverage of operators can...
Read more >
Pascal - Quick Guide
Pascal variables are declared outside the code-body of the function which means they are not declared within the begin and end pairs, but...
Read more >
XPath and XQuery Functions and Operators 3.1
[Definition] An execution scope is a sequence of calls to the function library during which certain aspects of the state are required to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found