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

Fix coverage conversion rule for otherwise #20

Closed
killy971 opened this issue Jun 25, 2014 · 3 comments
Closed

Fix coverage conversion rule for otherwise #20

killy971 opened this issue Jun 25, 2014 · 3 comments
Assignees
Labels
Milestone

Comments

@killy971
Copy link
Owner

A custom conversion rule for the otherwise statement was added by #3.

This change introduced a problem: lines containing the otherwise statement will always be converted at least as partially covered, even if they are never run at all.

In order to fix this problem, the custom coverage conversion rule should be made aware of other coverage data for the same expression.

@killy971 killy971 added the bug label Jun 25, 2014
@killy971
Copy link
Owner Author

An otherwise expression is represented by the 3 following BoxLabel values:

  • ExpBox False,
  • BinBox GuardBinBox True,
  • BinBox GuardBinBox False.

A simple way to apprach the problem would be to change CoverageEntry type to the following definition:

type CoverageEntry = (
    [MixEntry], -- mix entries
    [Integer],  -- tix values
    [String])   -- entry source code

The MixEntry list would contain all mix entries which share the same HpcPos

@killy971
Copy link
Owner Author

From the current implementation, one way to proceed would be to create a function signature:

[(MixEntry, Integer, [String])] -> [([MixEntry], [Integer], [String])]

to aggregate the current mixEntryTixs values based on the HpcPos value.

@killy971 killy971 self-assigned this Oct 21, 2014
@killy971
Copy link
Owner Author

Fixed by 17c6f99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant