tests: avoid compiler warnings

gcc 4.7 warns about uninitialized struct members

* tests/testutilsqemu.c (testQemuCapsInit): Populate new members.
* tests/viruritest.c (mymain): Likewise.
This commit is contained in:
Eric Blake 2012-04-05 20:04:23 -06:00
parent 06a1a45cef
commit 72505073bd
2 changed files with 22 additions and 18 deletions

View File

@ -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,

View File

@ -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);