Remove old integer tests

This commit is contained in:
Caleb Zulawski
2021-01-07 01:28:17 -05:00
parent 0ac057a354
commit 5b0818a221
8 changed files with 0 additions and 444 deletions

View File

@@ -1,4 +0,0 @@
use super::helpers;
int_tests! { i128x2, i128 }
int_tests! { i128x4, i128 }

View File

@@ -1,6 +0,0 @@
use super::helpers;
int_tests! { i16x4, i16 }
int_tests! { i16x8, i16 }
int_tests! { i16x16, i16 }
int_tests! { i16x32, i16 }

View File

@@ -1,6 +0,0 @@
use super::helpers;
int_tests! { i32x2, i32 }
int_tests! { i32x4, i32 }
int_tests! { i32x8, i32 }
int_tests! { i32x16, i32 }

View File

@@ -1,5 +0,0 @@
use super::helpers;
int_tests! { i64x2, i64 }
int_tests! { i64x4, i64 }
int_tests! { i64x8, i64 }

View File

@@ -1,6 +0,0 @@
use super::helpers;
int_tests! { i8x8, i8 }
int_tests! { i8x16, i8 }
int_tests! { i8x32, i8 }
int_tests! { i8x64, i8 }

View File

@@ -40,194 +40,6 @@ macro_rules! int_tests {
-1, -2, -3, -4, -5, -6, -7, -8,
];
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn add() {
let a = from_slice(&A);
let b = from_slice(&B);
let expected = apply_binary_lanewise(a, b, core::ops::Add::add);
assert_biteq!(a + b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn add_assign() {
let mut a = from_slice(&A);
let b = from_slice(&B);
let expected = apply_binary_lanewise(a, b, core::ops::Add::add);
a += b;
assert_biteq!(a, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn add_scalar_rhs() {
let a = from_slice(&A);
let b = 5;
let expected = apply_binary_scalar_rhs_lanewise(a, b, core::ops::Add::add);
assert_biteq!(a + b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn add_scalar_lhs() {
let a = 5;
let b = from_slice(&B);
let expected = apply_binary_scalar_lhs_lanewise(a, b, core::ops::Add::add);
assert_biteq!(a + b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn add_assign_scalar() {
let mut a = from_slice(&A);
let b = 5;
let expected = apply_binary_scalar_rhs_lanewise(a, b, core::ops::Add::add);
a += b;
assert_biteq!(a, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn sub() {
let a = from_slice(&A);
let b = from_slice(&B);
let expected = apply_binary_lanewise(a, b, core::ops::Sub::sub);
assert_biteq!(a - b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn sub_assign() {
let mut a = from_slice(&A);
let b = from_slice(&B);
let expected = apply_binary_lanewise(a, b, core::ops::Sub::sub);
a -= b;
assert_biteq!(a, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn sub_scalar_rhs() {
let a = from_slice(&A);
let b = 5;
let expected = apply_binary_scalar_rhs_lanewise(a, b, core::ops::Sub::sub);
assert_biteq!(a - b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn sub_scalar_lhs() {
let a = 5;
let b = from_slice(&B);
let expected = apply_binary_scalar_lhs_lanewise(a, b, core::ops::Sub::sub);
assert_biteq!(a - b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn sub_assign_scalar() {
let mut a = from_slice(&A);
let b = 5;
let expected = apply_binary_scalar_rhs_lanewise(a, b, core::ops::Sub::sub);
a -= b;
assert_biteq!(a, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn mul() {
let a = from_slice(&A);
let b = from_slice(&B);
let expected = apply_binary_lanewise(a, b, core::ops::Mul::mul);
assert_biteq!(a * b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn mul_assign() {
let mut a = from_slice(&A);
let b = from_slice(&B);
let expected = apply_binary_lanewise(a, b, core::ops::Mul::mul);
a *= b;
assert_biteq!(a, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn mul_scalar_rhs() {
let a = from_slice(&A);
let b = 5;
let expected = apply_binary_scalar_rhs_lanewise(a, b, core::ops::Mul::mul);
assert_biteq!(a * b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn mul_scalar_lhs() {
let a = 5;
let b = from_slice(&B);
let expected = apply_binary_scalar_lhs_lanewise(a, b, core::ops::Mul::mul);
assert_biteq!(a * b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn mul_assign_scalar() {
let mut a = from_slice(&A);
let b = 5;
let expected = apply_binary_scalar_rhs_lanewise(a, b, core::ops::Mul::mul);
a *= b;
assert_biteq!(a, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn div() {
let a = from_slice(&A);
let b = from_slice(&B);
let expected = apply_binary_lanewise(a, b, core::ops::Div::div);
assert_biteq!(a / b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn div_assign() {
let mut a = from_slice(&A);
let b = from_slice(&B);
let expected = apply_binary_lanewise(a, b, core::ops::Div::div);
a /= b;
assert_biteq!(a, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn div_scalar_rhs() {
let a = from_slice(&A);
let b = 5;
let expected = apply_binary_scalar_rhs_lanewise(a, b, core::ops::Div::div);
assert_biteq!(a / b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn div_scalar_lhs() {
let a = 5;
let b = from_slice(&B);
let expected = apply_binary_scalar_lhs_lanewise(a, b, core::ops::Div::div);
assert_biteq!(a / b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn div_assign_scalar() {
let mut a = from_slice(&A);
let b = 5;
let expected = apply_binary_scalar_rhs_lanewise(a, b, core::ops::Div::div);
a /= b;
assert_biteq!(a, expected);
}
#[test]
#[should_panic]
fn div_min_panics() {
@@ -261,53 +73,6 @@ macro_rules! int_tests {
let _ = a / b;
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn rem() {
let a = from_slice(&A);
let b = from_slice(&B);
let expected = apply_binary_lanewise(a, b, core::ops::Rem::rem);
assert_biteq!(a % b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn rem_assign() {
let mut a = from_slice(&A);
let b = from_slice(&B);
let expected = apply_binary_lanewise(a, b, core::ops::Rem::rem);
a %= b;
assert_biteq!(a, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn rem_scalar_rhs() {
let a = from_slice(&A);
let b = 5;
let expected = apply_binary_scalar_rhs_lanewise(a, b, core::ops::Rem::rem);
assert_biteq!(a % b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn rem_scalar_lhs() {
let a = 5;
let b = from_slice(&B);
let expected = apply_binary_scalar_lhs_lanewise(a, b, core::ops::Rem::rem);
assert_biteq!(a % b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn rem_assign_scalar() {
let mut a = from_slice(&A);
let b = 5;
let expected = apply_binary_scalar_rhs_lanewise(a, b, core::ops::Rem::rem);
a %= b;
assert_biteq!(a, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn rem_min_neg_one_no_panic() {
@@ -331,163 +96,6 @@ macro_rules! int_tests {
let b = from_slice(&vec![0 ; 64]);
let _ = a % b;
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn bitand() {
let a = from_slice(&A);
let b = from_slice(&B);
let expected = apply_binary_lanewise(a, b, core::ops::BitAnd::bitand);
assert_biteq!(a & b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn bitand_assign() {
let mut a = from_slice(&A);
let b = from_slice(&B);
let expected = apply_binary_lanewise(a, b, core::ops::BitAnd::bitand);
a &= b;
assert_biteq!(a, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn bitand_scalar_rhs() {
let a = from_slice(&A);
let b = 5;
let expected = apply_binary_scalar_rhs_lanewise(a, b, core::ops::BitAnd::bitand);
assert_biteq!(a & b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn bitand_scalar_lhs() {
let a = 5;
let b = from_slice(&B);
let expected = apply_binary_scalar_lhs_lanewise(a, b, core::ops::BitAnd::bitand);
assert_biteq!(a & b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn bitand_assign_scalar() {
let mut a = from_slice(&A);
let b = 5;
let expected = apply_binary_scalar_rhs_lanewise(a, b, core::ops::BitAnd::bitand);
a &= b;
assert_biteq!(a, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn bitor() {
let a = from_slice(&A);
let b = from_slice(&B);
let expected = apply_binary_lanewise(a, b, core::ops::BitOr::bitor);
assert_biteq!(a | b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn bitor_assign() {
let mut a = from_slice(&A);
let b = from_slice(&B);
let expected = apply_binary_lanewise(a, b, core::ops::BitOr::bitor);
a |= b;
assert_biteq!(a, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn bitor_scalar_rhs() {
let a = from_slice(&A);
let b = 5;
let expected = apply_binary_scalar_rhs_lanewise(a, b, core::ops::BitOr::bitor);
assert_biteq!(a | b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn bitor_scalar_lhs() {
let a = 5;
let b = from_slice(&B);
let expected = apply_binary_scalar_lhs_lanewise(a, b, core::ops::BitOr::bitor);
assert_biteq!(a | b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn bitor_assign_scalar() {
let mut a = from_slice(&A);
let b = 5;
let expected = apply_binary_scalar_rhs_lanewise(a, b, core::ops::BitOr::bitor);
a |= b;
assert_biteq!(a, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn bitxor() {
let a = from_slice(&A);
let b = from_slice(&B);
let expected = apply_binary_lanewise(a, b, core::ops::BitXor::bitxor);
assert_biteq!(a ^ b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn bitxor_assign() {
let mut a = from_slice(&A);
let b = from_slice(&B);
let expected = apply_binary_lanewise(a, b, core::ops::BitXor::bitxor);
a ^= b;
assert_biteq!(a, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn bitxor_scalar_rhs() {
let a = from_slice(&A);
let b = 5;
let expected = apply_binary_scalar_rhs_lanewise(a, b, core::ops::BitXor::bitxor);
assert_biteq!(a ^ b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn bitxor_scalar_lhs() {
let a = 5;
let b = from_slice(&B);
let expected = apply_binary_scalar_lhs_lanewise(a, b, core::ops::BitXor::bitxor);
assert_biteq!(a ^ b, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn bitxor_assign_scalar() {
let mut a = from_slice(&A);
let b = 5;
let expected = apply_binary_scalar_rhs_lanewise(a, b, core::ops::BitXor::bitxor);
a ^= b;
assert_biteq!(a, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn neg() {
let v = from_slice(&A);
let expected = apply_unary_lanewise(v, core::ops::Neg::neg);
assert_biteq!(-v, expected);
}
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn not() {
let v = from_slice(&A);
let expected = apply_unary_lanewise(v, core::ops::Not::not);
assert_biteq!(!v, expected);
}
}
}
}

View File

@@ -1,5 +0,0 @@
use super::helpers;
int_tests! { isizex2, isize }
int_tests! { isizex4, isize }
int_tests! { isizex8, isize }

View File

@@ -2,26 +2,6 @@
#[path = "../helpers/mod.rs"]
mod helpers;
#[macro_use]
mod int_macros;
mod r#i8;
mod r#i16;
mod r#i32;
mod r#i64;
mod r#i128;
mod r#isize;
#[macro_use]
mod uint_macros;
mod r#u8;
mod r#u16;
mod r#u32;
mod r#u64;
mod r#u128;
mod r#usize;
#[macro_use]
mod mask_macros;