Skip to content

Commit

Permalink
refact: parking loom tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromfedricci committed May 20, 2024
1 parent 7f9d8e9 commit 3f8f0f9
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/parking/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,40 +336,35 @@ mod test {
#[cfg(all(loom, test))]
mod model {
use crate::loom::models;
use crate::parking::{immediate, yields};

#[test]
fn try_lock_join_immediate_park() {
use crate::parking::immediate::Mutex;
models::try_lock_join::<Mutex<_>>();
models::try_lock_join::<immediate::Mutex<_>>();
}

#[test]
fn lock_join_immediate_park() {
use crate::parking::immediate::Mutex;
models::lock_join::<Mutex<_>>();
models::lock_join::<immediate::Mutex<_>>();
}

#[test]
fn mixed_lock_join_immediate_park() {
use crate::parking::immediate::Mutex;
models::mixed_lock_join::<Mutex<_>>();
models::mixed_lock_join::<immediate::Mutex<_>>();
}

#[test]
fn try_lock_join_yield_than_park() {
use crate::parking::yields::Mutex;
models::try_lock_join::<Mutex<_>>();
models::try_lock_join::<yields::Mutex<_>>();
}

#[test]
fn lock_join_yield_than_park() {
use crate::parking::yields::Mutex;
models::lock_join::<Mutex<_>>();
models::lock_join::<yields::Mutex<_>>();
}

#[test]
fn mixed_lock_join_yield_than_park() {
use crate::parking::yields::Mutex;
models::mixed_lock_join::<Mutex<_>>();
models::mixed_lock_join::<yields::Mutex<_>>();
}
}

0 comments on commit 3f8f0f9

Please sign in to comment.