tests: qemuxml2argv: add testInfoClear

This is closer to the pattern of qemuxml2xml tests, and will make
things easier if we extend testInfo to contain more freeable data

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2019-03-14 05:54:00 -04:00
parent 5eaaa10679
commit f32d4e3e71

View File

@ -678,6 +678,12 @@ testInfoSetArgs(struct testInfo *info, ...)
return ret; return ret;
} }
static void
testInfoClear(struct testInfo *info)
{
virObjectUnref(info->qemuCaps);
}
# define FAKEROOTDIRTEMPLATE abs_builddir "/fakerootdir-XXXXXX" # define FAKEROOTDIRTEMPLATE abs_builddir "/fakerootdir-XXXXXX"
static int static int
@ -824,10 +830,9 @@ mymain(void)
if (virTestRun("QEMU XML-2-ARGV " _name "." arch "-" ver, \ if (virTestRun("QEMU XML-2-ARGV " _name "." arch "-" ver, \
testCompareXMLToArgv, &info) < 0) \ testCompareXMLToArgv, &info) < 0) \
ret = -1; \ ret = -1; \
virObjectUnref(info.qemuCaps); \ testInfoClear(&info); \
} while (0) } while (0)
# define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \ # define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \
DO_TEST_CAPS_INTERNAL(name, arch, ver, ARG_END) DO_TEST_CAPS_INTERNAL(name, arch, ver, ARG_END)
@ -864,7 +869,7 @@ mymain(void)
if (virTestRun("QEMU XML-2-ARGV " _name, \ if (virTestRun("QEMU XML-2-ARGV " _name, \
testCompareXMLToArgv, &info) < 0) \ testCompareXMLToArgv, &info) < 0) \
ret = -1; \ ret = -1; \
virObjectUnref(info.qemuCaps); \ testInfoClear(&info); \
} while (0) } while (0)
/* All the following macros require an explicit QEMU_CAPS_* list /* All the following macros require an explicit QEMU_CAPS_* list