Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Replace unnecessary as conversions in tests. #1956

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tests/aead_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,10 @@ fn aead_chacha20_poly1305_openssh() {
as_array
};

let sequence_number = test_case.consume_usize("SEQUENCE_NUMBER");
assert_eq!(sequence_number as u32 as usize, sequence_number);
let sequence_num = sequence_number as u32;
let sequence_num: u32 = test_case
.consume_usize("SEQUENCE_NUMBER")
.try_into()
.unwrap();
let plaintext = test_case.consume_bytes("IN");
let ct = test_case.consume_bytes("CT");
let expected_tag = test_case.consume_bytes("TAG");
Expand Down
3 changes: 1 addition & 2 deletions tests/pbkdf2_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ pub fn pbkdf2_tests() {
unreachable!()
}
};
let iterations = test_case.consume_usize("c");
let iterations = NonZeroU32::new(iterations as u32).unwrap();
let iterations: u32 = test_case.consume_usize("c").try_into().unwrap();
let secret = test_case.consume_bytes("P");
let salt = test_case.consume_bytes("S");
let dk = test_case.consume_bytes("DK");
Expand Down
Loading