From a791cde7cbd97fc1088a573ddead1d1386be4416 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 5 Apr 2012 20:04:23 -0600 Subject: [PATCH] tests: avoid compiler warnings gcc 4.7 warns about uninitialized struct members * tests/testutilsqemu.c (testQemuCapsInit): Populate new members. * tests/viruritest.c (mymain): Likewise. (cherry picked from commit 72505073bdae80a056e32f762d645e6128e9ca32) --- tests/testutilsqemu.c | 6 +++++- tests/viruritest.c | 34 +++++++++++++++++----------------- 2 files changed, 22 insertions(+), 18 deletions(-) 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);