File: condition-limit.coverage

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (56 lines) | stat: -rw-r--r-- 1,837 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
   LL|       |#![feature(coverage_attribute)]
   LL|       |//@ edition: 2021
   LL|       |//@ min-llvm-version: 19
   LL|       |//@ compile-flags: -Zcoverage-options=mcdc
   LL|       |//@ llvm-cov-flags: --show-branches=count --show-mcdc
   LL|       |
   LL|      2|fn accept_7_conditions(bool_arr: [bool; 7]) {
   LL|      2|    let [a, b, c, d, e, f, g] = bool_arr;
   LL|      2|    if a && b && c && d && e && f && g {
                          ^1   ^1   ^1   ^1   ^1   ^1
  ------------------
  |  Branch (LL:8): [True: 1, False: 1]
  |  Branch (LL:13): [True: 1, False: 0]
  |  Branch (LL:18): [True: 1, False: 0]
  |  Branch (LL:23): [True: 1, False: 0]
  |  Branch (LL:28): [True: 1, False: 0]
  |  Branch (LL:33): [True: 1, False: 0]
  |  Branch (LL:38): [True: 1, False: 0]
  ------------------
  |---> MC/DC Decision Region (LL:8) to (LL:39)
  |
  |  Number of Conditions: 7
  |     Condition C1 --> (LL:8)
  |     Condition C2 --> (LL:13)
  |     Condition C3 --> (LL:18)
  |     Condition C4 --> (LL:23)
  |     Condition C5 --> (LL:28)
  |     Condition C6 --> (LL:33)
  |     Condition C7 --> (LL:38)
  |
  |  Executed MC/DC Test Vectors:
  |
  |     C1, C2, C3, C4, C5, C6, C7    Result
  |  1 { F,  -,  -,  -,  -,  -,  -  = F      }
  |  2 { T,  T,  T,  T,  T,  T,  T  = T      }
  |
  |  C1-Pair: covered: (1,2)
  |  C2-Pair: not covered
  |  C3-Pair: not covered
  |  C4-Pair: not covered
  |  C5-Pair: not covered
  |  C6-Pair: not covered
  |  C7-Pair: not covered
  |  MC/DC Coverage for Decision: 14.29%
  |
  ------------------
   LL|      1|        core::hint::black_box("hello");
   LL|      1|    }
   LL|      2|}
   LL|       |
   LL|       |#[coverage(off)]
   LL|       |fn main() {
   LL|       |    accept_7_conditions([false; 7]);
   LL|       |    accept_7_conditions([true; 7]);
   LL|       |}