aboutsummaryrefslogtreecommitdiff
path: root/tests/check-qjson.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-12-11 18:11:45 +0100
committerMarkus Armbruster <armbru@redhat.com>2020-12-19 10:39:16 +0100
commitb3119b08143a036e8089fb442f9d42c4920ba22c (patch)
tree4896d46e1c0689abcfcfacf717bb4f0bbc42bb16 /tests/check-qjson.c
parent808ac3657e4eb8e9fa62f57507c6d2eaa2557466 (diff)
downloadqemu-b3119b08143a036e8089fb442f9d42c4920ba22c.zip
qemu-b3119b08143a036e8089fb442f9d42c4920ba22c.tar.gz
qemu-b3119b08143a036e8089fb442f9d42c4920ba22c.tar.bz2
qobject: Drop qstring_get_try_str()
No users left outside tests/, and the ones in tests/ can just as well use qstring_get_str(). Do that, and drop the function. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201211171152.146877-14-armbru@redhat.com>
Diffstat (limited to 'tests/check-qjson.c')
-rw-r--r--tests/check-qjson.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/check-qjson.c b/tests/check-qjson.c
index 337add0..c845f91 100644
--- a/tests/check-qjson.c
+++ b/tests/check-qjson.c
@@ -89,7 +89,7 @@ static void escaped_string(void)
for (j = 0; j < 2; j++) {
if (test_cases[i].utf8_out) {
cstr = from_json_str(test_cases[i].json_in, j, &error_abort);
- g_assert_cmpstr(qstring_get_try_str(cstr),
+ g_assert_cmpstr(qstring_get_str(cstr),
==, test_cases[i].utf8_out);
if (!test_cases[i].skip) {
jstr = to_json_str(cstr);
@@ -751,7 +751,7 @@ static void utf8_string(void)
/* Parse @json_in, expect @utf8_out */
if (utf8_out) {
str = from_json_str(json_in, j, &error_abort);
- g_assert_cmpstr(qstring_get_try_str(str), ==, utf8_out);
+ g_assert_cmpstr(qstring_get_str(str), ==, utf8_out);
qobject_unref(str);
} else {
str = from_json_str(json_in, j, NULL);
@@ -782,7 +782,7 @@ static void utf8_string(void)
/* 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_in);
+ g_assert_cmpstr(qstring_get_str(str), ==, utf8_in);
qobject_unref(str);
}
}
@@ -1021,9 +1021,8 @@ static void interpolation_valid(void)
/* string */
- qstr = qobject_to(QString,
- qobject_from_jsonf_nofail("%s", value_s));
- g_assert_cmpstr(qstring_get_try_str(qstr), ==, value_s);
+ qstr = qobject_to(QString, qobject_from_jsonf_nofail("%s", value_s));
+ g_assert_cmpstr(qstring_get_str(qstr), ==, value_s);
qobject_unref(qstr);
/* object */