Skip to content

Commit

Permalink
Modify table_with_id_zero_but_no_zero_entry test to catch a has_zero_…
Browse files Browse the repository at this point in the history
…entry bug
  • Loading branch information
volhovm committed Dec 15, 2023
1 parent 4f1c762 commit bdc7e32
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions kimchi/src/tests/lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,20 +593,22 @@ fn test_runtime_table_only_one_table_with_id_zero_with_non_zero_entries_random_v
#[test]
#[should_panic]
fn test_lookup_with_a_table_with_id_zero_but_no_zero_entry() {
let max_len: u32 = 100u32;
let max_len: u32 = 2u32;
let seed: [u8; 32] = thread_rng().gen();
eprintln!("Seed: {:?}", seed);
let mut rng = StdRng::from_seed(seed);

// Non zero-length table
let len = 1u32 + rng.gen_range(0u32..max_len);
// Table id is 0
let table_id: i32 = 0;
// No index 0 in the table.
// Potentially 0 index in the table.
let indices: Vec<Fp> = (0..len)
.map(|_| 1 + rng.gen_range(0u32..max_len))
.map(|_| rng.gen_range(0u32..max_len))
.map(Into::into)
.collect();
// No zero value
// But no zero value. So we'll get rows with zeroes that are not
// full-zero-rows.
let values: Vec<Fp> = (0..len)
.map(|_| rng.gen_range(1u32..max_len))
.map(Into::into)
Expand Down

0 comments on commit bdc7e32

Please sign in to comment.