Skip to content

Commit

Permalink
Fix tests when odd-primes is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyBF committed Aug 14, 2024
1 parent 6764278 commit c89c833
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions ext/crates/fp/src/field/fp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ mod tests {

fn arb_elements<const N: usize>(
) -> impl Strategy<Value = (Fp<ValidPrime>, [FieldElement<Fp<ValidPrime>>; N])> {
crate::prime::tests::arb_prime().prop_flat_map(|p| super::arb_elements(p))
crate::prime::tests::arb_prime().prop_flat_map(super::arb_elements)
}

field_tests!();
Expand Down Expand Up @@ -218,7 +218,9 @@ mod tests {
}

static_fp_tests!(P2);
static_fp_tests!(P3);
static_fp_tests!(P5);
static_fp_tests!(P7);
cfg_if::cfg_if! { if #[cfg(feature = "odd-primes")] {
static_fp_tests!(P3);
static_fp_tests!(P5);
static_fp_tests!(P7);
}}
}
10 changes: 6 additions & 4 deletions ext/crates/fp/src/field/smallfq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ mod tests {
fn arb_elements<const N: usize>(
) -> impl Strategy<Value = (SmallFq<ValidPrime>, [FieldElement<SmallFq<ValidPrime>>; N])>
{
arb_smallfq_prime().prop_flat_map(|p| super::arb_elements(p))
arb_smallfq_prime().prop_flat_map(super::arb_elements)
}

field_tests!();
Expand Down Expand Up @@ -380,7 +380,9 @@ mod tests {
}

static_smallfq_tests!(P2);
static_smallfq_tests!(P3);
static_smallfq_tests!(P5);
static_smallfq_tests!(P7);
cfg_if::cfg_if! { if #[cfg(feature = "odd-primes")] {
static_smallfq_tests!(P3);
static_smallfq_tests!(P5);
static_smallfq_tests!(P7);
}}
}

0 comments on commit c89c833

Please sign in to comment.