check WERROR types in if statements

David Disseldorp ddiss at suse.de
Fri Aug 25 11:01:13 UTC 2017


Hi Dimitris,

On Fri, 25 Aug 2017 13:07:58 +0300, Dimitris Gravanis via samba-technical wrote:

> In my test for libcli/dns/cli_dns.c 
> (libcli/dns/cmocka-tests/cli_tests.c) I want to check a WERROR test_err 
> variable output for error types FORMAT_ERROR and NOTAUTH. These are 
> defined in dns_server.c and cli_dns.c.
> 
> Is there something like |W_ERROR_IS_OK| or |W_ERROR_HAVE_NO_MEMORY| for 
> other error types, a generic WERROR type maybe?

W_ERROR_EQUAL(DNS_ERR(FORMAT_ERROR), werr) and
W_ERROR_EQUAL(DNS_ERR(NOTAUTH), werr) should do what you're looking for
here.

Cheers, David



More information about the samba-technical mailing list