Skip to content

Commit

Permalink
Update posix_segment.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowhatter committed Jul 24, 2024
1 parent 1cbf809 commit b545f72
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions commons/zenoh-shm/tests/posix_segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,21 @@ where
rand::distributions::Standard: rand::distributions::Distribution<ID>,
ID: Copy + Clone + Display,
{
let elem_count = 900;

let created_segment: Segment<ID> =
Segment::create(900, TEST_SEGMENT_PREFIX).expect("error creating new segment");
Segment::create(elem_count, TEST_SEGMENT_PREFIX).expect("error creating new segment");

let opened_segment_instance_1 = Segment::open(created_segment.id(), TEST_SEGMENT_PREFIX)
.expect("error opening existing segment!");

validate_segment(&created_segment, &opened_segment_instance_1);
validate_segment(&created_segment, &opened_segment_instance_1, elem_count);

let opened_segment_instance_2 = Segment::open(created_segment.id(), TEST_SEGMENT_PREFIX)
.expect("error opening existing segment!");

validate_segment(&created_segment, &opened_segment_instance_1);
validate_segment(&created_segment, &opened_segment_instance_2);
validate_segment(&created_segment, &opened_segment_instance_1, elem_count);
validate_segment(&created_segment, &opened_segment_instance_2, elem_count);

drop(opened_segment_instance_1);
validate_segment(&created_segment, &opened_segment_instance_2);
Expand Down

0 comments on commit b545f72

Please sign in to comment.