diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2014-05-28 18:38:38 +0100 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2014-05-28 18:38:39 +0100 |
| commit | d7d3d6092cb7edc75dc49fb90c86dd5425ab4805 (patch) | |
| tree | ea3820e7a4e5f51bd1b7b51003546ebb70486b70 /tests/qom-test.c | |
| parent | 66226ffd056d85a6b86034dd4bbec687e66ded24 (diff) | |
| parent | de77914e50477ca4cef1e9cdd7a05b8d0c0ff1d9 (diff) | |
| download | focaccia-qemu-d7d3d6092cb7edc75dc49fb90c86dd5425ab4805.tar.gz focaccia-qemu-d7d3d6092cb7edc75dc49fb90c86dd5425ab4805.zip | |
Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging
QOM/QTest infrastructure fixes and device conversions * qom-test extension * QEMUMachineInitArgs conversion to MachineState * -machine options turned into /machine properties * Named GPIO IRQs for devices # gpg: Signature made Wed 28 May 2014 18:24:04 BST using RSA key ID 3E7E013F # gpg: Can't check signature: public key not found * remotes/afaerber/tags/qom-devices-for-peter: ssi: Name the CS GPIO qdev: Implement named GPIOs machine: Make -machine opts properties of MachineState tests: Check empty QMP output visitor qapi: Avoid output visitor crashing if it encounters a NULL value vl.c: Do not set 'type' property in obj_set_property() machine: Conversion of QEMUMachineInitArgs to MachineState qom-test: Test qom-list on link<> properties Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests/qom-test.c')
| -rw-r--r-- | tests/qom-test.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/qom-test.c b/tests/qom-test.c index 6d9a00b448..d8d1d8d9ff 100644 --- a/tests/qom-test.c +++ b/tests/qom-test.c @@ -44,7 +44,7 @@ static bool is_blacklisted(const char *arch, const char *mach) return false; } -static void test_properties(const char *path) +static void test_properties(const char *path, bool recurse) { char *child_path; QDict *response, *tuple; @@ -56,14 +56,21 @@ static void test_properties(const char *path) " 'arguments': { 'path': '%s' } }", path); g_assert(response); + if (!recurse) { + return; + } + g_assert(qdict_haskey(response, "return")); list = qobject_to_qlist(qdict_get(response, "return")); QLIST_FOREACH_ENTRY(list, entry) { tuple = qobject_to_qdict(qlist_entry_obj(entry)); - if (strstart(qdict_get_str(tuple, "type"), "child<", NULL)) { + bool is_child = strstart(qdict_get_str(tuple, "type"), "child<", NULL); + bool is_link = strstart(qdict_get_str(tuple, "type"), "link<", NULL); + + if (is_child || is_link) { child_path = g_strdup_printf("%s/%s", path, qdict_get_str(tuple, "name")); - test_properties(child_path); + test_properties(child_path, is_child); g_free(child_path); } else { const char *prop = qdict_get_str(tuple, "name"); @@ -87,7 +94,7 @@ static void test_machine(gconstpointer data) args = g_strdup_printf("-machine %s", machine); qtest_start(args); - test_properties("/machine"); + test_properties("/machine", true); response = qmp("{ 'execute': 'quit' }"); g_assert(qdict_haskey(response, "return")); |