Skip to content

Commit

Permalink
Verify flames reach the top at full load
Browse files Browse the repository at this point in the history
  • Loading branch information
walles committed Jul 9, 2023
1 parent 644bd3a commit c3186a0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions libloadviz/src/renderer/flame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,20 @@ impl Renderer {
return Some(color);
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_flame_reaches_the_top() {
let viz_loads = vec![CpuLoad {
user_0_to_1: 1.0,
system_0_to_1: 0.0,
}];
let renderer: Renderer = Default::default();
let height = 100;
let pixel = renderer.get_flame_pixel(&viz_loads, 0.0, 0, height - 1, 1, height);
assert!(pixel.is_some());
}
}

0 comments on commit c3186a0

Please sign in to comment.