fix: Disable asserts that rely on timing characteristics during coverage testing

This commit is contained in:
Karolin Varner
2024-12-18 13:16:47 +01:00
committed by David Niehues
parent 00696321ff
commit d398ad369e
4 changed files with 41 additions and 26 deletions

View File

@@ -20,3 +20,6 @@ memsec = { workspace = true }
[dev-dependencies]
rand = "0.8.5"
[lints.rust]
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(coverage)'] }

View File

@@ -113,9 +113,10 @@ mod tests {
// Pearson correlation
let correlation = cv / (sd_x * sd_y);
println!("correlation: {:.6?}", correlation);
#[cfg(not(coverage))]
assert!(
correlation.abs() < 0.01,
"execution time correlates with result"
)
);
}
}