Skip to content

Commit

Permalink
Add a bunch of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yjugl committed Mar 12, 2024
1 parent 10c8fc3 commit bcda8f3
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/rt_win.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,36 @@ pub fn promote_current_thread_to_real_time_internal(

Ok(handle)
}

// We don't expect to see API failures on test machines
#[test]
fn test_successful_api_use() {
let handle = promote_current_thread_to_real_time_internal(0, 0);
println!("handle: {handle:?}");
assert!(handle.is_ok());
let result = demote_current_thread_from_real_time_internal(handle.unwrap());
println!("result: {result:?}");
assert!(result.is_ok());
}

// We don't expect to see API failures on test machines
#[test]
fn test_successful_api_use_2() {
let handle = promote_current_thread_to_real_time_internal(0, 0);
println!("handle: {handle:?}");
assert!(handle.is_ok());
let result = demote_current_thread_from_real_time_internal(handle.unwrap());
println!("result: {result:?}");
assert!(result.is_ok());
}

// We don't expect to see API failures on test machines
#[test]
fn test_successful_api_use_3() {
let handle = promote_current_thread_to_real_time_internal(0, 0);
println!("handle: {handle:?}");
assert!(handle.is_ok());
let result = demote_current_thread_from_real_time_internal(handle.unwrap());
println!("result: {result:?}");
assert!(result.is_ok());
}

0 comments on commit bcda8f3

Please sign in to comment.