Currently, there are two calls to virTestCompareToFile() inside
of testCompareXMLToConfFiles(). If the first one fails the
control jumps directly onto the fail label and skips the second
one. This means that When regenerating test case output
(VIR_TEST_REGENERATE_OUTPUT) the test binary has to be called
twice to regenerate all the files. Suboptimal. Try harder to call
both compare helpers.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
g_autofree char *pidfile = NULL;
g_autoptr(dnsmasqContext) dctx = NULL;
g_autoptr(virNetworkXMLOption) xmlopt = NULL;
+ bool compareFailed = false;
if (!(xmlopt = networkDnsmasqCreateXMLConf()))
goto fail;
#endif
if (virTestCompareToFile(confactual, outconf) < 0)
- goto fail;
+ compareFailed = true;
if (hostsfileactual) {
if (virTestCompareToFile(hostsfileactual, outhostsfile) < 0) {
- goto fail;
+ compareFailed = true;
}
} else {
if (virFileExists(outhostsfile)) {
VIR_TEST_DEBUG("%s: hostsfile exists but the configuration did not specify any host",
outhostsfile);
- goto fail;
+ compareFailed = true;
}
}
+ if (compareFailed)
+ goto fail;
+
ret = 0;
fail: