From ef696300e63b3b9508b016823e15f4c8296cb85a Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Sat, 17 Sep 2011 07:57:26 -0600 Subject: [PATCH] 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. --- tests/testutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.2