@@ -287,16 +287,23 @@ pub enum MappingKind {
287287 Code ( CovTerm ) ,
288288 /// Associates a branch region with separate counters for true and false.
289289 Branch { true_term : CovTerm , false_term : CovTerm } ,
290+ /// FIXME(dprn): doc
291+ MCDCBranch { true_term : CovTerm , false_term : CovTerm , id : u32 , true_id : u32 , false_id : u32 } ,
292+ /// Associates an MCDC Decision with
293+ MCDCDecision { bitmap_idx : u32 , num_conditions : u32 } ,
290294}
291295
292296impl MappingKind {
293297 /// Iterator over all coverage terms in this mapping kind.
294298 pub fn terms ( & self ) -> impl Iterator < Item = CovTerm > {
295- let one = |a| std:: iter:: once ( a) . chain ( None ) ;
296- let two = |a, b| std:: iter:: once ( a) . chain ( Some ( b) ) ;
299+ let zero = || std:: iter:: empty ( ) . chain ( None ) . chain ( None ) ;
300+ let one = |a| std:: iter:: empty ( ) . chain ( Some ( a) ) . chain ( None ) ;
301+ let two = |a, b| std:: iter:: empty ( ) . chain ( Some ( a) ) . chain ( Some ( b) ) ;
297302 match * self {
298303 Self :: Code ( term) => one ( term) ,
299304 Self :: Branch { true_term, false_term } => two ( true_term, false_term) ,
305+ Self :: MCDCBranch { .. } => zero ( ) ,
306+ Self :: MCDCDecision { .. } => zero ( ) ,
300307 }
301308 }
302309
@@ -308,6 +315,7 @@ impl MappingKind {
308315 Self :: Branch { true_term, false_term } => {
309316 Self :: Branch { true_term : map_fn ( true_term) , false_term : map_fn ( false_term) }
310317 }
318+ Self :: MCDCBranch { .. } | Self :: MCDCDecision { .. } => self . clone ( ) ,
311319 }
312320 }
313321}
0 commit comments