Skip to content

Commit

Permalink
Add static_new_in_place() marker limit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
okready committed Jun 16, 2018
1 parent d4e566c commit 17ee783
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,38 @@ fn validate_back_marker_limits() {
);
}

/// Verifies that the available space for tracking markers at the front of a
/// scratchpad is correctly adjusted as markers set at the back increase when
/// using a `Scratchpad` created with `static_new_in_place()`.
#[test]
fn validate_front_marker_limits_in_place() {
unsafe {
let mut scratchpad = uninitialized();
SimpleScratchpad::static_new_in_place(&mut scratchpad);
validate_marker_limits(
&scratchpad,
|scratchpad| scratchpad.mark_front(),
|scratchpad| scratchpad.mark_back(),
);
}
}

/// Verifies that the available space for tracking markers at the back of a
/// scratchpad is correctly adjusted as markers set at the front increase when
/// using a `Scratchpad` created with `static_new_in_place()`.
#[test]
fn validate_back_marker_limits_in_place() {
unsafe {
let mut scratchpad = uninitialized();
SimpleScratchpad::static_new_in_place(&mut scratchpad);
validate_marker_limits(
&scratchpad,
|scratchpad| scratchpad.mark_back(),
|scratchpad| scratchpad.mark_front(),
);
}
}

/// Verifies `Allocation::unwrap()` doesn't accidentally drop or leak data.
#[test]
fn allocation_unwrap_test() {
Expand Down

0 comments on commit 17ee783

Please sign in to comment.