commit | 5e1e5d80927b15150610e592ffabbb7b3f118f40 | [log] [tgz] |
---|---|---|
author | Li-Yu Yu <[email protected]> | Fri Sep 06 11:48:25 2024 +0000 |
committer | Li-Yu Yu <[email protected]> | Mon Sep 09 21:50:08 2024 +0000 |
tree | f5d48020fde7d9d491b40f72d73d46d6a360aee2 | |
parent | 84cb8a23fa21ffbd46d565d21d360243b0cec1a2 [diff] |
Import 'cov-mark' crate Request Document: go/android-rust-importing-crates For CL Reviewers: go/android3p#cl-review For Build Team: go/ab-third-party-imports Bug: 364711528 Test: m libcov_mark Change-Id: I1c0be9d88fd5fd02600029e211201d9c99059aa6
Verify that your tests exercise the conditions you think they are exercising
fn safe_divide(dividend: u32, divisor: u32) -> u32 { if divisor == 0 { cov_mark::hit!(save_divide_zero); return 0; } dividend / divisor } #[test] fn test_safe_divide_by_zero() { cov_mark::check!(save_divide_zero); assert_eq!(safe_divide(92, 0), 0); }
See the docs for details