]> git.ipfire.org Git - thirdparty/qemu.git/commit
check-qjson: Fix utf8_string() to test all invalid sequences
authorMarkus Armbruster <armbru@redhat.com>
Thu, 23 Aug 2018 16:39:41 +0000 (18:39 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 24 Aug 2018 18:26:37 +0000 (20:26 +0200)
commit5f454e662e710300b4c5414b2d5fd109ee18682b
treef3f5a4340cc1b8100ccc3654cfd0dae13a1aea7e
parent32846e93047899bdde498d8c6a14d291fe6fa4e2
check-qjson: Fix utf8_string() to test all invalid sequences

Some of utf8_string()'s test_cases[] contain multiple invalid
sequences.  Testing that qobject_from_json() fails only tests we
reject at least one invalid sequence.  That's incomplete.

Additionally test each non-space sequence in isolation.

This demonstrates that the JSON parser accepts invalid sequences
starting with \xC2..\xF4.  Add a FIXME comment.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180823164025.12553-15-armbru@redhat.com>
tests/check-qjson.c