[PATCH 09/18] testQemuMonitorJSONqemuMonitorJSONSendKeyHoldtime: Rewrite using qemuMonitorTestAddItemVerbatim

Peter Krempa posted 18 patches 1 year, 7 months ago
[PATCH 09/18] testQemuMonitorJSONqemuMonitorJSONSendKeyHoldtime: Rewrite using qemuMonitorTestAddItemVerbatim
Posted by Peter Krempa 1 year, 7 months ago
Replace qemuMonitorTestAddItemParams by qemuMonitorTestAddItemVerbatim

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 tests/qemumonitorjsontest.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index f6b6da372c..ceb7108ac0 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -2036,14 +2036,16 @@ testQemuMonitorJSONqemuMonitorJSONSendKeyHoldtime(const void *opaque)
     if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
         return -1;

-    if (qemuMonitorTestAddItemParams(test, "send-key",
-                                     "{\"return\":{}}",
-                                     "hold-time", "31337",
-                                     "keys", "[{\"type\":\"number\",\"data\":43},"
-                                              "{\"type\":\"number\",\"data\":26},"
-                                              "{\"type\":\"number\",\"data\":46},"
-                                              "{\"type\":\"number\",\"data\":32}]",
-                                     NULL, NULL) < 0)
+    if (qemuMonitorTestAddItemVerbatim(test,
+                                       "{\"execute\":\"send-key\","
+                                       " \"arguments\":{\"keys\":[{\"type\":\"number\",\"data\":43},"
+                                       "                          {\"type\":\"number\",\"data\":26},"
+                                       "                          {\"type\":\"number\",\"data\":46},"
+                                       "                          {\"type\":\"number\",\"data\":32}],"
+                                       "                \"hold-time\":31337},"
+                                       " \"id\":\"libvirt-1\"}",
+                                       NULL,
+                                       "{ \"return\" : {}}") < 0)
         return -1;

     if (qemuMonitorJSONSendKey(qemuMonitorTestGetMonitor(test),
-- 
2.40.1
Re: [PATCH 09/18] testQemuMonitorJSONqemuMonitorJSONSendKeyHoldtime: Rewrite using qemuMonitorTestAddItemVerbatim
Posted by Ján Tomko 1 year, 6 months ago
On a Thursday in 2023, Peter Krempa wrote:
>Replace qemuMonitorTestAddItemParams by qemuMonitorTestAddItemVerbatim
>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> tests/qemumonitorjsontest.c | 18 ++++++++++--------
> 1 file changed, 10 insertions(+), 8 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano