qapi: Unit tests for visitor-based serialization
commit2d496105397b8eca905f9a53c40e2faaac7bfa6b
authorMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 22 Feb 2012 03:05:07 +0000 (21 21:05 -0600)
committerAndreas Färber <afaerber@suse.de>
Fri, 8 Jun 2012 14:11:14 +0000 (8 16:11 +0200)
treed673d90c95f09c24e6fb0f6ab6ee6014c447490f
parent4e27e819bea0ea6c8108dc7e9fa48afd6ec13c46
qapi: Unit tests for visitor-based serialization

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>
tests/Makefile
tests/test-visitor-serialization.c [new file with mode: 0644]