From: Eric Blake Date: Sat, 17 Sep 2011 13:57:26 +0000 (-0600) Subject: virbuf: improve testsuite reporting X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ef696300e63b3b9508b016823e15f4c8296cb85a;p=libvirt.git virbuf: improve testsuite reporting 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. --- diff --git a/tests/testutils.c b/tests/testutils.c index c8136373c9..00a8d8f8d0 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -363,7 +363,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;