]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vircapstest: Properly report error for failed tests
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 23 Jun 2015 11:05:01 +0000 (13:05 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 24 Jun 2015 11:47:05 +0000 (13:47 +0200)
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 <mprivozn@redhat.com>
tests/vircapstest.c

index 0c79af8c3d140e244cefec876da34a7db92f1ec1..3b416540889d771755ceb87bddafae6c10736683 100644 (file)
@@ -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,