check WERROR types in if statements

Dimitris Gravanis dimgrav at gmail.com
Fri Aug 25 10:07:58 UTC 2017


Hi,

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?

I was wondering if I could check with a simple == operator in an if:

|if (test_err == DNS_ERR(ERROR_CODE))|

where |DNS_ERR| is defined as |WERR_DNS_ERROR_RCODE_ERROR_CODE|

Cheers,

Dimitris

-- 
Δ. Γραβάνης | D. Gravanis



More information about the samba-technical mailing list