qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 03/24] tests/test-cutils: Add missing qemu_strto


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 03/24] tests/test-cutils: Add missing qemu_strtol()... endptr checks
Date: Tue, 14 Feb 2017 14:11:18 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

On 02/14/2017 04:25 AM, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  tests/test-cutils.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/tests/test-cutils.c b/tests/test-cutils.c
> index 20b0f59..71681dc 100644
> --- a/tests/test-cutils.c
> +++ b/tests/test-cutils.c
> @@ -262,6 +262,7 @@ static void test_qemu_strtol_empty(void)
>      err = qemu_strtol(str, &endptr, 0, &res);
>  
>      g_assert_cmpint(err, ==, -EINVAL);
> +    g_assert(endptr == str);
>  }

In other words, enforce more of our contract that even on errors, endptr
is set to a documented value.

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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