Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

test: whisper/cli add invalid pool size test depending on processor #10811

Merged
merged 2 commits into from
Jul 4, 2019
Merged
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
13 changes: 11 additions & 2 deletions whisper/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,21 @@ mod tests {
}

#[test]
// The Whisper pool size is of type usize. Invalid Whisper pool sizes include
// values below 0 and either above 2 ** 64 - 1 on a 64-bit processor or
// above 2 ** 32 - 1 on a 32-bit processor.
fn invalid_whisper_pool_size() {
let command = vec!["whisper", "--whisper-pool-size=-100000000000000000000000000000000000000"]
let command_pool_size_too_low = vec!["whisper", "--whisper-pool-size=-1"]
.into_iter()
.map(Into::into)
.collect::<Vec<String>>();

assert!(execute(command).is_err());
let command_pool_size_too_high = vec!["whisper", "--whisper-pool-size=18446744073709552000"]
.into_iter()
.map(Into::into)
.collect::<Vec<String>>();

assert!(execute(command_pool_size_too_low).is_err());
assert!(execute(command_pool_size_too_high).is_err());
}
}