[Qemu-devel] [PATCH 29/56] check-qjson: Fix and enable utf8_string()'s disabled part

Markus Armbruster posted 56 patches 7 years, 2 months ago
There is a newer version of this series
[Qemu-devel] [PATCH 29/56] check-qjson: Fix and enable utf8_string()'s disabled part
Posted by Markus Armbruster 7 years, 2 months ago
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 tests/check-qjson.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/tests/check-qjson.c b/tests/check-qjson.c
index 3d3a3f105f..c8c0ad95a6 100644
--- a/tests/check-qjson.c
+++ b/tests/check-qjson.c
@@ -750,15 +750,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, &error_abort, j);
-                g_assert_cmpstr(qstring_get_try_str(str), ==, utf8_out);
+                g_assert_cmpstr(qstring_get_try_str(str), ==, utf8_in);
             }
         }
     }
-- 
2.17.1


Re: [Qemu-devel] [PATCH 29/56] check-qjson: Fix and enable utf8_string()'s disabled part
Posted by Eric Blake 7 years, 2 months ago
On 08/08/2018 07:03 AM, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   tests/check-qjson.c | 11 +++--------
>   1 file changed, 3 insertions(+), 8 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

> diff --git a/tests/check-qjson.c b/tests/check-qjson.c
> index 3d3a3f105f..c8c0ad95a6 100644
> --- a/tests/check-qjson.c
> +++ b/tests/check-qjson.c
> @@ -750,15 +750,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, &error_abort, j);
> -                g_assert_cmpstr(qstring_get_try_str(str), ==, utf8_out);
> +                g_assert_cmpstr(qstring_get_try_str(str), ==, utf8_in);
>               }
>           }
>       }
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org