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

[libvirt] [libvirt-glib 7/7] Add testcase for gvir_config_domain_[gs]et_custom_xml



---
 libvirt-gconfig/tests/test-domain-create.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/libvirt-gconfig/tests/test-domain-create.c b/libvirt-gconfig/tests/test-domain-create.c
index 14636e5..1610587 100644
--- a/libvirt-gconfig/tests/test-domain-create.c
+++ b/libvirt-gconfig/tests/test-domain-create.c
@@ -172,6 +172,13 @@ int main(int argc, char **argv)
     g_list_free(devices);
     devices = NULL;
 
+    gvir_config_domain_set_custom_xml(domain, "<foo/>", "ns", "http://foo";, NULL);
+    gvir_config_domain_set_custom_xml(domain, "<foo/>", "nsbar", "http://bar";, NULL);
+    gvir_config_domain_set_custom_xml(domain, "<foo/>", "ns", "http://bar";, NULL);
+    gvir_config_domain_set_custom_xml(domain, "<bar/>", "ns", "http://foo";, NULL);
+
+    g_assert(g_strcmp0(gvir_config_domain_get_custom_xml(domain, "http://foo";), "<ns:bar xmlns:ns=\"http://foo\"/>") == 0);
+    g_assert(g_strcmp0(gvir_config_domain_get_custom_xml(domain, "http://bar";), "<ns:foo xmlns:ns=\"http://bar\"/>") == 0);
 
     xml = gvir_config_object_to_xml(GVIR_CONFIG_OBJECT(domain));
     g_print("%s\n\n", xml);
-- 
1.7.7.6


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