On 05/19/2016 10:52 AM, Eric Blake wrote: > Let the caller decide whether output must be strict JSON (and > raise an error on an attempt to output an encoding error or > non-finite number), vs. the status quo of relaxed (encoding > errors are rewritten to use substitute U+fffd characters, > and non-finite numbers are output). > > Adjust the testsuite to cover this: check-qobject-json checks > relaxed mode (since qobject_to_json() is unchanged in behavior), > test-qmp-output-visitor checks that QObject doesn't care about > JSON restrictions, and test-json-output-visitor is now in > strict mode and flags the errors. > > Signed-off-by: Eric Blake <[email protected]> >
> +++ b/qobject/qobject-json.c
> @@ -72,62 +72,81 @@ QObject *qobject_from_jsonf(const char *string, ...)
> return obj;
> }
>
> +typedef struct ToJson {
> +{
> + Visitor *v;
Uggh, posted the wrong version. checkpatch complained the { was on the
wrong line, so I added it in the right one and then pushed before
re-saving after deleting the duplicate one.
Actually, if this patch is worthwhile, I'm thinking that in v5, I'll
minimize some of the churn and keep the ToJsonIterState struct that I
removed in 26/28, even if it only has a single 'Visitor *v' member at
that time, rather than completely removing it there to reinstate it here.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
