Skip to content

Commit

Permalink
assert float check should have a limit
Browse files Browse the repository at this point in the history
  • Loading branch information
van-sprundel committed Oct 12, 2024
1 parent def05b3 commit 36e52e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ntpd/src/daemon/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,8 @@ mod tests {

let config = config.unwrap();
assert_eq!(config.synchronization_base.minimum_agreeing_sources, 2);
assert_eq!(config.algorithm.initial_wander, 1e-7);

// see https://rust-lang.github.io/rust-clippy/master/index.html#float_cmp
assert!((config.algorithm.initial_wander - 1e-7).abs() < 1e-8);
}
}

0 comments on commit 36e52e4

Please sign in to comment.