g_autofree char *actualargv = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
g_autoptr(virNetworkDef) def = NULL;
- int ret = -1;
char *actual;
g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();
virCommandSetDryRun(dryRunToken, &buf, true, true, testCommandDryRun, NULL);
if (!(def = virNetworkDefParseFile(xml, NULL)))
- goto cleanup;
+ return -1;
if (networkAddFirewallRules(def) < 0)
- goto cleanup;
+ return -1;
actual = actualargv = virBufferContentAndReset(&buf);
actual += strlen(baseargs);
if (virTestCompareToFileFull(actual, cmdline, false) < 0)
- goto cleanup;
+ return -1;
- ret = 0;
-
- cleanup:
- return ret;
+ return 0;
}
struct testInfo {
g_autoptr(virNetworkDef) def = NULL;
if (virTestLoadFile(updatexml, &updateXmlData) < 0)
- goto error;
+ return -1;
if (!(def = virNetworkDefParseFile(netxml, NULL)))
goto fail;
if (!expectFailure) {
if (virTestCompareToFile(actual, outxml) < 0)
- goto error;
+ return -1;
}
ret = 0;
ret = 0;
}
}
- error:
return ret;
}