Skip to content

Commit

Permalink
coverage. Fix test typo
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuyunxing committed Sep 19, 2024
1 parent 0019f25 commit 639d83e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tests/coverage/mcdc/condition-limit.cov-map
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Function name: condition_limit::accpet_7_conditions
Function name: condition_limit::accept_7_conditions
Raw bytes (232): 0x[01, 01, 2c, 01, 05, 05, 1d, 05, 1d, 7a, 19, 05, 1d, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 21, 9b, 01, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 12, 01, 07, 01, 02, 09, 28, 08, 07, 02, 08, 00, 27, 30, 05, 02, 01, 07, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 7a, 1d, 07, 06, 00, 00, 0d, 00, 0e, 7a, 00, 12, 00, 13, 30, 76, 19, 06, 05, 00, 00, 12, 00, 13, 76, 00, 17, 00, 18, 30, 72, 15, 05, 04, 00, 00, 17, 00, 18, 72, 00, 1c, 00, 1d, 30, 6e, 11, 04, 03, 00, 00, 1c, 00, 1d, 6e, 00, 21, 00, 22, 30, 6a, 0d, 03, 02, 00, 00, 21, 00, 22, 6a, 00, 26, 00, 27, 30, 21, 09, 02, 00, 00, 00, 26, 00, 27, 21, 00, 28, 02, 06, 9b, 01, 02, 06, 00, 07, 97, 01, 01, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Expand Down
6 changes: 3 additions & 3 deletions tests/coverage/mcdc/condition-limit.coverage
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
LL| |//@ compile-flags: -Zcoverage-options=mcdc
LL| |//@ llvm-cov-flags: --show-branches=count --show-mcdc
LL| |
LL| 2|fn accpet_7_conditions(bool_arr: [bool; 7]) {
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
Expand Down Expand Up @@ -50,7 +50,7 @@
LL| |
LL| |#[coverage(off)]
LL| |fn main() {
LL| | accpet_7_conditions([false; 7]);
LL| | accpet_7_conditions([true; 7]);
LL| | accept_7_conditions([false; 7]);
LL| | accept_7_conditions([true; 7]);
LL| |}

6 changes: 3 additions & 3 deletions tests/coverage/mcdc/condition-limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//@ compile-flags: -Zcoverage-options=mcdc
//@ llvm-cov-flags: --show-branches=count --show-mcdc

fn accpet_7_conditions(bool_arr: [bool; 7]) {
fn accept_7_conditions(bool_arr: [bool; 7]) {
let [a, b, c, d, e, f, g] = bool_arr;
if a && b && c && d && e && f && g {
core::hint::black_box("hello");
Expand All @@ -13,6 +13,6 @@ fn accpet_7_conditions(bool_arr: [bool; 7]) {

#[coverage(off)]
fn main() {
accpet_7_conditions([false; 7]);
accpet_7_conditions([true; 7]);
accept_7_conditions([false; 7]);
accept_7_conditions([true; 7]);
}
2 changes: 1 addition & 1 deletion tests/coverage/mcdc/if.coverage
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
LL| |
LL| 4|fn mcdc_check_not_tree_decision(a: bool, b: bool, c: bool) {
LL| 4| // Contradict to `mcdc_check_tree_decision`,
LL| 4| // 100% branch coverage of this expression does not mean indicates 100% mcdc coverage.
LL| 4| // 100% branch coverage of this expression does not indicate 100% mcdc coverage.
LL| 4| if (a || b) && c {
^1
------------------
Expand Down
2 changes: 1 addition & 1 deletion tests/coverage/mcdc/if.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn mcdc_check_tree_decision(a: bool, b: bool, c: bool) {

fn mcdc_check_not_tree_decision(a: bool, b: bool, c: bool) {
// Contradict to `mcdc_check_tree_decision`,
// 100% branch coverage of this expression does not mean indicates 100% mcdc coverage.
// 100% branch coverage of this expression does not indicate 100% mcdc coverage.
if (a || b) && c {
say("pass");
} else {
Expand Down

0 comments on commit 639d83e

Please sign in to comment.