Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

test(algo): gate the Linux-only hash test's helpers to Linux x86_64

Khawar Zamman Wani6bda896ad0e6
diff --git a/crates/algo/src/features.rs b/crates/algo/src/features.rs
index e8e45bcaf..2da9d7b73 100644
--- a/crates/algo/src/features.rs
+++ b/crates/algo/src/features.rs
@@ -701,10 +701,12 @@ mod parallel_tests {
}
/// Blocks of random brightness: lots of strong corners, no libm in the making.
+ #[cfg(all(target_os = "linux", target_arch = "x86_64"))]
fn blocks(w: usize, h: usize, seed: u64) -> Vec<f32> {
(0..w * h).map(|i| (mix(seed + ((i % w) / 8) as u64 * 4096 + ((i / w) / 8) as u64) >> 40) as f32 / 16_777_216.0).collect()
}
+ #[cfg(all(target_os = "linux", target_arch = "x86_64"))]
fn fnv(parts: &[u64]) -> u64 {
let mut h = 0xcbf2_9ce4_8422_2325u64;
for p in parts {