From: Ján Tomko Date: Thu, 17 Jul 2025 16:19:44 +0000 (+0200) Subject: tests: qemuxmlconftest: Introduce testQemuConfMarkUsed X-Git-Tag: v11.8.0-rc1~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41eea2fe89eb27bb4f97dc4f698d33b85eaa10cd;p=thirdparty%2Flibvirt.git tests: qemuxmlconftest: Introduce testQemuConfMarkUsed Make the code readable enough to not need a comment. Signed-off-by: Ján Tomko Reviewed-by: Laine Stump --- diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 04710ec40e..3101f7eef4 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -598,6 +598,15 @@ testInfoCheckDuplicate(testQemuInfo *info) } +static void +testQemuConfMarkUsed(testQemuInfo *info, + const char *file) +{ + if (file) + ignore_value(g_hash_table_remove(info->conf->existingTestCases, file)); +} + + /** * testQemuConfXMLCommon: Prepare common test data (e.g. parse input XML) * for a test case. @@ -630,14 +639,10 @@ testQemuConfXMLCommon(testQemuInfo *info, if (info->prepared) goto cleanup; - /* mark test case as used */ - ignore_value(g_hash_table_remove(info->conf->existingTestCases, info->infile)); - if (info->outfile) - ignore_value(g_hash_table_remove(info->conf->existingTestCases, info->outfile)); - if (info->errfile) - ignore_value(g_hash_table_remove(info->conf->existingTestCases, info->errfile)); - if (info->out_xml_inactive) - ignore_value(g_hash_table_remove(info->conf->existingTestCases, info->out_xml_inactive)); + testQemuConfMarkUsed(info, info->infile); + testQemuConfMarkUsed(info, info->outfile); + testQemuConfMarkUsed(info, info->errfile); + testQemuConfMarkUsed(info, info->out_xml_inactive); if (testQemuInfoInitArgs((testQemuInfo *) info) < 0) goto cleanup;