]> git.proxmox.com Git - mirror_qemu.git/blobdiff - tests/check-qjson.c
migration: use migration_is_active to represent active state
[mirror_qemu.git] / tests / check-qjson.c
index cc13f3d41e0b2b1f01c621f42b56bc79ac7686e4..07a773e6530b561f2ecac7e127ccb8fd690ad740 100644 (file)
@@ -175,6 +175,11 @@ static void utf8_string(void)
             "\xCE\xBA\xE1\xBD\xB9\xCF\x83\xCE\xBC\xCE\xB5",
             "\xCE\xBA\xE1\xBD\xB9\xCF\x83\xCE\xBC\xCE\xB5",
             "\\u03BA\\u1F79\\u03C3\\u03BC\\u03B5",
+        },
+            /* '%' character when not interpolating */
+        {
+            "100%",
+            "100%",
         },
         /* 2  Boundary condition test cases */
         /* 2.1  First possible sequence of a certain length */
@@ -762,7 +767,7 @@ static void utf8_string(void)
                     if (*end == ' ') {
                         end++;
                     }
-                    in = strndup(tail, end - tail);
+                    in = g_strndup(tail, end - tail);
                     str = from_json_str(in, j, NULL);
                     g_assert(!str);
                     g_free(in);
@@ -780,6 +785,7 @@ static void utf8_string(void)
             if (!strstr(json_out, "\\uFFFD")) {
                 str = from_json_str(json_out, j, &error_abort);
                 g_assert_cmpstr(qstring_get_try_str(str), ==, utf8_in);
+                qobject_unref(str);
             }
         }
     }