mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-11 12:25:52 +00:00
secretxml2xmltest: refactor testCompareXMLToXMLFiles
Use g_auto where possible and remove the pointless label. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
709ef46b2d
commit
ff6e806be5
@ -10,25 +10,19 @@
|
|||||||
static int
|
static int
|
||||||
testCompareXMLToXMLFiles(const char *inxml, const char *outxml)
|
testCompareXMLToXMLFiles(const char *inxml, const char *outxml)
|
||||||
{
|
{
|
||||||
char *actual = NULL;
|
g_autofree char *actual = NULL;
|
||||||
int ret = -1;
|
g_autoptr(virSecretDef) secret = NULL;
|
||||||
virSecretDef *secret = NULL;
|
|
||||||
|
|
||||||
if (!(secret = virSecretDefParseFile(inxml)))
|
if (!(secret = virSecretDefParseFile(inxml)))
|
||||||
goto fail;
|
return -1;
|
||||||
|
|
||||||
if (!(actual = virSecretDefFormat(secret)))
|
if (!(actual = virSecretDefFormat(secret)))
|
||||||
goto fail;
|
return -1;
|
||||||
|
|
||||||
if (virTestCompareToFile(actual, outxml) < 0)
|
if (virTestCompareToFile(actual, outxml) < 0)
|
||||||
goto fail;
|
return -1;
|
||||||
|
|
||||||
ret = 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
|
||||||
VIR_FREE(actual);
|
|
||||||
virSecretDefFree(secret);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct testInfo {
|
struct testInfo {
|
||||||
|
Loading…
Reference in New Issue
Block a user