Skip to content

Commit ed25b98

Browse files
committed
uefi-raw: add ABI test for IpAddress
1 parent 5b2c2e7 commit ed25b98

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
@@ -393,4 +393,16 @@ mod tests {
393393
assert_eq!(uefi_mac_addr.octets(), octets);
394394
}
395395
}
396+
397+
#[test]
398+
fn test_efi_ip_address_abi() {
399+
#[repr(C, packed)]
400+
struct PackedHelper<T>(T);
401+
402+
assert_eq!(align_of::<IpAddress>(), 4);
403+
assert_eq!(size_of::<IpAddress>(), 16);
404+
405+
assert_eq!(align_of::<PackedHelper<IpAddress>>(), 1);
406+
assert_eq!(size_of::<PackedHelper<IpAddress>>(), 16);
407+
}
396408
}

0 commit comments

Comments
 (0)