mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-24 16:43:21 +00:00
Add submodule for field extension tests
This commit is contained in:
parent
5048a3f31d
commit
c14673863a
@ -202,10 +202,9 @@ impl<F: Extendable<2>> DivAssign for QuadraticExtension<F> {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
mod crandall {
|
||||
use crate::field::crandall_field::CrandallField;
|
||||
use crate::{test_field_arithmetic, test_field_extension};
|
||||
|
||||
test_field_extension!(CrandallField, 2);
|
||||
test_field_extension!(crate::field::crandall_field::CrandallField, 2);
|
||||
test_field_arithmetic!(
|
||||
crate::field::extension_field::quadratic::QuadraticExtension<
|
||||
crate::field::crandall_field::CrandallField,
|
||||
@ -214,10 +213,9 @@ mod tests {
|
||||
}
|
||||
|
||||
mod goldilocks {
|
||||
use crate::field::goldilocks_field::GoldilocksField;
|
||||
use crate::{test_field_arithmetic, test_field_extension};
|
||||
|
||||
test_field_extension!(GoldilocksField, 2);
|
||||
test_field_extension!(crate::field::goldilocks_field::GoldilocksField, 2);
|
||||
test_field_arithmetic!(
|
||||
crate::field::extension_field::quadratic::QuadraticExtension<
|
||||
crate::field::goldilocks_field::GoldilocksField,
|
||||
|
||||
@ -228,10 +228,9 @@ impl<F: Extendable<4>> DivAssign for QuarticExtension<F> {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
mod crandall {
|
||||
use crate::field::crandall_field::CrandallField;
|
||||
use crate::{test_field_arithmetic, test_field_extension};
|
||||
|
||||
test_field_extension!(CrandallField, 4);
|
||||
test_field_extension!(crate::field::crandall_field::CrandallField, 4);
|
||||
test_field_arithmetic!(
|
||||
crate::field::extension_field::quartic::QuarticExtension<
|
||||
crate::field::crandall_field::CrandallField,
|
||||
@ -240,10 +239,9 @@ mod tests {
|
||||
}
|
||||
|
||||
mod goldilocks {
|
||||
use crate::field::goldilocks_field::GoldilocksField;
|
||||
use crate::{test_field_arithmetic, test_field_extension};
|
||||
|
||||
test_field_extension!(GoldilocksField, 4);
|
||||
test_field_extension!(crate::field::goldilocks_field::GoldilocksField, 4);
|
||||
test_field_arithmetic!(
|
||||
crate::field::extension_field::quartic::QuarticExtension<
|
||||
crate::field::goldilocks_field::GoldilocksField,
|
||||
|
||||
@ -161,25 +161,27 @@ pub(crate) fn test_power_of_two_gen<BF: Extendable<D>, const D: usize>() {
|
||||
#[macro_export]
|
||||
macro_rules! test_field_extension {
|
||||
($field:ty, $d:expr) => {
|
||||
#[test]
|
||||
fn test_add_neg_sub_mul() {
|
||||
crate::field::field_testing::test_add_neg_sub_mul::<$field, $d>();
|
||||
}
|
||||
#[test]
|
||||
fn test_inv_div() {
|
||||
crate::field::field_testing::test_inv_div::<$field, $d>();
|
||||
}
|
||||
#[test]
|
||||
fn test_frobenius() {
|
||||
crate::field::field_testing::test_frobenius::<$field, $d>();
|
||||
}
|
||||
#[test]
|
||||
fn test_field_order() {
|
||||
crate::field::field_testing::test_field_order::<$field, $d>();
|
||||
}
|
||||
#[test]
|
||||
fn test_power_of_two_gen() {
|
||||
crate::field::field_testing::test_power_of_two_gen::<$field, $d>();
|
||||
mod field_extension {
|
||||
#[test]
|
||||
fn test_add_neg_sub_mul() {
|
||||
crate::field::field_testing::test_add_neg_sub_mul::<$field, $d>();
|
||||
}
|
||||
#[test]
|
||||
fn test_inv_div() {
|
||||
crate::field::field_testing::test_inv_div::<$field, $d>();
|
||||
}
|
||||
#[test]
|
||||
fn test_frobenius() {
|
||||
crate::field::field_testing::test_frobenius::<$field, $d>();
|
||||
}
|
||||
#[test]
|
||||
fn test_field_order() {
|
||||
crate::field::field_testing::test_field_order::<$field, $d>();
|
||||
}
|
||||
#[test]
|
||||
fn test_power_of_two_gen() {
|
||||
crate::field::field_testing::test_power_of_two_gen::<$field, $d>();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user