]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: qemumonitorjson: Fix schema testing of monitor commands
authorPeter Krempa <pkrempa@redhat.com>
Thu, 12 Jul 2018 11:40:00 +0000 (13:40 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 13 Jul 2018 12:18:20 +0000 (14:18 +0200)
The 'simpleFunc' data structure is overwritten by the code generated
from the macros which initiate the tests. This means that most of the
tests would get NULL 'schema' member which means that the schema
validation would not take place.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
tests/qemumonitorjsontest.c

index fce2108932e4c1bf9f8d27b2a8e8312a13e92c43..95b718ab3744930ef56b652aa419235bf82d4287 100644 (file)
@@ -2879,7 +2879,6 @@ mymain(void)
         ret = -1;
         goto cleanup;
     }
-    simpleFunc.schema = qapiData.schema;
 
 #define DO_TEST(name) \
     if (virTestRun(# name, testQemuMonitorJSON ## name, driver.xmlopt) < 0) \
@@ -2887,7 +2886,9 @@ mymain(void)
 
 #define DO_TEST_SIMPLE(CMD, FNC, ...) \
     simpleFunc = (testQemuMonitorJSONSimpleFuncData) {.cmd = CMD, .func = FNC, \
-                                       .xmlopt = driver.xmlopt, __VA_ARGS__ }; \
+                                       .xmlopt = driver.xmlopt, \
+                                       .schema = qapiData.schema, \
+                                       __VA_ARGS__ }; \
     if (virTestRun(# FNC, testQemuMonitorJSONSimpleFunc, &simpleFunc) < 0) \
         ret = -1