-
Notifications
You must be signed in to change notification settings - Fork 274
Make location coverage reported include all lines of a multi-line statement #5635
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
Changes from 1 commit
cf28697
3aa12a3
87d73e1
b156c8f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,13 +58,7 @@ cover_basic_blockst::cover_basic_blockst(const goto_programt &goto_program) | |
|
||
block_map[it] = current_block; | ||
|
||
// update lines belonging to block | ||
const irep_idt &line = it->source_location.get_line(); | ||
if(!line.empty()) | ||
{ | ||
block_info.lines.insert(unsafe_string2unsigned(id2string(line))); | ||
block_info.source_lines.insert(it->source_location); | ||
} | ||
add_block_lines(block_info, *it); | ||
|
||
// set representative program location to instrument | ||
if( | ||
|
@@ -155,6 +149,18 @@ void cover_basic_blockst::output(std::ostream &out) const | |
<< '\n'; | ||
} | ||
|
||
void cover_basic_blockst::add_block_lines( | ||
cover_basic_blockst::block_infot &block, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ⛏️ should imho be called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMHO, it would be better to rename |
||
const goto_programt::instructiont &instruction) | ||
{ | ||
const irep_idt &line = instruction.source_location.get_line(); | ||
if(!line.empty()) | ||
{ | ||
block.lines.insert(unsafe_string2unsigned(id2string(line))); | ||
block.source_lines.insert(instruction.source_location); | ||
} | ||
} | ||
|
||
void cover_basic_blockst::update_covered_lines(block_infot &block_info) | ||
{ | ||
if(block_info.source_location.is_nil()) | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really unfortunate. Constructors generally shouldn’t be as complicated as this one is to begin with!
(Not that this is this PRs fault)