On 10/02/2013 11:09 AM, Michal Privoznik wrote:
Right now, we are testing qemuMonitorSystemPowerdown instead of
qemuMonitorJSONSystemPowerdown. It makes no harm, as both functions have
the same header and the former is just a wrapper over the latter. But we
should be consistent as we're testing the JSON functions only in here.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tests/qemumonitorjsontest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Actually, I think we should do the opposite, and test only the wrapper
functions that the rest of qemu_driver.c and friends will be calling.
For example, testQemuMonitorJSONGetVersion() calls into
qemuMonitorGetVersion, not qemuMonitorJSONGetVersion.
Besides, I can't help but wonder if we should someday switch
qemu_monitor.c into a callback struct, rather than it's current
hard-coded callouts into _text or _json, and where qemu_monitor_json.h
could be drastically reduced in size (just a few functions needed to
register the callback driver, and most of the functions listed as static
and just plug their address into the callback struct) - it would make
for less duplication work when adding support for a new QMP command.
But for that to work, the qemuMonitorJSON functions can't be called by
the testsuite.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org