CRC: revert panic!(MESSAGE) to assert!(false, MESSAGE) and silence warnings

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
This commit is contained in:
Jacinta Ferrant
2023-10-06 10:54:05 -07:00
parent b4ed5f2933
commit 55b06c2795
3 changed files with 10 additions and 5 deletions

View File

@@ -5,6 +5,7 @@
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![cfg_attr(test, allow(unused_variables, unused_assignments))]
#![allow(clippy::assertions_on_constants)]
extern crate curve25519_dalek;
extern crate ed25519_dalek;

View File

@@ -426,7 +426,8 @@ mod test {
0
}
_ => {
panic!("unwrapped err: {:?}", &e);
assert!(false, "unwrapped err: {:?}", &e);
unreachable!();
}
},
};
@@ -459,7 +460,8 @@ mod test {
0
}
_ => {
panic!("unwrapped err: {:?}", &e);
assert!(false, "unwrapped err: {:?}", &e);
unreachable!();
}
},
};

View File

@@ -549,7 +549,7 @@ mod tests {
(_, _) => {
// either got a key when we didn't expect one, or didn't get a key when we did
// expect one.
panic!("Unexpected result: we either got a key when we didn't expect one, or didn't get a key when we did expect one.");
assert!(false, "Unexpected result: we either got a key when we didn't expect one, or didn't get a key when we did expect one.");
}
}
}
@@ -619,13 +619,15 @@ mod tests {
(Err(e1), Err(e2)) => assert_eq!(e1, e2),
(Err(e1), _) => {
test_debug!("Failed to verify signature: {}", e1);
panic!(
assert!(
false,
"failed fixture (verification: {:?}): {:#?}",
&ver_res, &fixture
);
}
(_, _) => {
panic!(
assert!(
false,
"failed fixture (verification: {:?}): {:#?}",
&ver_res, &fixture
);