qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/3] tests/libqtest: Allow to set expected exit


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 2/3] tests/libqtest: Allow to set expected exit status
Date: Tue, 27 Aug 2019 09:03:53 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 8/27/19 7:02 AM, Yury Kotov wrote:

In the subject: 'Allow to $verb' is not idiomatic; either 'Allow
$subject to $verb' or 'Allow ${verb}ing' sound better.  In this case,
I'd go with:

tests/libqtest: Allow setting expected exit status

> Add qtest_set_expected_status function to set expected exit status of
> child process. By default expected exit status is 0.
> 

> @@ -130,11 +136,12 @@ static void kill_qemu(QTestState *s)
>       * fishy and should be logged with as much detail as possible.
>       */
>      wstatus = s->wstatus;
> -    if (wstatus) {
> +    if (WEXITSTATUS(wstatus) != s->expected_status) {
>          if (WIFEXITED(wstatus)) {

Wrong ordering. WEXITSTATUS() is not reliable unless WIFEXITED() is true.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]