[libvirt-glib v2 9/9] fixup! Add test for GVirConfigDomainHostdevPci API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 tests/test-gconfig.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tests/test-gconfig.c b/tests/test-gconfig.c
index c3711f1..a2f294f 100644
--- a/tests/test-gconfig.c
+++ b/tests/test-gconfig.c
@@ -714,13 +714,17 @@ static void test_domain_device_pci_hostdev(void)
     GVirConfigDomain *domain;
     GVirConfigDomainAddressPci *address;
     GVirConfigDomainHostdevPci *hostdev;
+    gboolean bar;
 
     domain = gvir_config_domain_new();
 
     hostdev = gvir_config_domain_hostdev_pci_new();
     gvir_config_domain_hostdev_set_boot_order(GVIR_CONFIG_DOMAIN_HOSTDEV(hostdev), 1);
+    g_assert_cmpint(gvir_config_domain_hostdev_get_boot_order(GVIR_CONFIG_DOMAIN_HOSTDEV(hostdev)), ==, 1);
     gvir_config_domain_hostdev_pci_set_managed(hostdev, TRUE);
+    g_assert(gvir_config_domain_hostdev_pci_get_managed(hostdev) == TRUE);
     gvir_config_domain_hostdev_pci_set_rom(hostdev, "/etc/fake/boot.bin", TRUE);
+    g_assert_cmpstr(gvir_config_domain_hostdev_pci_get_rom(hostdev, &bar), ==, "/etc/fake/boot.bin");
 
     address = gvir_config_domain_address_pci_new();
     gvir_config_domain_address_pci_set_domain(address, 1);
@@ -730,6 +734,14 @@ static void test_domain_device_pci_hostdev(void)
     gvir_config_domain_hostdev_pci_set_address(hostdev, address);
     g_object_unref(G_OBJECT(address));
 
+    address = gvir_config_domain_hostdev_pci_get_address(hostdev);
+    g_assert(address != NULL);
+    g_assert_cmpint(gvir_config_domain_address_pci_get_domain(address), ==, 1);
+    g_assert_cmpint(gvir_config_domain_address_pci_get_bus(address), ==, 2);
+    g_assert_cmpint(gvir_config_domain_address_pci_get_slot(address), ==, 3);
+    g_assert_cmpint(gvir_config_domain_address_pci_get_function(address), ==, 4);
+    g_object_unref(G_OBJECT(address));
+
     gvir_config_domain_add_device(domain, GVIR_CONFIG_DOMAIN_DEVICE (hostdev));
     g_object_unref(G_OBJECT(hostdev));
 
-- 
2.5.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]