mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 22:45:39 +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:
@@ -81,7 +81,7 @@ diffx_same(void **state) {
|
||||
test_create("testdata/diff/zone1.data", &olddb,
|
||||
"testdata/diff/zone1.data", &newdb);
|
||||
|
||||
dns_diff_init(mctx, &diff);
|
||||
dns_diff_init(dt_mctx, &diff);
|
||||
|
||||
result = dns_db_diffx(&diff, newdb, NULL, olddb, NULL, NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
@@ -107,7 +107,7 @@ diffx_add(void **state) {
|
||||
test_create("testdata/diff/zone1.data", &olddb,
|
||||
"testdata/diff/zone2.data", &newdb);
|
||||
|
||||
dns_diff_init(mctx, &diff);
|
||||
dns_diff_init(dt_mctx, &diff);
|
||||
|
||||
result = dns_db_diffx(&diff, newdb, NULL, olddb, NULL, NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
@@ -139,7 +139,7 @@ diffx_remove(void **state) {
|
||||
test_create("testdata/diff/zone1.data", &olddb,
|
||||
"testdata/diff/zone3.data", &newdb);
|
||||
|
||||
dns_diff_init(mctx, &diff);
|
||||
dns_diff_init(dt_mctx, &diff);
|
||||
|
||||
result = dns_db_diffx(&diff, newdb, NULL, olddb, NULL, NULL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
Reference in New Issue
Block a user