Skip to content

Commit 2ce45f0

Browse files
committed
uefi-raw: add ABI test for IpAddress
1 parent 001f71c commit 2ce45f0

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
@@ -434,4 +434,16 @@ mod tests {
434434
let expected = [42, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42];
435435
assert_eq!(ipv6_addr.octets(), expected);
436436
}
437+
438+
#[test]
439+
fn test_efi_ip_address_abi() {
440+
#[repr(C, packed)]
441+
struct PackedHelper<T>(T);
442+
443+
assert_eq!(align_of::<IpAddress>(), 4);
444+
assert_eq!(size_of::<IpAddress>(), 16);
445+
446+
assert_eq!(align_of::<PackedHelper<IpAddress>>(), 1);
447+
assert_eq!(size_of::<PackedHelper<IpAddress>>(), 16);
448+
}
437449
}

0 commit comments

Comments
 (0)