
On Thu, 2015-08-06 at 11:23 +0200, Jiri Denemark wrote:
@@ -302,6 +297,19 @@ cpuTestGuestData(const void *arg) virCPUDefFree(host); virCPUDefFree(cpu); virCPUDefFree(guest); + + if (data->result < 0) { + virResetLastError(); + if (ret < 0) { + ret = 0; + } else { + VIR_TEST_VERBOSE("\n%-70s... ", + "cpuGuestData/cpuDecode was expected " + "to fail but it succeeded"); + ret = -1; + } + } +
This would apply to any failure, but when, e.g., loading the XML files or memory allocation fails, we want to fail the test even if it was expected to fail. This conditional statement should only be applied when cpuDecode or cpuGuestData fails.
Right. I have changed the code so that it can tell these two kinds of failure apart and act accordingly. Cheers. -- Andrea Bolognani Software Engineer - Virtualization Team