Skip to content

Commit

Permalink
Update bbqtest to the new Rng::gen_range API
Browse files Browse the repository at this point in the history
  • Loading branch information
ithinuel committed Nov 26, 2023
1 parent 33f6f8f commit fcffdc0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bbqtest/src/multi_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ mod tests {
let mut trng = thread_rng();
let mut chunks = vec![];
while !data.is_empty() {
let chunk_sz = trng.gen_range(1, (1024 - 1) / 2);
let chunk_sz = trng.gen_range(1..((QUEUE_SIZE / 2) - 1));
if chunk_sz > data.len() {
continue;
}
Expand Down Expand Up @@ -264,9 +264,9 @@ mod tests {
if last_tx.elapsed() > TIMEOUT_NODATA {
panic!("tx timeout");
}
match tx
.grant_max_remaining(trng.gen_range(QUEUE_SIZE / 3, (2 * QUEUE_SIZE) / 3))
{
match tx.grant_max_remaining(
trng.gen_range((QUEUE_SIZE / 3)..((2 * QUEUE_SIZE) / 3)),
) {
Ok(mut gr) => {
let sz = ::std::cmp::min(data_tx.len(), gr.len());
for i in 0..sz {
Expand Down

0 comments on commit fcffdc0

Please sign in to comment.