From: Eric Blake Date: Fri, 6 Apr 2012 02:04:23 +0000 (-0600) Subject: tests: avoid compiler warnings X-Git-Tag: v0.9.12-rc1~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72505073bdae80a056e32f762d645e6128e9ca32;p=thirdparty%2Flibvirt.git tests: avoid compiler warnings gcc 4.7 warns about uninitialized struct members * tests/testutilsqemu.c (testQemuCapsInit): Populate new members. * tests/viruritest.c (mymain): Likewise. --- diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 8e621fe0d4..8d5a3bff38 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -123,7 +123,11 @@ virCapsPtr testQemuCapsInit(void) { 1, /* threads */ ARRAY_CARDINALITY(host_cpu_features), /* nfeatures */ ARRAY_CARDINALITY(host_cpu_features), /* nfeatures_max */ - host_cpu_features /* features */ + host_cpu_features, /* features */ + 0, /* ncells */ + 0, /* ncells_max */ + NULL, /* cells */ + 0, /* cells_cpus */ }; if ((caps = virCapabilitiesNew(host_cpu.arch, diff --git a/tests/viruritest.c b/tests/viruritest.c index 4bb6a03d3d..48cbaf5704 100644 --- a/tests/viruritest.c +++ b/tests/viruritest.c @@ -161,8 +161,8 @@ mymain(void) "test", "example.com", 0, "/", query_in, NULL, NULL, params) virURIParam params[] = { - { (char*)"name", (char*)"value" }, - { NULL, NULL }, + { (char*)"name", (char*)"value", false }, + { NULL, NULL, false }, }; TEST_PARSE("test://example.com", "test", "example.com", 0, NULL, NULL, NULL, NULL, NULL); @@ -174,31 +174,31 @@ mymain(void) TEST_PARSE("test://[2001:41c8:1:4fd4::2]:123/system", "test", "2001:41c8:1:4fd4::2", 123, "/system", NULL, NULL, NULL, NULL); virURIParam params1[] = { - { (char*)"foo", (char*)"one" }, - { (char*)"bar", (char*)"two" }, - { NULL, NULL }, + { (char*)"foo", (char*)"one", false }, + { (char*)"bar", (char*)"two", false }, + { NULL, NULL, false }, }; virURIParam params2[] = { - { (char*)"foo", (char*)"one" }, - { (char*)"foo", (char*)"two" }, - { NULL, NULL }, + { (char*)"foo", (char*)"one", false }, + { (char*)"foo", (char*)"two", false }, + { NULL, NULL, false }, }; virURIParam params3[] = { - { (char*)"foo", (char*)"&one" }, - { (char*)"bar", (char*)"&two" }, - { NULL, NULL }, + { (char*)"foo", (char*)"&one", false }, + { (char*)"bar", (char*)"&two", false }, + { NULL, NULL, false }, }; virURIParam params4[] = { - { (char*)"foo", (char*)"" }, - { NULL, NULL }, + { (char*)"foo", (char*)"", false }, + { NULL, NULL, false }, }; virURIParam params5[] = { - { (char*)"foo", (char*)"one two" }, - { NULL, NULL }, + { (char*)"foo", (char*)"one two", false }, + { NULL, NULL, false }, }; virURIParam params6[] = { - { (char*)"foo", (char*)"one" }, - { NULL, NULL }, + { (char*)"foo", (char*)"one", false }, + { NULL, NULL, false }, }; TEST_PARAMS("foo=one&bar=two", "", params1);