On 09/21/2011 03:14 PM, Eric Blake wrote:
+++ b/tests/qemuhelptest.c
@@ -77,8 +77,8 @@ static int testHelpStrParsing(const void *data)

if (STRNEQ(got, expected)) {
fprintf(stderr,
- "Computed flags do not match: got %s, expected %s\n",
- got, expected);
+ "%s: computed flags do not match: got %s, expected %s\n",
+ info->name, got, expected);

This addition of info->name throughout failed tests output is useful as
an independent patch, that we could push even now.

In fact, I did that split for you and pushed this:

From 42b23434b05f8e230e9a7354e773f32ba88687c7 Mon Sep 17 00:00:00 2001
From: Oskari Saarenmaa <o...@ohmu.fi>
Date: Wed, 21 Sep 2011 19:29:31 +0300
Subject: [PATCH] tests: improve test failure diagnosis

  * qemuhelptest prints test case name on failure.
---
 tests/qemuhelptest.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 4a4070a..933d556 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -77,8 +77,8 @@ static int testHelpStrParsing(const void *data)

     if (STRNEQ(got, expected)) {
         fprintf(stderr,
-                "Computed flags do not match: got %s, expected %s\n",
-                got, expected);
+                "%s: computed flags do not match: got %s, expected %s\n",
+                info->name, got, expected);

         if (getenv("VIR_TEST_DEBUG"))
             printMismatchedFlags(flags, info->flags);
@@ -87,22 +87,22 @@ static int testHelpStrParsing(const void *data)
     }

     if (version != info->version) {
- fprintf(stderr, "Parsed versions do not match: got %u, expected %u\n",
-                version, info->version);
+ fprintf(stderr, "%s: parsed versions do not match: got %u, expected %u\n",
+                info->name, version, info->version);
         goto cleanup;
     }

     if (is_kvm != info->is_kvm) {
         fprintf(stderr,
-                "Parsed is_kvm flag does not match: got %u, expected %u\n",
-                is_kvm, info->is_kvm);
+ "%s: parsed is_kvm flag does not match: got %u, expected %u\n",
+                info->name, is_kvm, info->is_kvm);
         goto cleanup;
     }

     if (kvm_version != info->kvm_version) {
         fprintf(stderr,
-                "Parsed KVM versions do not match: got %u, expected %u\n",
-                kvm_version, info->kvm_version);
+ "%s: parsed KVM versions do not match: got %u, expected %u\n",
+                info->name, kvm_version, info->kvm_version);
         goto cleanup;
     }

--
1.7.4.4



--
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to