Fix a test case that was wrongly expected to fail as well. --- tests/cputest.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/cputest.c b/tests/cputest.c index 06b3f12..5b7de0f 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -273,13 +273,8 @@ cpuTestGuestData(const void *arg) guest->match = VIR_CPU_MATCH_EXACT; guest->fallback = cpu->fallback; if (cpuDecode(guest, guestData, data->models, - data->nmodels, data->preferred) < 0) { - if (data->result < 0) { - virResetLastError(); - ret = 0; - } + data->nmodels, data->preferred) < 0) goto cleanup; - } virBufferAsprintf(&buf, "%s+%s", data->host, data->name); if (data->nmodels) @@ -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; + } + } + return ret; } @@ -646,7 +654,7 @@ mymain(void) NULL, "Haswell-noTSX", 0); DO_TEST_GUESTDATA("ppc64", "host", "guest", ppc_models, NULL, 0); - DO_TEST_GUESTDATA("ppc64", "host", "guest-nofallback", ppc_models, "POWER7_v2.1", -1); + DO_TEST_GUESTDATA("ppc64", "host", "guest-nofallback", ppc_models, "POWER7_v2.1", 0); return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } -- 2.4.3 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list