File tree 6 files changed +31
-9
lines changed
regression/cbmc-cover/branch-loop1
6 files changed +31
-9
lines changed Original file line number Diff line number Diff line change
1
+ int main (int argc , char * * argv )
2
+ {
3
+ for (int i = 0 ; i < 4 ; i ++ )
4
+ {
5
+ char c ;
6
+ __CPROVER_input ("c" , c );
7
+ if (c == 42 )
8
+ return 0 ;
9
+ }
10
+ return 1 ;
11
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.c
3
+ --xml-ui --cover branch
4
+ activate-multi-line-match
5
+ EXIT=0
6
+ SIGNAL=0
7
+ </inputs>\n\s*<goal id="main\.coverage\.1"/>\n\s*<goal id="main\.coverage\.2"/>\n\s*<goal id="main\.coverage\.3"/>\n\s*<goal id="main\.coverage\.5"/>\n\s*</test>
8
+ --
9
+ ^warning: ignoring
10
+ --
11
+ Expect each goal only occur once per test.
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ json_objectt test_inputst::to_json(
71
71
}
72
72
73
73
json_arrayt goal_refs;
74
- for (const auto &goal_id : goto_trace.get_all_property_ids ())
74
+ for (const auto &goal_id : goto_trace.get_failed_property_ids ())
75
75
{
76
76
goal_refs.push_back (json_stringt (goal_id));
77
77
}
@@ -112,7 +112,7 @@ xmlt test_inputst::to_xml(
112
112
}
113
113
}
114
114
115
- for (const auto &goal_id : goto_trace.get_all_property_ids ())
115
+ for (const auto &goal_id : goto_trace.get_failed_property_ids ())
116
116
{
117
117
xmlt &xml_goal = xml_result.new_element (" goal" );
118
118
xml_goal.set_attribute (" id" , id2string (goal_id));
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ const goto_tracet &goto_trace_storaget::insert(goto_tracet &&trace)
33
33
const goto_tracet &goto_trace_storaget::insert_all (goto_tracet &&trace)
34
34
{
35
35
traces.push_back (std::move (trace));
36
- const auto &all_property_ids = traces.back ().get_all_property_ids ();
36
+ const auto &all_property_ids = traces.back ().get_failed_property_ids ();
37
37
DATA_INVARIANT (
38
38
!all_property_ids.empty (), " a trace must violate at least one assertion" );
39
39
for (const auto &property_id : all_property_ids)
Original file line number Diff line number Diff line change @@ -773,13 +773,13 @@ void show_goto_trace(
773
773
774
774
const trace_optionst trace_optionst::default_options = trace_optionst();
775
775
776
- std::vector <irep_idt> goto_tracet::get_all_property_ids () const
776
+ std::set <irep_idt> goto_tracet::get_failed_property_ids () const
777
777
{
778
- std::vector <irep_idt> property_ids;
778
+ std::set <irep_idt> property_ids;
779
779
for (const auto &step : steps)
780
780
{
781
- if (step.is_assert ())
782
- property_ids.push_back (step.property_id );
781
+ if (step.is_assert () && !step. cond_value )
782
+ property_ids.insert (step.property_id );
783
783
}
784
784
return property_ids;
785
785
}
Original file line number Diff line number Diff line change @@ -206,8 +206,8 @@ class goto_tracet
206
206
return steps.back ();
207
207
}
208
208
209
- // / Returns the property IDs of all assertions in the trace
210
- std::vector <irep_idt> get_all_property_ids () const ;
209
+ // / Returns the property IDs of all failed assertions in the trace
210
+ std::set <irep_idt> get_failed_property_ids () const ;
211
211
};
212
212
213
213
// / Options for printing the trace using show_goto_trace
You can’t perform that action at this time.
0 commit comments