Re: [PATCH 2/9] tests: add macro for dealing with exclusive flags

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

 



On 09/09/2018 04:10 AM, Ján Tomko wrote:
> We can reject some non-sensical combinations with an error
> message, once we add flags for them.
> 
> Introduce a macro to make this easier.
> 
> Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
> ---
>  tests/qemuxml2argvtest.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
> index 04b6c00eba..b04cf7c923 100644
> --- a/tests/qemuxml2argvtest.c
> +++ b/tests/qemuxml2argvtest.c
> @@ -467,6 +467,21 @@ testCompareXMLToStartupXML(const void *data)
>  }
>  
>  
> +# define TEST_EXCLUSIVE_FLAGS(FLAG1, FLAG2) \
> +    if ((testFlags & FLAG1) && (testFlags & FLAG2)) { \
> +        VIR_TEST_DEBUG("Flags %s and %s are mutually exclusive\n", \
> +                       #FLAG1, #FLAG2); \
> +        return -1; \
> +    }
> +
> +

What's wrong with VIR_EXCLUSIVE_FLAGS_RET()?

Michal

--
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