From: David Hildenbrand <david@redhat.com>
To: Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org,
thuth@redhat.com, borntraeger@de.ibm.com, frankja@linux.ibm.com
Subject: Re: [kvm-unit-tests PATCH v2 5/5] s390x: SCLP unit test
Date: Mon, 4 Nov 2019 12:55:48 +0100 [thread overview]
Message-ID: <73d233c8-6599-ab1c-6da3-88a4fa719c82@redhat.com> (raw)
In-Reply-To: <20191104124912.7cb58664@p-imbrenda.boeblingen.de.ibm.com>
On 04.11.19 12:49, Claudio Imbrenda wrote:
> On Mon, 4 Nov 2019 12:31:32 +0100
> David Hildenbrand <david@redhat.com> wrote:
>
>> On 04.11.19 12:29, Claudio Imbrenda wrote:
>>> On Mon, 4 Nov 2019 11:58:20 +0100
>>> David Hildenbrand <david@redhat.com> wrote:
>>>
>>> [...]
>>>
>>>> Can we just please rename all "cx" into something like "len"? Or is
>>>> there a real need to have "cx" in there?
>>>
>>> if cx is such a nuisance to you, sure, I can rename it to i
>>
>> better than random characters :)
>
> will be in v3
>
>>>
>>>> Also, I still dislike "test_one_sccb". Can't we just just do
>>>> something like
>>>>
>>>> expect_pgm_int();
>>>> rc = test_one_sccb(...)
>>>> report("whatever pgm", rc == WHATEVER);
>>>> report("whatever rc", lc->pgm_int_code == WHATEVER);
>>>>
>>>> In the callers to make these tests readable and cleanup
>>>> test_one_sccb(). I don't care if that produces more LOC as long as
>>>> I can actually read and understand the test cases.
>>>
>>> if you think that makes it more readable, ok I guess...
>>>
>>> consider that the output will be unreadable, though
>>>
>>
>> I think his will turn out more readable.
>
> two output lines per SCLP call? I don't think so
To clarify, we don't always need two checks. E.g., I would like to see
instead of
+static void test_sccb_too_short(void)
+{
+ int cx;
+
+ for (cx = 0; cx < 8; cx++)
+ if (!test_one_run(valid_code, pagebuf, cx, 8, PGM_BIT_SPEC, 0))
+ break;
+
+ report("SCCB too short", cx == 8);
+}
Something like
static void test_sccb_too_short(void)
{
int i;
for (i = 0; i < 8; i++) {
expect_pgm_int();
test_one_sccb(...); // or however that will be called
check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
}
}
If possible.
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2019-11-04 11:55 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-25 17:06 [kvm-unit-tests PATCH v2 0/5] s390x: SCLP Unit test Claudio Imbrenda
2019-10-25 17:06 ` [kvm-unit-tests PATCH v2 1/5] s390x: remove redundant defines Claudio Imbrenda
2019-10-25 17:06 ` [kvm-unit-tests PATCH v2 2/5] s390x: improve error reporting for interrupts Claudio Imbrenda
2019-10-25 17:06 ` [kvm-unit-tests PATCH v2 3/5] s390x: sclp: expose ram_size and max_ram_size Claudio Imbrenda
2019-11-04 9:22 ` Janosch Frank
2019-10-25 17:06 ` [kvm-unit-tests PATCH v2 4/5] s390x: sclp: add service call instruction wrapper Claudio Imbrenda
2019-11-04 9:22 ` Janosch Frank
2019-11-04 10:06 ` David Hildenbrand
2019-10-25 17:06 ` [kvm-unit-tests PATCH v2 5/5] s390x: SCLP unit test Claudio Imbrenda
2019-11-04 9:45 ` Janosch Frank
2019-11-04 11:19 ` Claudio Imbrenda
2019-11-08 9:35 ` Thomas Huth
2019-11-08 9:46 ` Claudio Imbrenda
2019-11-04 10:58 ` David Hildenbrand
2019-11-04 11:29 ` Claudio Imbrenda
2019-11-04 11:31 ` David Hildenbrand
2019-11-04 11:49 ` Claudio Imbrenda
2019-11-04 11:55 ` David Hildenbrand [this message]
2019-11-04 12:06 ` Claudio Imbrenda
2019-11-04 13:47 ` David Hildenbrand
2019-11-04 14:24 ` Claudio Imbrenda
2019-11-04 14:29 ` David Hildenbrand
2019-11-04 10:10 ` [kvm-unit-tests PATCH v2 0/5] s390x: SCLP Unit test 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=73d233c8-6599-ab1c-6da3-88a4fa719c82@redhat.com \
--to=david@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--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