Re: [PATCHv2 02/13] virbuf: improve testsuite reporting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/30/2011 12:22 AM, Eric Blake wrote:
I had some temporary test failures while working on virbuf
improvements in later patches, with output that looked like:

Expected [<]
Actual [<]

which is pretty hard to figure out.  Adding an Offset designation
made it much easier to find which particular '<' was at the
wrong indentation, to fix the right part of the code.

* tests/testutils.c (virtTestDifference): Make it easier to
diagnose test failures.
I'd like to say I like this tip.
---
  tests/testutils.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/testutils.c b/tests/testutils.c
index 08db732..7eb40f0 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -359,7 +359,7 @@ int virtTestDifference(FILE *stream,
      }

      /* Show the trimmed differences */
-    fprintf(stream, "\nExpect [");
+    fprintf(stream, "\nOffset %d\nExpect [", (int) (expectStart - expect));
      if ((expectEnd - expectStart + 1)&&
          fwrite(expectStart, (expectEnd-expectStart+1), 1, stream) != 1)
          return -1;

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]