Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuschen committed Oct 9, 2024
1 parent 8f9bd4a commit 3fc7e6e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions iceoryx2/src/service/static_config/message_type_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,34 @@ mod tests {
let expected = Layout::new::<Demo2>();
assert_that!(sut, eq expected);
}
fn test_sample_layout1() {
#[repr(C)]
struct Demo2 {
header: i64,
_user_header: i32,
_aligment: i8,
payload: i16,
_aligment2: i8,
}
let details = MessageTypeDetails::from::<i64, i32, i16>(TypeVariant::FixedSize);
let sut = details.sample_layout(1);
let expected = Layout::new::<Demo2>();
assert_that!(sut, eq expected);
}
fn test_sample_layout2() {
#[repr(C)]
struct Demo {
header: i64,
_user_header: i64,
_aligment: i8,
payload: i64,
_aligment2: i8,
}
let details = MessageTypeDetails::from::<i64, i64, i64>(TypeVariant::FixedSize);
let sut = details.sample_layout(1);
let expected = Layout::new::<Demo>();
assert_that!(sut, eq expected);
}

#[test]
fn test_payload_layout() {
Expand Down

0 comments on commit 3fc7e6e

Please sign in to comment.