From 82285d5290b85d2ce4c6e5ee8dc70dd6d79827a1 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 23 Jun 2015 13:05:01 +0200 Subject: [PATCH] vircapstest: Properly report error for failed tests There are two macros used in the test: CAPSCOMP and CAPS_EXPECT_ERR. Both run a test case and if a failure occurred, they set the @ret variable to a value of -1 to indicate an error. Well, that's what they should do. Due to a typo, they set the variable to a positive one effectively masking any failed test. Then, we have couple of tests failing. Fix them too. Signed-off-by: Michal Privoznik --- tests/vircapstest.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/vircapstest.c b/tests/vircapstest.c index 0c79af8c3d..3b41654088 100644 --- a/tests/vircapstest.c +++ b/tests/vircapstest.c @@ -204,11 +204,11 @@ doCapsCompare(virCapsPtr caps, #define CAPSCOMP(o, a, d, e, m, fo, fa, fd, fe, fm) \ if (!doCapsCompare(caps, o, a, d, e, m, fo, fa, fd, fe, fm)) \ - ret = 1; + ret = -1; #define CAPS_EXPECT_ERR(o, a, d, e, m) \ if (!doCapsExpectFailure(caps, o, a, d, e, m)) \ - ret = 1; + ret = -1; #ifdef WITH_QEMU static int @@ -224,11 +224,11 @@ test_virCapsDomainDataLookupQEMU(const void *data ATTRIBUTE_UNUSED) /* Checking each parameter individually */ CAPSCOMP(-1, VIR_ARCH_NONE, -1, NULL, NULL, - VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_I686, - VIR_DOMAIN_VIRT_QEMU, "/usr/bin/qemu", "pc"); + VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_X86_64, + VIR_DOMAIN_VIRT_QEMU, "/usr/bin/qemu-system-x86_64", "pc-0.11"); CAPSCOMP(VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_NONE, -1, NULL, NULL, - VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_I686, - VIR_DOMAIN_VIRT_QEMU, "/usr/bin/qemu", "pc"); + VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_X86_64, + VIR_DOMAIN_VIRT_QEMU, "/usr/bin/qemu-system-x86_64", "pc-0.11"); CAPSCOMP(-1, VIR_ARCH_AARCH64, -1, NULL, NULL, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_AARCH64, VIR_DOMAIN_VIRT_QEMU, "/usr/bin/qemu-system-aarch64", "virt"); @@ -306,7 +306,7 @@ test_virCapsDomainDataLookupLXC(const void *data ATTRIBUTE_UNUSED) } CAPSCOMP(-1, VIR_ARCH_NONE, -1, NULL, NULL, - VIR_DOMAIN_OSTYPE_EXE, VIR_ARCH_I686, + VIR_DOMAIN_OSTYPE_EXE, VIR_ARCH_X86_64, VIR_DOMAIN_VIRT_LXC, "/usr/libexec/libvirt_lxc", NULL); CAPSCOMP(-1, VIR_ARCH_X86_64, -1, NULL, NULL, VIR_DOMAIN_OSTYPE_EXE, VIR_ARCH_X86_64,