Skip to content

Commit

Permalink
utils: Tighter tests for qemu_strtosz
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20210317143325.2165821-2-eblake@redhat.com>
Message-Id: <20210323165308.15244-14-alex.bennee@linaro.org>
  • Loading branch information
ebblake authored and stsquad committed Mar 24, 2021
1 parent e5b024b commit 061d790
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 7 deletions.

0 comments on commit 061d790

Please sign in to comment.