summaryrefslogtreecommitdiffstats
path: root/tests/check-qjson.c
diff options
context:
space:
mode:
authorMarkus Armbruster2018-08-23 18:39:57 +0200
committerMarkus Armbruster2018-08-24 20:26:37 +0200
commitc473c379e1069079542c51f7063d44c2692abe6b (patch)
tree245d1ad33d99727ec221b0e577bbbdf950df4938 /tests/check-qjson.c
parentjson: Fix \uXXXX for surrogate pairs (diff)
downloadqemu-c473c379e1069079542c51f7063d44c2692abe6b.tar.gz
qemu-c473c379e1069079542c51f7063d44c2692abe6b.tar.xz
qemu-c473c379e1069079542c51f7063d44c2692abe6b.zip
check-qjson: Fix and enable utf8_string()'s disabled part
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20180823164025.12553-31-armbru@redhat.com>
Diffstat (limited to 'tests/check-qjson.c')
-rw-r--r--tests/check-qjson.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/check-qjson.c b/tests/check-qjson.c
index 343f8af36a..defc21fa04 100644
--- a/tests/check-qjson.c
+++ b/tests/check-qjson.c
@@ -776,15 +776,10 @@ static void utf8_string(void)
qobject_unref(str);
g_free(jstr);
- /*
- * Parse @json_out right back
- * Disabled, because qobject_from_json() is buggy, and I can't
- * be bothered to add the expected incorrect results.
- * FIXME Enable once these bugs have been fixed.
- */
- if (0 && json_out != json_in) {
+ /* Parse @json_out right back, unless it has replacements */
+ if (!strstr(json_out, "\\uFFFD")) {
str = from_json_str(json_out, j, &error_abort);
- g_assert_cmpstr(qstring_get_try_str(str), ==, utf8_out);
+ g_assert_cmpstr(qstring_get_try_str(str), ==, utf8_in);
}
}
}