tests: use VIR_WARNINGS_NO_DECLARATION_AFTER_STATEMENT

Some test rely too much on declaring variables in the middle
of the function. Use the macro to locally suppress the warning

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Ján Tomko
2020-08-03 17:32:22 +02:00
parent 93d8ce7f74
commit fd7644cba9
7 changed files with 18 additions and 0 deletions

View File

@@ -572,6 +572,7 @@ mymain(void)
if (virTestRun("Socket External Command /dev/does-not-exist", testSocketCommandFail, NULL) < 0)
ret = -1;
VIR_WARNINGS_NO_DECLARATION_AFTER_STATEMENT
struct testSSHData sshData1 = {
.nodename = "somehost",
.path = "/tmp/socket",
@@ -675,6 +676,7 @@ mymain(void)
"fi;"
"'''\\''/tmp/fo o/nc'\\'''' $ARG -U /tmp/socket'\n",
};
VIR_WARNINGS_RESET
if (virTestRun("SSH test 7", testSocketSSH, &sshData7) < 0)
ret = -1;