summaryrefslogtreecommitdiff
path: root/tests/qemucommandutiltest.c
diff options
context:
space:
mode:
authorPeter Krempa <pkrempa@redhat.com>2016-07-22 17:19:28 +0200
committerPeter Krempa <pkrempa@redhat.com>2016-07-27 09:39:58 +0200
commitcd86d6f4656d01894141840531d61595e40e4682 (patch)
tree466c87ad0f763c356e5f2bc35e0e68cbe5cae08b /tests/qemucommandutiltest.c
parent25a272ada48302ea0d7333b4f2e3556a713230a5 (diff)
downloadlibvirt-cd86d6f4656d01894141840531d61595e40e4682.tar.gz
util: qemu: Allow nested objects in JSON -> commandline generator
Move the iterator of objects to the recursive function so that nested objects are supported by flattening the structure with '.' delimiters.
Diffstat (limited to 'tests/qemucommandutiltest.c')
-rw-r--r--tests/qemucommandutiltest.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/qemucommandutiltest.c b/tests/qemucommandutiltest.c
index 82994623b1..4872ea3bba 100644
--- a/tests/qemucommandutiltest.c
+++ b/tests/qemucommandutiltest.c
@@ -117,6 +117,14 @@ mymain(void)
"array=bleah,array=qwerty,array=1");
DO_TEST_COMMAND_OBJECT_FROM_JSON("{\"boolean\":true,\"hyphen-name\":1234,\"some_string\":\"bleah\"}",
"boolean=yes,hyphen-name=1234,some_string=bleah");
+ DO_TEST_COMMAND_OBJECT_FROM_JSON("{\"nest\": {\"boolean\":true,"
+ "\"hyphen-name\":1234,"
+ "\"some_string\":\"bleah\","
+ "\"bleah\":\"bl,eah\""
+ "}"
+ "}",
+ "nest.boolean=yes,nest.hyphen-name=1234,"
+ "nest.some_string=bleah,nest.bleah=bl,,eah");
return ret;