Skip to content

Commit

Permalink
Merge pull request #36 from saroh/deps-bump
Browse files Browse the repository at this point in the history
bump `rand` to 0.8 and `proptest` to 1.0.0
  • Loading branch information
fulmicoton authored Jul 5, 2022
2 parents 25ae334 + 7fc03af commit 2fa5d34
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ edition = "2018"
crunchy = "0.2"

[dev-dependencies]
rand = "0.7"
rand = "0.8"
criterion = "0.3"
proptest = "0.9.4"
proptest = "1.0.0"

[features]
bitpacker1x = []
Expand Down
1 change: 0 additions & 1 deletion src/test.rs

This file was deleted.

6 changes: 4 additions & 2 deletions src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
extern crate rand;

use self::rand::distributions::Uniform;
use self::rand::prelude::*;
use super::most_significant_bit;
use super::UnsafeBitPacker;

pub fn generate_array(n: usize, max_num_bits: u8) -> Vec<u32> {
assert!(max_num_bits <= 32u8);
let seed: &[u8; 32] = &[1u8; 32];
let max_val: u64 = 1u64 << max_num_bits;
let mut rng = StdRng::from_seed(*seed);
(0..n).map(|_| rng.gen_range(0, max_val) as u32).collect()
let max_val: u64 = 1u64 << max_num_bits;
let between = Uniform::from(0..max_val);
(0..n).map(|_| between.sample(&mut rng) as u32).collect()
}

fn integrate_data(initial: u32, data: &mut [u32]) {
Expand Down

0 comments on commit 2fa5d34

Please sign in to comment.