diff --git a/tests/cputest.c b/tests/cputest.c index 9928e5d64e..01db8f1461 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -512,7 +512,7 @@ mymain(void) #define DO_TEST(arch, api, name, host, cpu, \ models, nmodels, preferred, result) \ do { \ - struct data data = { \ + static struct data data = { \ arch, api, host, cpu, models, \ models == NULL ? NULL : #models, \ nmodels, preferred, result \ diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 637ca50415..fdbe95ac8f 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -314,7 +314,7 @@ mymain(void) # define DO_TEST_FULL(name, migrateFrom, migrateFd, \ expectError, expectFailure, ...) \ do { \ - struct testInfo info = { \ + static struct testInfo info = { \ name, NULL, migrateFrom, migrateFd, \ expectError, expectFailure \ }; \ diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c index 8e805d8cf5..e745487db4 100644 --- a/tests/virnettlscontexttest.c +++ b/tests/virnettlscontexttest.c @@ -749,31 +749,47 @@ mymain(void) if (virFileWriteStr(keyfile, PRIVATE_KEY, 0600) < 0) return EXIT_FAILURE; -# define DO_CTX_TEST(isServer, caReq, certReq, expectFail) \ +# define DO_CTX_TEST(_isServer, _caReq, _certReq, _expectFail) \ do { \ - struct testTLSContextData data = { \ - isServer, caReq, certReq, expectFail, \ - }; \ + static struct testTLSContextData data; \ + data.isServer = _isServer; \ + data.careq = _caReq; \ + data.certreq = _certReq; \ + data.expectFail = _expectFail; \ if (virtTestRun("TLS Context", 1, testTLSContextInit, &data) < 0) \ ret = -1; \ } while (0) -# define DO_SESS_TEST(caReq, serverReq, clientReq, expectServerFail, expectClientFail, hostname, wildcards) \ +# define DO_SESS_TEST(_caReq, _serverReq, _clientReq, _expectServerFail,\ + _expectClientFail, _hostname, _wildcards) \ do { \ - struct testTLSSessionData data = { \ - caReq, { 0 }, serverReq, clientReq, \ - expectServerFail, expectClientFail, hostname, wildcards \ - }; \ + static struct testTLSSessionData data; \ + static struct testTLSCertReq other; \ + data.careq = _caReq; \ + data.othercareq = other; \ + data.serverreq = _serverReq; \ + data.clientreq = _clientReq; \ + data.expectServerFail = _expectServerFail; \ + data.expectClientFail = _expectClientFail; \ + data.hostname = _hostname; \ + data.wildcards = _wildcards; \ if (virtTestRun("TLS Session", 1, testTLSSessionInit, &data) < 0) \ ret = -1; \ } while (0) -# define DO_SESS_TEST_EXT(caReq, othercaReq, serverReq, clientReq, expectServerFail, expectClientFail, hostname, wildcards) \ +# define DO_SESS_TEST_EXT(_caReq, _othercaReq, _serverReq, _clientReq, \ + _expectServerFail, _expectClientFail, \ + _hostname, _wildcards) \ do { \ - struct testTLSSessionData data = { \ - caReq, othercaReq, serverReq, clientReq, \ - expectServerFail, expectClientFail, hostname, wildcards \ - }; \ + static struct testTLSSessionData data; \ + data.careq = _caReq; \ + data.othercareq = _othercaReq; \ + data.serverreq = _serverReq; \ + data.clientreq = _clientReq; \ + data.expectServerFail = _expectServerFail; \ + data.expectClientFail = _expectClientFail; \ + data.hostname = _hostname; \ + data.wildcards = _wildcards; \ if (virtTestRun("TLS Session", 1, testTLSSessionInit, &data) < 0) \ ret = -1; \ } while (0)