summaryrefslogtreecommitdiffstats
path: root/tests/test-visitor-serialization.c
Commit message (Collapse)AuthorAgeFilesLines
* qapi: fix leak in unit testsMichael Roth2013-05-151-2/+7
| | | | | | | | | | | | | | qmp_output_get_qobject() increments the qobject's reference count. Since we currently pass this straight into qobject_to_json() so we can feed the data into a QMP input visitor, we never actually free the underlying qobject when qmp_output_visitor_cleanup() is called. This causes leaks on all of the QMP serialization tests. Fix this by holding a pointer to the qobject and decref'ing it before returning from qmp_deserialize(). Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* test-visitor-serialization: Fix some memory leaksStefan Berger2013-04-051-1/+11
| | | | | | | This patch fixes some of the memory leaks in test-visitor-serialization but not all of them. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qapi: move include files to include/qobject/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qapi: move inclusions of qemu-common.h from headers to .c filesPaolo Bonzini2012-12-191-0/+2
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qapi: Add String visitor coverage to serialization unit testsMichael Roth2012-06-081-0/+40
| | | | | Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* qapi: Unit tests for visitor-based serializationMichael Roth2012-06-081-0/+744
Currently we test our visitors individually, and seperately for input vs. output. This is useful for validating internal representations against the native C types and vice-versa, and other visitor-specific testing, but it doesn't cover the potential use-case of using visitor pairs for serialization/deserialization very well, and makes it hard to easily extend the coverage for different C types / boundary conditions. To cover that we add a set of unit tests that takes a number of native C values, passes them into an output visitor, extracts the values with an input visitor, then compares the result to the original. Plugging in new visitors to the test harness only requires a user to implement the SerializeOps interface and add it to a list. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
OpenPOWER on IntegriCloud