Revision ff6ba54e
Added by Pierre-Loïc Garoche about 5 years ago
src/pathConditions.ml | ||
---|---|---|
153 | 153 |
v |
154 | 154 |
Printers.pp_expr expr); |
155 | 155 |
let vl, leafs_n_neg_expr = compute_neg_expr 0 expr in |
156 |
if List.length leafs_n_neg_expr > 1 then ( |
|
156 |
if List.length leafs_n_neg_expr >= 1 then (
|
|
157 | 157 |
List.fold_left (fun accu ((vi, nb_pre), expr_neg_vi) -> |
158 | 158 |
(mcdc_var (mk_pre nb_pre vi) expr expr_neg_vi)::accu |
159 | 159 |
) vl leafs_n_neg_expr |
160 | 160 |
) |
161 |
else vl |
|
161 |
else |
|
162 |
(* TODO: deal with the case length xxx = 1 with a simpler condition *) |
|
163 |
vl |
|
162 | 164 |
|
163 | 165 |
and gen_mcdc_cond_guard expr = |
164 | 166 |
report ~level:1 (fun fmt -> |
165 | 167 |
Format.fprintf fmt".. Generating MC/DC cond for guard %a@." |
166 | 168 |
Printers.pp_expr expr); |
167 | 169 |
let vl, leafs_n_neg_expr = compute_neg_expr 0 expr in |
168 |
if List.length leafs_n_neg_expr > 1 then ( |
|
170 |
if List.length leafs_n_neg_expr >= 1 then (
|
|
169 | 171 |
List.fold_left (fun accu ((vi, nb_pre), expr_neg_vi) -> |
170 | 172 |
(mcdc_var (mk_pre nb_pre vi) expr expr_neg_vi)::accu |
171 | 173 |
) vl leafs_n_neg_expr) |
172 | 174 |
else |
175 |
(* TODO: deal with the case length xxx = 1 with a simpler condition *) |
|
173 | 176 |
vl |
174 | 177 |
|
175 | 178 |
|
Also available in: Unified diff
Produce condition coverage for basic boolean expressions. To be improved with a simpler condition.