From ca471a88481aad8bad723da829670954c9cd2043 Mon Sep 17 00:00:00 2001 From: Yu Sun Date: Sat, 15 Nov 2025 21:17:08 +0800 Subject: [PATCH 1/2] test(corners): increase the tolerance --- src/corners.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corners.rs b/src/corners.rs index 91d8128d..58fb94ae 100644 --- a/src/corners.rs +++ b/src/corners.rs @@ -615,7 +615,7 @@ mod tests { 00, 00, 00, 00, 00, 10, 00; 00, 00, 00, 10, 10, 00, 00); - assert_eq!( + assert_approx_eq!( intensity_centroid(&image, 3, 3, 3), -std::f32::consts::FRAC_PI_4 ); From 7b5eee367cdf674b0957421a10522ca2ddcc2fef Mon Sep 17 00:00:00 2001 From: Yu Sun Date: Tue, 18 Nov 2025 17:57:08 +0800 Subject: [PATCH 2/2] test: ignore miri deviation --- src/geometry.rs | 2 +- src/template_matching.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/geometry.rs b/src/geometry.rs index c904efdc..0bdcfc5e 100644 --- a/src/geometry.rs +++ b/src/geometry.rs @@ -282,7 +282,7 @@ mod tests { arc_length(&[Point::new(1.0, 1.0), Point::new(4.0, 5.0)], false), 5.0 ); - assert_eq!( + assert_approx_eq!( arc_length( &[ Point::new(1.0, 1.0), diff --git a/src/template_matching.rs b/src/template_matching.rs index a9476289..a80257a2 100644 --- a/src/template_matching.rs +++ b/src/template_matching.rs @@ -593,7 +593,7 @@ mod tests { 3.0, 1.0 ); - assert_pixels_eq!(actual, expected); + assert_pixels_eq_within!(actual, expected, 0.1); } #[test] @@ -619,7 +619,7 @@ mod tests { 3.0 / (23.0 * tss).sqrt(), 1.0 / (35.0 * tss).sqrt() ); - assert_pixels_eq!(actual, expected); + assert_pixels_eq_within!(actual, expected, 0.1); } #[test] @@ -694,7 +694,7 @@ mod tests { MatchTemplateMethod::SumOfSquaredErrors, &mask, ); - assert_pixels_eq!(actual, expected); + assert_pixels_eq_within!(actual, expected, 0.1); #[cfg(feature = "rayon")] { @@ -733,7 +733,7 @@ mod tests { MatchTemplateMethod::SumOfSquaredErrorsNormalized, &mask, ); - assert_pixels_eq!(actual, expected); + assert_pixels_eq_within!(actual, expected, 0.1); #[cfg(feature = "rayon")] { @@ -811,7 +811,7 @@ mod tests { MatchTemplateMethod::CrossCorrelationNormalized, &mask, ); - assert_pixels_eq!(actual, expected); + assert_pixels_eq_within!(actual, expected, 0.1); #[cfg(feature = "rayon")] {