[libvirt] [PATCHv2 06/12] FIXUP: Adjust test data for Jansson

Peter Krempa pkrempa at redhat.com
Fri May 11 07:37:05 UTC 2018


On Thu, May 10, 2018 at 18:44:18 +0200, Ján Tomko wrote:
> Jansson formats empty arrays differently.
> ---
>  .../xml2json/file-backing_basic-aio_threads.json   |  9 +++-----
>  .../file-backing_basic-cache-directsync.json       |  9 +++-----
>  .../xml2json/file-backing_basic-cache-none.json    |  9 +++-----
>  .../xml2json/file-backing_basic-cache-unsafe.json  |  9 +++-----
>  .../file-backing_basic-cache-writeback.json        |  9 +++-----
>  .../file-backing_basic-cache-writethrough.json     |  9 +++-----
>  .../xml2json/file-backing_basic-detect.json        |  9 +++-----
>  .../xml2json/file-backing_basic-noopts.json        |  9 +++-----
>  .../xml2json/file-backing_basic-unmap-detect.json  |  9 +++-----
>  .../xml2json/file-backing_basic-unmap-ignore.json  |  9 +++-----
>  .../xml2json/file-backing_basic-unmap.json         |  9 +++-----
>  .../file-qcow2-backing-chain-encryption.json       |  3 +--
>  .../xml2json/file-qcow2-backing-chain-noopts.json  | 27 ++++++++--------------
>  .../file-qcow2-backing-chain-unterminated.json     |  3 +--
>  .../network-qcow2-backing-chain-cache-unsafe.json  |  3 +--
>  ...etwork-qcow2-backing-chain-encryption_auth.json |  3 +--

All of the below should be fixed by adding an explicit newline to the
code which formats the string. The output files are not valid JSON, but
a concatenation of json objects.

diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
index eae1ca8ee3..4bed82b4f5 100644
--- a/tests/qemublocktest.c
+++ b/tests/qemublocktest.c
@@ -301,6 +301,7 @@ testQemuDiskXMLToPropsValidateFile(const void *opaque)
             goto cleanup;

         virBufferAdd(&buf, jsonstr, -1);
+        virBufferAddLit(&buf, "\n");
         VIR_FREE(jsonstr);
     }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180511/50327202/attachment-0001.sig>


More information about the libvir-list mailing list