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 9c14c01 commit fce7e0fCopy full SHA for fce7e0f
uefi-raw/src/net.rs
@@ -212,4 +212,18 @@ mod tests {
212
let uefi_addr = IpAddress::from(core_addr);
213
assert_eq!(unsafe { uefi_addr.v6.0 }, TEST_IPV6);
214
}
215
+
216
+ // Ensure that our IpAddress type can be put into a packed struct,
217
+ // even when it is normally 4 byte aligned.
218
+ #[test]
219
+ fn test_efi_ip_address_abi() {
220
+ #[repr(C, packed)]
221
+ struct PackedHelper<T>(T);
222
223
+ assert_eq!(align_of::<IpAddress>(), 4);
224
+ assert_eq!(size_of::<IpAddress>(), 16);
225
226
+ assert_eq!(align_of::<PackedHelper<IpAddress>>(), 1);
227
+ assert_eq!(size_of::<PackedHelper<IpAddress>>(), 16);
228
+ }
229
0 commit comments