On 08/19/2010 10:34 AM, Gerd Hoffmann wrote:
On 08/19/10 16:04, Anthony Liguori wrote:
On 08/19/2010 07:40 AM, Gerd Hoffmann wrote:
Signed-off-by: Gerd Hoffmann<kra...@redhat.com>
This code is more or less stand alone so it's a good candidate for
having some in-tree unit tests.
I can provide some examples of how it should be done if you like, but
just something that lives in tests/ that exercises the functionality and
can be run under valgrind to verify that we aren't leaking memory.
Yea, some example would be great. Commented tests/example.c maybe?
This is one of a few that I've written:
http://repo.or.cz/w/qemu/aliguori-queue.git/blob/refs/heads/qpi:/tests/test-buffer.c
You can see the rest of the plumbing in the tree. The libcheck tests
are also pretty reasonable although to be honest I dislike libcheck. I
don't find it to offer any real value compared to just something that
succeeds silently or fails upon error.
I'm working on isolating the serial device right now to write tests
against it but decoupling it from everything else is a fair bit of
work. I'd eventually like to get to the point where all new code had
corresponding in tree unit tests.
Regards,
Anthony Liguori
thanks,
Gerd