All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v7 01/14] qapi: Use generated TestStruct machinery in tests
Date: Thu, 22 Oct 2015 17:58:13 +0200	[thread overview]
Message-ID: <87fv12uc8a.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <1445056549-7815-2-git-send-email-eblake@redhat.com> (Eric Blake's message of "Fri, 16 Oct 2015 22:35:36 -0600")

Eric Blake <eblake@redhat.com> writes:

> Commit d88f5fd and friends first introduced the various test-qmp-*
> tests in 2011, with duplicated hand-rolled TestStruct machinery,
> to make sure the qapi visitor interface was tested.  Later, commit
> 4f193e3 in 2013 added a .json file for further testing use by the
> files, but without consolidating any of the existing hand-rolled
> visitors.  And with four copies, subtle differences have crept in.

The only one between the hand-rolled copies I can see apart from
whitespace is tests/test-visitor-serialization.c passing NULL rather
than "TestStruct" to visit_start_struct().

Compared to the generated version, the hand-rolled copies neglect to
skip visiting members when !*obj.  If I remember correctly, we do that
so we can use the visitor to deallocate partly allocated stuff (worth a
comment, by the way), and that's not necessary in these tests.

> Of course, just because the visitor interface is tested does not
> mean it is a sane interface; and future patches will be changing
> some of the visitor contracts.  Rather than having to duplicate
> the cleanup work in each copy of the TestStruct visitor, and keep
> each hand-rolled copy in sync with what the generator supplies, we
> might as well just test what the generator should give us in the
> first place.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>

Patch looks good.

  reply	other threads:[~2015-10-22 15:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-17  4:35 [Qemu-devel] [PATCH v7 00/14] alternate layout (post-introspection cleanups, subset C) Eric Blake
2015-10-17  4:35 ` [Qemu-devel] [PATCH v7 01/14] qapi: Use generated TestStruct machinery in tests Eric Blake
2015-10-22 15:58   ` Markus Armbruster [this message]
2015-10-17  4:35 ` [Qemu-devel] [PATCH v7 02/14] qapi: Strengthen test of TestStructList Eric Blake
2015-10-17  4:35 ` [Qemu-devel] [PATCH v7 03/14] qapi: Provide nicer array names in introspection Eric Blake
2015-10-22 16:12   ` Markus Armbruster
2015-10-17  4:35 ` [Qemu-devel] [PATCH v7 04/14] qapi-introspect: Guarantee particular sorting Eric Blake
2015-10-17  4:35 ` [Qemu-devel] [PATCH v7 05/14] qapi: Rework collision assertions Eric Blake
2015-10-23 23:33   ` Eric Blake
2015-10-17  4:35 ` [Qemu-devel] [PATCH v7 06/14] qapi: Update tests related to QMP/branch collisions Eric Blake
2015-10-17  4:35 ` [Qemu-devel] [PATCH v7 07/14] qapi: Simplify visiting of alternate types Eric Blake
2015-10-17  4:35 ` [Qemu-devel] [PATCH v7 08/14] qapi: Fix alternates that accept 'number' but not 'int' Eric Blake
2015-10-17  4:35 ` [Qemu-devel] [PATCH v7 09/14] qapi: Remove dead visitor code Eric Blake
2015-10-17  4:35 ` [Qemu-devel] [PATCH v7 10/14] qapi: Plug leaks in test-qmp-* Eric Blake
2015-10-17  4:35 ` [Qemu-devel] [PATCH v7 11/14] qapi: Simplify error testing " Eric Blake
2015-10-17  4:35 ` [Qemu-devel] [PATCH v7 12/14] qapi: Test failure in middle of array parse Eric Blake
2015-10-17  4:35 ` [Qemu-devel] [PATCH v7 13/14] qapi: More tests of input arrays Eric Blake
2015-10-17  4:35 ` [Qemu-devel] [PATCH v7 14/14] qapi: Simplify visits of optional fields Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fv12uc8a.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.