From: Ondřej Surý Date: Thu, 31 Oct 2019 11:50:58 +0000 (-0500) Subject: libdns: add missing checks for return values in dnstap unit test X-Git-Tag: v9.15.6~36^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9acad638eb21e0ef0bd8558a196ca24c3099292;p=thirdparty%2Fbind9.git libdns: add missing checks for return values in dnstap unit test Related scan-build report: dnstap_test.c:169:2: warning: Value stored to 'result' is never read result = dns_test_makeview("test", &view); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dnstap_test.c:193:2: warning: Value stored to 'result' is never read result = dns_compress_init(&cctx, -1, dt_mctx); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 warnings generated. --- diff --git a/lib/dns/tests/dnstap_test.c b/lib/dns/tests/dnstap_test.c index da71a6c5467..963f290e71f 100644 --- a/lib/dns/tests/dnstap_test.c +++ b/lib/dns/tests/dnstap_test.c @@ -167,6 +167,7 @@ send_test(void **state) { cleanup(); result = dns_test_makeview("test", &view); + assert_int_equal(result, ISC_R_SUCCESS); fopt = fstrm_iothr_options_init(); assert_non_null(fopt); @@ -191,6 +192,7 @@ send_test(void **state) { memset(&zr, 0, sizeof(zr)); isc_buffer_init(&zb, zone, sizeof(zone)); result = dns_compress_init(&cctx, -1, dt_mctx); + assert_int_equal(result, ISC_R_SUCCESS); dns_compress_setmethods(&cctx, DNS_COMPRESS_NONE); result = dns_name_towire(zname, &cctx, &zb); assert_int_equal(result, ISC_R_SUCCESS);