Re: [libvirt] [PATCH v3] [glib 5/5] gconfig, tests: Add test case for unknown devices
On Thu, Nov 3, 2016 at 4:31 PM, Christophe Fergeauwrote: > On Thu, Nov 03, 2016 at 02:40:58PM +0100, Zeeshan Ali wrote: >> --- >> tests/test-gconfig.c| 24 >> tests/xml/gconfig-domain-device-unknown.xml | 5 + >> 2 files changed, 29 insertions(+) >> create mode 100644 tests/xml/gconfig-domain-device-unknown.xml >> >> diff --git a/tests/test-gconfig.c b/tests/test-gconfig.c >> index 5389a26..685cf97 100644 >> --- a/tests/test-gconfig.c >> +++ b/tests/test-gconfig.c >> @@ -762,6 +762,28 @@ static void test_domain_device_pci_hostdev(void) >> g_object_unref(G_OBJECT(domain)); >> } >> >> +static void test_domain_device_unknown(void) >> +{ >> +GVirConfigDomain *domain; >> +GList *devices; >> +GError *error = NULL; >> +char *xml; >> + >> +xml = load_xml("gconfig-domain-device-unknown.xml"); >> + >> +domain = gvir_config_domain_new_from_xml(xml, ); >> +g_assert_no_error(error); >> + >> +devices = gvir_config_domain_get_devices(domain); >> +g_assert_nonnull(devices); > > > + gvir_config_domain_set_devices(domain, devices); Ah yes. Fixed that (and adjusted the test xml), pushed the series. Thanks. -- Regards, Zeeshan Ali -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v3] [glib 5/5] gconfig, tests: Add test case for unknown devices
On Thu, Nov 03, 2016 at 02:40:58PM +0100, Zeeshan Ali wrote: > --- > tests/test-gconfig.c| 24 > tests/xml/gconfig-domain-device-unknown.xml | 5 + > 2 files changed, 29 insertions(+) > create mode 100644 tests/xml/gconfig-domain-device-unknown.xml > > diff --git a/tests/test-gconfig.c b/tests/test-gconfig.c > index 5389a26..685cf97 100644 > --- a/tests/test-gconfig.c > +++ b/tests/test-gconfig.c > @@ -762,6 +762,28 @@ static void test_domain_device_pci_hostdev(void) > g_object_unref(G_OBJECT(domain)); > } > > +static void test_domain_device_unknown(void) > +{ > +GVirConfigDomain *domain; > +GList *devices; > +GError *error = NULL; > +char *xml; > + > +xml = load_xml("gconfig-domain-device-unknown.xml"); > + > +domain = gvir_config_domain_new_from_xml(xml, ); > +g_assert_no_error(error); > + > +devices = gvir_config_domain_get_devices(domain); > +g_assert_nonnull(devices); + gvir_config_domain_set_devices(domain, devices); > + > +check_xml(domain, "gconfig-domain-device-unknown.xml"); > + > +g_list_free_full(devices, g_object_unref); > +g_object_unref(G_OBJECT(domain)); > +} Christophe signature.asc Description: PGP signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH v3] [glib 5/5] gconfig, tests: Add test case for unknown devices
--- tests/test-gconfig.c| 24 tests/xml/gconfig-domain-device-unknown.xml | 5 + 2 files changed, 29 insertions(+) create mode 100644 tests/xml/gconfig-domain-device-unknown.xml diff --git a/tests/test-gconfig.c b/tests/test-gconfig.c index 5389a26..685cf97 100644 --- a/tests/test-gconfig.c +++ b/tests/test-gconfig.c @@ -762,6 +762,28 @@ static void test_domain_device_pci_hostdev(void) g_object_unref(G_OBJECT(domain)); } +static void test_domain_device_unknown(void) +{ +GVirConfigDomain *domain; +GList *devices; +GError *error = NULL; +char *xml; + +xml = load_xml("gconfig-domain-device-unknown.xml"); + +domain = gvir_config_domain_new_from_xml(xml, ); +g_assert_no_error(error); + +devices = gvir_config_domain_get_devices(domain); +g_assert_nonnull(devices); + +check_xml(domain, "gconfig-domain-device-unknown.xml"); + +g_list_free_full(devices, g_object_unref); +g_object_unref(G_OBJECT(domain)); +} + + int main(int argc, char **argv) { gvir_config_init(, ); @@ -793,6 +815,8 @@ int main(int argc, char **argv) test_domain_device_usb_redir); g_test_add_func("/libvirt-gconfig/domain-device-pci-hostdev", test_domain_device_pci_hostdev); +g_test_add_func("/libvirt-gconfig/domain-device-unknown", +test_domain_device_unknown); return g_test_run(); } diff --git a/tests/xml/gconfig-domain-device-unknown.xml b/tests/xml/gconfig-domain-device-unknown.xml new file mode 100644 index 000..f326505 --- /dev/null +++ b/tests/xml/gconfig-domain-device-unknown.xml @@ -0,0 +1,5 @@ + + + + + -- 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list