From: Peter Krempa Date: Mon, 26 May 2014 14:39:38 +0000 (+0200) Subject: tests: virstoragetest: Fix output when hitting errors X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=51c439056b4bef3d704b1ae86d0a7304e4df3608;p=libvirt.git tests: virstoragetest: Fix output when hitting errors When the test is failing but the debug output isn't enabled the resulting line would look ugly like and would not contain the actual difference. TEST: virstoragetest .................chain member 1!chain member 1!chain member 1! Store the member index in the actual checked string to hide this problem --- diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index bd593b0e58..cdd4794280 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -314,6 +314,7 @@ struct testChainData static const char testStorageChainFormat[] = + "chain member: %zu\n" "store: %s\n" "backingStoreRaw: %s\n" "capacity: %lld\n" @@ -385,7 +386,7 @@ testStorageChain(const void *args) expRelDir = isAbs ? data->files[i]->relDirAbs : data->files[i]->relDirRel; if (virAsprintf(&expect, - testStorageChainFormat, + testStorageChainFormat, i, NULLSTR(data->files[i]->expBackingStore), NULLSTR(data->files[i]->expBackingStoreRaw), data->files[i]->expCapacity, @@ -396,7 +397,7 @@ testStorageChain(const void *args) data->files[i]->type, data->files[i]->format) < 0 || virAsprintf(&actual, - testStorageChainFormat, + testStorageChainFormat, i, NULLSTR(elt->backingStore ? elt->backingStore->path : NULL), NULLSTR(elt->backingStoreRaw), elt->capacity, @@ -411,7 +412,6 @@ testStorageChain(const void *args) goto cleanup; } if (STRNEQ(expect, actual)) { - fprintf(stderr, "chain member %zu", i); virtTestDifference(stderr, expect, actual); VIR_FREE(expect); VIR_FREE(actual);