(&self)
| 60 | } |
| 61 | |
| 62 | pub fn compute_branch_coverage(&self) -> f32 { |
| 63 | if self.branches.is_empty() { |
| 64 | if self.count == 0 { |
| 65 | return 0_f32; |
| 66 | } |
| 67 | return 1_f32; |
| 68 | } |
| 69 | let mut covered = 0; |
| 70 | for branch in &self.branches { |
| 71 | if branch.get_true_count() > &0 { |
| 72 | covered += 1; |
| 73 | } |
| 74 | if branch.get_false_count() > &0 { |
| 75 | covered += 1; |
| 76 | } |
| 77 | } |
| 78 | let ratio: f32 = covered as f32 / (self.branches.len() * 2) as f32; |
| 79 | ratio |
| 80 | } |
| 81 | |
| 82 | pub fn get_covered_banch(&self) -> Vec<Branch> { |
| 83 | let mut covered: Vec<Branch> = Vec::new(); |
nothing calls this directly
no test coverage detected