[libvirt] [PATCH v2 3/4] tests: virjson: Test formatting along with parsing of JSON objects

Peter Krempa pkrempa at redhat.com
Wed Jul 19 13:23:38 UTC 2017


On Wed, Jul 19, 2017 at 08:36:27 -0400, John Ferlan wrote:
> 
> 
> On 07/11/2017 08:56 AM, Peter Krempa wrote:
> > Format the parsed string back and compare it to the original (or
> > modified) string for back and forth comparison.
> > ---
> >  tests/virjsontest.c | 58 ++++++++++++++++++++++++++++++++++++++++-------------
> >  1 file changed, 44 insertions(+), 14 deletions(-)
> > 
> 
> Is there a reason why the Copy doesn't need the space reduction? Is that
> expected (so to speak).

You mean the cases in testJSONCopy? It's because the test case parses
the JSON provided when calling the test case, then copies it and then
formats back strings from the first parsed structure and after the copy.

This means that both went through the formatter and thus have same
spacing rules applied. The output of formatting the copy is never
compared to the original string provided when calling the test case.
-------------- 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/20170719/44087344/attachment-0001.sig>


More information about the libvir-list mailing list