]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
libdns: add missing checks for return values in dnstap unit test
authorOndřej Surý <ondrej@sury.org>
Thu, 31 Oct 2019 11:50:58 +0000 (06:50 -0500)
committerOndřej Surý <ondrej@sury.org>
Tue, 5 Nov 2019 08:49:24 +0000 (09:49 +0100)
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.

(cherry picked from commit e9acad638eb21e0ef0bd8558a196ca24c3099292)

lib/dns/tests/dnstap_test.c

index e36d53eaac3560b527b19ee85b881820fb5d789e..93bef7267f69f3a50511db68700dc5b80d6f8ceb 100644 (file)
@@ -169,6 +169,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);
@@ -193,6 +194,7 @@ send_test(void **state) {
        memset(&zr, 0, sizeof(zr));
        isc_buffer_init(&zb, zone, sizeof(zone));
        result = dns_compress_init(&cctx, -1, 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);