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:
Anatol Belski
2026-05-16 15:48:02 +02:00
committed by Rob Bradford
parent e7d394e286
commit b776c6d317

View File

@@ -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);
}
}