mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Test cfg_type of VIRTIO_PCI_CAP_PCI_CFG
Assert the emitted VirtioPciCfgCap carries cfg_type 5, the value assigned to PciCapabilityType::Pci by virtio 1.2 section 4.1.4.1. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
e7d394e286
commit
b776c6d317
@@ -1451,4 +1451,11 @@ mod unit_tests {
|
||||
assert_eq!(cap.cap.cap_len, expected);
|
||||
assert_eq!(cap.cap.cap_len, 20);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pci_cfg_cap_cfg_type_is_pci() {
|
||||
let cap = VirtioPciCfgCap::new();
|
||||
assert_eq!(cap.cap.cfg_type, PciCapabilityType::Pci as u8);
|
||||
assert_eq!(cap.cap.cfg_type, 5);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user