public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
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 14:47:54 +0100	[thread overview]
Message-ID: <3a551500-102b-c80e-8b4e-9ff2c498d5df@redhat.com> (raw)
In-Reply-To: <20191104130626.460261a1@p-imbrenda.boeblingen.de.ibm.com>

On 04.11.19 13:06, Claudio Imbrenda wrote:
> On Mon, 4 Nov 2019 12:55:48 +0100
> David Hildenbrand <david@redhat.com> wrote:
> 
>> 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.
>>
> 
> so, thousands of output lines for the whole test, ok
> 

A couple of things to note

a) You perform 8 checks, so report the result of 8 checks
b) We really don't care about the number of lines in a log file as long 
as we can roughly identify what went wrong (e.g., push/pop a prefix here)
c) We really *don't* need full coverage here. The same applies to other 
tests. Simply testing against the boundary conditions is good enough.


expect_pgm_int();
test_one_sccb(..., 0, ...);
check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);

expect_pgm_int();
test_one_sccb(..., 7, ...);
check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);

Just as we handle it in other tests.

-- 

Thanks,

David / dhildenb

  reply	other threads:[~2019-11-04 13:47 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
2019-11-04 12:06             ` Claudio Imbrenda
2019-11-04 13:47               ` David Hildenbrand [this message]
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=3a551500-102b-c80e-8b4e-9ff2c498d5df@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