qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 1/2] utils: Tighter tests for qemu_strtosz


From: Thomas Huth
Subject: Re: [PATCH 1/2] utils: Tighter tests for qemu_strtosz
Date: Wed, 17 Mar 2021 15:59:54 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0

On 17/03/2021 15.33, Eric Blake wrote:
Our tests were not validating the return value in all cases, nor was
it guaranteeing our documented claim that 'res' is unchanged on error.
For that matter, it wasn't as thorough as the existing tests for
qemu_strtoi() and friends for proving that endptr and res are sanely
set.  Enhancing the test found one case where we violated our
documentation: namely, when failing with EINVAL when endptr is NULL,
we shouldn't modify res.

Signed-off-by: Eric Blake <eblake@redhat.com>
---
  tests/unit/test-cutils.c | 117 +++++++++++++++++++++++++++++++++++++--
  util/cutils.c            |   4 +-
  2 files changed, 114 insertions(+), 7 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>




reply via email to

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