Skip to content

Commit

Permalink
relax measure macros test check (#3517)
Browse files Browse the repository at this point in the history
  • Loading branch information
bw-solana authored Nov 7, 2024
1 parent 5abb627 commit a0b2c73
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions measure/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ mod tests {
fn test_measure_macro() {
// Ensure that the measurement side actually works
{
let (_result, measure) = measure_time!(sleep(Duration::from_secs(1)), "test");
assert!(measure.as_s() >= 0.99f32 && measure.as_s() <= 1.01f32);
assert!(measure.as_ms() >= 990 && measure.as_ms() <= 1_010);
assert!(measure.as_us() >= 999_000 && measure.as_us() <= 1_010_000);
let (_result, measure) = measure_time!(sleep(Duration::from_millis(1)), "test");
assert!(measure.as_s() > 0.0);
assert!(measure.as_ms() > 0);
assert!(measure.as_us() > 0);
}

// Ensure that the macro can be called with functions
Expand Down Expand Up @@ -184,8 +184,8 @@ mod tests {
fn test_measure_us_macro() {
// Ensure that the measurement side actually works
{
let (_result, measure) = measure_us!(sleep(Duration::from_secs(1)));
assert!((999_000..=1_010_000).contains(&measure));
let (_result, measure) = measure_us!(sleep(Duration::from_millis(1)));
assert!(measure > 0);
}

// Ensure that the macro can be called with functions
Expand Down

0 comments on commit a0b2c73

Please sign in to comment.