aboutsummaryrefslogtreecommitdiff
path: root/tests/device-introspect-test.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2018-02-24 16:40:29 +0100
committerEric Blake <eblake@redhat.com>2018-03-19 14:58:36 -0500
commit7dc847ebba953db90853d15f140c20eef74d4fb2 (patch)
treef17aad0438ed253a90674b74732917d449147f07 /tests/device-introspect-test.c
parent1a56b1e2ab5e9d6d89386ca953b4afb419e15abe (diff)
qapi: Replace qobject_to_X(o) by qobject_to(X, o)
This patch was generated using the following Coccinelle script: @@ expression Obj; @@ ( - qobject_to_qnum(Obj) + qobject_to(QNum, Obj) | - qobject_to_qstring(Obj) + qobject_to(QString, Obj) | - qobject_to_qdict(Obj) + qobject_to(QDict, Obj) | - qobject_to_qlist(Obj) + qobject_to(QList, Obj) | - qobject_to_qbool(Obj) + qobject_to(QBool, Obj) ) and a bit of manual fix-up for overly long lines and three places in tests/check-qjson.c that Coccinelle did not find. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-Id: <20180224154033.29559-4-mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [eblake: swap order from qobject_to(o, X), rebase to master, also a fix to latent false-positive compiler complaint about hw/i386/acpi-build.c] Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests/device-introspect-test.c')
-rw-r--r--tests/device-introspect-test.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/device-introspect-test.c b/tests/device-introspect-test.c
index b80058fe98..a01321aced 100644
--- a/tests/device-introspect-test.c
+++ b/tests/device-introspect-test.c
@@ -52,7 +52,7 @@ static QDict *qom_type_index(QList *types)
QListEntry *e;
QLIST_FOREACH_ENTRY(types, e) {
- QDict *d = qobject_to_qdict(qlist_entry_obj(e));
+ QDict *d = qobject_to(QDict, qlist_entry_obj(e));
const char *name = qdict_get_str(d, "name");
QINCREF(d);
qdict_put(index, name, d);
@@ -85,7 +85,7 @@ static QDict *type_list_find(QList *types, const char *name)
QListEntry *e;
QLIST_FOREACH_ENTRY(types, e) {
- QDict *d = qobject_to_qdict(qlist_entry_obj(e));
+ QDict *d = qobject_to(QDict, qlist_entry_obj(e));
const char *ename = qdict_get_str(d, "name");
if (!strcmp(ename, name)) {
return d;
@@ -151,7 +151,7 @@ static void test_qom_list_parents(const char *parent)
index = qom_type_index(types);
QLIST_FOREACH_ENTRY(types, e) {
- QDict *d = qobject_to_qdict(qlist_entry_obj(e));
+ QDict *d = qobject_to(QDict, qlist_entry_obj(e));
const char *name = qdict_get_str(d, "name");
g_assert(qom_has_parent(index, name, parent));
@@ -173,7 +173,7 @@ static void test_qom_list_fields(void)
non_abstract = qom_list_types(NULL, false);
QLIST_FOREACH_ENTRY(all_types, e) {
- QDict *d = qobject_to_qdict(qlist_entry_obj(e));
+ QDict *d = qobject_to(QDict, qlist_entry_obj(e));
const char *name = qdict_get_str(d, "name");
bool abstract = qdict_haskey(d, "abstract") ?
qdict_get_bool(d, "abstract") :
@@ -216,8 +216,8 @@ static void test_device_intro_concrete(void)
types = device_type_list(false);
QLIST_FOREACH_ENTRY(types, entry) {
- type = qdict_get_try_str(qobject_to_qdict(qlist_entry_obj(entry)),
- "name");
+ type = qdict_get_try_str(qobject_to(QDict, qlist_entry_obj(entry)),
+ "name");
g_assert(type);
test_one_device(type);
}
@@ -238,7 +238,7 @@ static void test_abstract_interfaces(void)
index = qom_type_index(all_types);
QLIST_FOREACH_ENTRY(all_types, e) {
- QDict *d = qobject_to_qdict(qlist_entry_obj(e));
+ QDict *d = qobject_to(QDict, qlist_entry_obj(e));
const char *name = qdict_get_str(d, "name");
/*