[libvirt-glib] Call gvir_init_config() in GVirConfig test programs

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

 



While not strictly necessary, this sets up glib logging properly on
older glib so that debug logs are not shown by default.
---
 libvirt-gconfig/tests/test-domain-create.c |    4 ++--
 libvirt-gconfig/tests/test-domain-parse.c  |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libvirt-gconfig/tests/test-domain-create.c b/libvirt-gconfig/tests/test-domain-create.c
index c42deaf..5334668 100644
--- a/libvirt-gconfig/tests/test-domain-create.c
+++ b/libvirt-gconfig/tests/test-domain-create.c
@@ -32,7 +32,7 @@
 
 const char *features[] = { "foo", "bar", "baz", NULL };
 
-int main(void)
+int main(int argc, char **argv)
 {
     GVirConfigDomain *domain;
     char *name;
@@ -40,7 +40,7 @@ int main(void)
     unsigned int i;
     char *xml;
 
-    g_type_init();
+    gvir_init_config(&argc, &argv);
 
     domain = gvir_config_domain_new();
     g_assert(domain != NULL);
diff --git a/libvirt-gconfig/tests/test-domain-parse.c b/libvirt-gconfig/tests/test-domain-parse.c
index f95e062..77b0a3b 100644
--- a/libvirt-gconfig/tests/test-domain-parse.c
+++ b/libvirt-gconfig/tests/test-domain-parse.c
@@ -39,6 +39,7 @@ int main(int argc, char **argv)
     char *xml;
     GError *error = NULL;
 
+    gvir_init_config(&argc, &argv);
     if (argc != 2) {
         g_print("Usage: %s filename\n", argv[0]);
         g_print("Attempt to parse the libvirt XML definition from filename\n");
-- 
1.7.7.5

--
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]