Mutate mul_u64 with mutagen

Add the `mutate` attribute to mutate `mul_u64`. Add non-doc comments
listing the two false positives. These are identical but we list them
twice so when devs grep for `mutagen false pos` the same number of lines
for each function is displayed as is displayed by the `mutagen` run.
This coding false positives thing is also introduced in PR #1655.
This commit is contained in:
Tobin C. Harding 2023-03-23 13:49:38 +11:00
parent dda3cb6fe2
commit 7cdc90565f
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 3 additions and 1 deletions

View File

@ -402,7 +402,9 @@ impl U256 {
///
/// The multiplication result along with a boolean indicating whether an arithmetic overflow
/// occurred. If an overflow occurred then the wrapped value is returned.
// mutagen false positive: binop_bit, replace `|` with `^`
// mutagen false pos mul_u64: replace `|` with `^` (XOR is same as OR when combined with <<)
// mutagen false pos mul_u64: replace `|` with `^`
#[cfg_attr(all(test, mutate), mutate)]
fn mul_u64(self, rhs: u64) -> (U256, bool) {
let mut carry: u128 = 0;
let mut split_le =