From: "Radim Krčmář" <rkrcmar@redhat.com>
To: David Hildenbrand <david@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>,
kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
Christian Borntraeger <borntraeger@de.ibm.com>
Subject: Re: [PATCH v1] s390x: add stidp interception test
Date: Mon, 19 Jun 2017 19:35:28 +0200 [thread overview]
Message-ID: <20170619173528.GB10325@potion> (raw)
In-Reply-To: <fa1207fb-7a03-330d-d131-cbd5702e0b05@redhat.com>
2017-06-19 14:21+0200, David Hildenbrand:
> On 19.06.2017 12:44, Thomas Huth wrote:
> > On 19.06.2017 11:15, David Hildenbrand wrote:
> >> @@ -105,6 +105,32 @@ static void test_stap(void)
> >> + report("id.version == 0 || id.version == 0xff)",
> >
> > Superfluous parenthesis -----------------------------^
>
> Whops, yes, thanks.
This pattern could use a macro ;)
#define report(x) report(#x, x)
> >> + id.version == 0 || id.version == 0xff);
> >> + report("id.reserved == 0", !id.reserved);
> >
> > I also think you should not use C code in the text output here.
> > Not everybody who's running the kvm-unit-tests might be familiar with
> > the C language syntax. So it'd be nicer to write something like
> > "reserved bits are zero" instead of "id.reserved == 0" ?
>
> That's also what we have in s390x/selftest.c, suggested by Radim.
The main purpose is to find the place that failed in the code (any
unique string qualifies), but it is desirable to explain what is tested.
Please use a simplification in natural language if you feel that it
provides better information.
(For s390x/selftest.c, I was mainly proposing a different code structure
and unique messages. Using C-like code to describe the format of
arguments just allowed the thing to fit on one line while remaining
understandable, IMO.)
> If someone cannot read C code, that person for sure will also not be
> able to fix that bug.
Well said. The audience is expected to understand the test and the
source code of the condition looks ok here.
next prev parent reply other threads:[~2017-06-19 17:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-19 9:15 [PATCH v1] s390x: add stidp interception test David Hildenbrand
2017-06-19 10:44 ` Thomas Huth
2017-06-19 12:21 ` David Hildenbrand
2017-06-19 17:35 ` Radim Krčmář [this message]
2017-06-22 7:51 ` David Hildenbrand
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=20170619173528.GB10325@potion \
--to=rkrcmar@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=david@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=thuth@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).