mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-02-17 22:11:30 +08:00
Fix test compilation issues from code review
- Fix type error: Cast u32 to f64 for float multiplication - Clarify comment: Change 'base bitrate' to 'base_bitrate() returns' for accuracy Co-authored-by: rustdesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
@@ -772,7 +772,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_h264_h265_bitrate_calculation() {
|
||||
// Test with 1920x1080 resolution (base bitrate = 2073 kbps)
|
||||
// Test with 1920x1080 resolution (base_bitrate() returns 2073 kbps for 1080p)
|
||||
let width = 1920;
|
||||
let height = 1080;
|
||||
|
||||
@@ -797,8 +797,8 @@ mod tests {
|
||||
let best_ratio = 1.5;
|
||||
let h265_best = HwRamEncoder::calc_bitrate(width, height, best_ratio, false);
|
||||
|
||||
// At best quality, should use significantly more bitrate
|
||||
assert!(h265_best > h265_balanced * 1.5,
|
||||
// At best quality, should use significantly more bitrate (>50% more)
|
||||
assert!((h265_best as f64) > (h265_balanced as f64 * 1.5),
|
||||
"Best quality should use >50% more bitrate than balanced");
|
||||
|
||||
// Test with BR_SPEED (0.5) - low quality setting
|
||||
|
||||
Reference in New Issue
Block a user