Skip to content

Commit

Permalink
tests: ringbuf: split Arc tests to a separate fn
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
bonzini committed Nov 4, 2024
1 parent e2baa40 commit 455d214
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/ring_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,20 @@ fn even_stack() {
}

#[test]
fn even_failing() {
fn even_failing_box() {
assert!(matches!(
Box::try_pin_init(EvenU64::new2(3)),
Err(Error)
));
assert!(matches!(Box::try_init(EvenU64::new2(3)), Err(Error)));
}

#[test]
fn even_failing_arc() {
assert!(matches!(
Arc::try_pin_init(EvenU64::new2(5)),
Err(Error)
));
assert!(matches!(Box::try_init(EvenU64::new2(3)), Err(Error)));
assert!(matches!(Arc::try_init(EvenU64::new2(5)), Err(Error)));
}

Expand Down Expand Up @@ -249,12 +253,17 @@ struct BigStruct {

#[cfg(not(miri))]
#[test]
fn big_struct() {
fn big_struct_arc() {
let x = Arc::init(init!(BigStruct {
buf <- zeroed(),
oth <- zeroed(),
}));
println!("{x:?}");
}

#[cfg(not(miri))]
#[test]
fn big_struct_box() {
let x = Box::init(init!(BigStruct {
buf <- zeroed(),
oth <- zeroed(),
Expand Down

0 comments on commit 455d214

Please sign in to comment.