We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bae8971 commit 2fd32a7Copy full SHA for 2fd32a7
uefi-raw/src/net.rs
@@ -202,4 +202,18 @@ mod tests {
202
let uefi_addr = IpAddress::from(core_addr);
203
assert_eq!(unsafe { uefi_addr.v6.0 }, TEST_IPV6);
204
}
205
+
206
+ // Ensure that our IpAddress type can be put into a packed struct,
207
+ // even when it is normally 4 byte aligned.
208
+ #[test]
209
+ fn test_efi_ip_address_abi() {
210
+ #[repr(C, packed)]
211
+ struct PackedHelper<T>(T);
212
213
+ assert_eq!(align_of::<IpAddress>(), 4);
214
+ assert_eq!(size_of::<IpAddress>(), 16);
215
216
+ assert_eq!(align_of::<PackedHelper<IpAddress>>(), 1);
217
+ assert_eq!(size_of::<PackedHelper<IpAddress>>(), 16);
218
+ }
219
0 commit comments