mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
Rename mctx in dnstest.c to dt_mctx to prevent any global/local name clashes
The common construct seen in the BIND 9 source is func(isc_mem_t *mctx, ...). Unfortunately, the dnstest.{h,c} has been using mctx as a global symbol, which in turn generated a lot of errors when update.c got included in update_test.c. As a rule of thumb, we should avoid naming global symbols with generic names (like mctx) and we should prefix them with "namespace" (like dt_mctx).
This commit is contained in:
@@ -72,16 +72,16 @@ dns_acl_isinsecure_test(void **state) {
|
||||
|
||||
UNUSED(state);
|
||||
|
||||
result = dns_acl_any(mctx, &any);
|
||||
result = dns_acl_any(dt_mctx, &any);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_acl_none(mctx, &none);
|
||||
result = dns_acl_none(dt_mctx, &none);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_acl_create(mctx, 1, ¬none);
|
||||
result = dns_acl_create(dt_mctx, 1, ¬none);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_acl_create(mctx, 1, ¬any);
|
||||
result = dns_acl_create(dt_mctx, 1, ¬any);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_acl_merge(notnone, none, false);
|
||||
@@ -91,7 +91,7 @@ dns_acl_isinsecure_test(void **state) {
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
#ifdef HAVE_GEOIP
|
||||
result = dns_acl_create(mctx, 1, &geoip);
|
||||
result = dns_acl_create(dt_mctx, 1, &geoip);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
de = geoip->elements;
|
||||
@@ -106,7 +106,7 @@ dns_acl_isinsecure_test(void **state) {
|
||||
de->node_num = geoip->node_count;
|
||||
geoip->length++;
|
||||
|
||||
result = dns_acl_create(mctx, 1, ¬geoip);
|
||||
result = dns_acl_create(dt_mctx, 1, ¬geoip);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_acl_merge(notgeoip, geoip, false);
|
||||
|
Reference in New Issue
Block a user