Skip to content

Commit 85e6bba

Browse files
committed
uefi-raw: add ABI test for IpAddress
1 parent 8ca04f5 commit 85e6bba

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

uefi-raw/src/net.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,4 +427,16 @@ mod tests {
427427
let expected = [42, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42];
428428
assert_eq!(ipv6_addr.octets(), expected);
429429
}
430+
431+
#[test]
432+
fn test_efi_ip_address_abi() {
433+
#[repr(C, packed)]
434+
struct PackedHelper<T>(T);
435+
436+
assert_eq!(align_of::<IpAddress>(), 4);
437+
assert_eq!(size_of::<IpAddress>(), 16);
438+
439+
assert_eq!(align_of::<PackedHelper<IpAddress>>(), 1);
440+
assert_eq!(size_of::<PackedHelper<IpAddress>>(), 16);
441+
}
430442
}

0 commit comments

Comments
 (0)