Re: [PATCH 10/10] tests: virerror: Make sure that error messages stay in correct order

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

 



On Wed, Dec 05, 2018 at 05:47:51PM +0100, Peter Krempa wrote:
> Since we don't look up the error message according to the error code but
> they have to be in the correct order in virErrorMsgStrings, we need
> to make sure that they stay in the correct order.
>
> Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
> ---
>  tests/virerrortest.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/tests/virerrortest.c b/tests/virerrortest.c
> index 0d0377bfa8..6d333f02d0 100644
> --- a/tests/virerrortest.c
> +++ b/tests/virerrortest.c
> @@ -87,6 +87,24 @@ virErrorTestMsgs(const void *opaque ATTRIBUTE_UNUSED)
>  }
>
>
> +static int
> +virErrorTestMsgOrder(const void *opaque ATTRIBUTE_UNUSED)
> +{
> +    size_t i;
> +    int ret = 0;
> +
> +    for (i = 0; i < VIR_ERR_NUMBER_LAST; i++) {
> +        if (i != virErrorMsgStrings[i].error) {

I hope coverity is smart enough not to think that ^^this is a comparison
between a signed and unsigned integer.

Reviewed-by: Erik Skultety <eskultet@xxxxxxxxxx>

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux