testCompareDomXML2XMLFiles: add parseFlags parameter

Allow testing XML parsing with different flags.
This commit is contained in:
Ján Tomko 2016-02-25 15:17:14 +01:00
parent e4f1be7eb6
commit 1d6dcec080
6 changed files with 11 additions and 7 deletions

View File

@ -33,7 +33,7 @@ testCompareXMLToXMLHelper(const void *data)
ret = testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt, xml_in,
info->different ? xml_out : xml_in,
false,
NULL, NULL);
NULL, NULL, 0);
cleanup:
VIR_FREE(xml_in);

View File

@ -40,7 +40,7 @@ testCompareXMLToXMLHelper(const void *data)
ret = testCompareDomXML2XMLFiles(caps, xmlopt, xml_in,
info->different ? xml_out : xml_in,
!info->inactive_only,
NULL, NULL);
NULL, NULL, 0);
cleanup:
VIR_FREE(xml_in);
VIR_FREE(xml_out);

View File

@ -45,7 +45,7 @@ testCompareXMLToXMLHelper(const void *data)
ret = testCompareDomXML2XMLFiles(caps, xmlopt, xml_in,
info->different ? xml_out : xml_in,
!info->inactive_only,
NULL, NULL);
NULL, NULL, 0);
cleanup:
VIR_FREE(xml_in);
VIR_FREE(xml_out);

View File

@ -54,7 +54,7 @@ testXML2XMLActive(const void *opaque)
return testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt,
info->inName, info->outActiveName, true,
qemuXML2XMLPreFormatCallback, opaque);
qemuXML2XMLPreFormatCallback, opaque, 0);
}
@ -65,7 +65,7 @@ testXML2XMLInactive(const void *opaque)
return testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt, info->inName,
info->outInactiveName, false,
qemuXML2XMLPreFormatCallback, opaque);
qemuXML2XMLPreFormatCallback, opaque, 0);
}

View File

@ -1054,13 +1054,16 @@ int
testCompareDomXML2XMLFiles(virCapsPtr caps, virDomainXMLOptionPtr xmlopt,
const char *infile, const char *outfile, bool live,
testCompareDomXML2XMLPreFormatCallback cb,
const void *opaque)
const void *opaque, unsigned int parseFlags)
{
char *actual = NULL;
int ret = -1;
virDomainDefPtr def = NULL;
unsigned int parse_flags = live ? 0 : VIR_DOMAIN_DEF_PARSE_INACTIVE;
unsigned int format_flags = VIR_DOMAIN_DEF_FORMAT_SECURE;
parse_flags |= parseFlags;
if (!live)
format_flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE;

View File

@ -142,6 +142,7 @@ int testCompareDomXML2XMLFiles(virCapsPtr caps,
const char *outfile,
bool live,
testCompareDomXML2XMLPreFormatCallback cb,
const void *opaque);
const void *opaque,
unsigned int parseFlags);
#endif /* __VIT_TEST_UTILS_H__ */