diff --git a/bin/tests/adb_test.c b/bin/tests/adb_test.c index 34aab2f876..6d3eb17177 100644 --- a/bin/tests/adb_test.c +++ b/bin/tests/adb_test.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: adb_test.c,v 1.65 2005/04/29 00:22:37 marka Exp $ */ +/* $Id: adb_test.c,v 1.66 2005/06/23 23:49:35 marka Exp $ */ /*! \file */ @@ -27,9 +27,11 @@ #include #include +#include +#include +#include #include #include -#include #include #include @@ -48,21 +50,22 @@ struct client { dns_adbfind_t *find; }; -isc_mem_t *mctx; -isc_mempool_t *cmp; -isc_log_t *lctx; -isc_logconfig_t *lcfg; -isc_taskmgr_t *taskmgr; -isc_socketmgr_t *socketmgr; -isc_timermgr_t *timermgr; -dns_dispatchmgr_t *dispatchmgr; -isc_task_t *t1, *t2; -dns_view_t *view; -dns_db_t *rootdb; -ISC_LIST(client_t) clients; -isc_mutex_t client_lock; -isc_stdtime_t now; -dns_adb_t *adb; +static isc_mem_t *mctx = NULL; +static isc_entropy_t *ectx = NULL; +static isc_mempool_t *cmp; +static isc_log_t *lctx; +static isc_logconfig_t *lcfg; +static isc_taskmgr_t *taskmgr; +static isc_socketmgr_t *socketmgr; +static isc_timermgr_t *timermgr; +static dns_dispatchmgr_t *dispatchmgr; +static isc_task_t *t1, *t2; +static dns_view_t *view; +static dns_db_t *rootdb; +static ISC_LIST(client_t) clients; +static isc_mutex_t client_lock; +static isc_stdtime_t now; +static dns_adb_t *adb; static void check_result(isc_result_t result, const char *format, ...) @@ -260,7 +263,7 @@ lookup(const char *target) { options |= DNS_ADBFIND_HINTOK; options |= DNS_ADBFIND_GLUEOK; result = dns_adb_createfind(adb, t2, lookup_callback, client, - &client->name, dns_rootname, options, + &client->name, dns_rootname, 0, options, now, NULL, view->dstport, &client->find); #if 0 check_result(result, "dns_adb_createfind()"); @@ -301,7 +304,6 @@ main(int argc, char **argv) { /* * EVERYTHING needs a memory context. */ - mctx = NULL; RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS); cmp = NULL; @@ -309,6 +311,11 @@ main(int argc, char **argv) { == ISC_R_SUCCESS); isc_mempool_setname(cmp, "adb test clients"); + result = isc_entropy_create(mctx, &ectx); + check_result(result, "isc_entropy_create()"); + result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE); + check_result(result, "isc_hash_create()"); + result = isc_log_create(mctx, &lctx, &lcfg); check_result(result, "isc_log_create()"); isc_log_setcontext(lctx); @@ -416,6 +423,9 @@ main(int argc, char **argv) { isc_log_destroy(&lctx); + isc_hash_destroy(); + isc_entropy_detach(&ectx); + isc_mempool_destroy(&cmp); isc_mem_stats(mctx, stdout); isc_mem_destroy(&mctx); diff --git a/bin/tests/byname_test.c b/bin/tests/byname_test.c index be93ac58bf..863b25a3d3 100644 --- a/bin/tests/byname_test.c +++ b/bin/tests/byname_test.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: byname_test.c,v 1.28 2005/04/29 00:22:37 marka Exp $ */ +/* $Id: byname_test.c,v 1.29 2005/06/23 23:49:35 marka Exp $ */ /*! \file * \author @@ -29,6 +29,8 @@ #include #include +#include +#include #include #include #include @@ -44,6 +46,7 @@ #include static isc_mem_t *mctx = NULL; +static isc_entropy_t *ectx = NULL; static isc_taskmgr_t *taskmgr; static dns_view_t *view = NULL; static dns_adbfind_t *find = NULL; @@ -122,7 +125,7 @@ do_find(isc_boolean_t want_event) { dns_fixedname_init(&target); result = dns_adb_createfind(view->adb, task, adb_callback, NULL, dns_fixedname_name(&name), - dns_rootname, options, 0, + dns_rootname, 0, options, 0, dns_fixedname_name(&target), 0, &find); if (result == ISC_R_SUCCESS) { @@ -212,6 +215,10 @@ main(int argc, char *argv[]) { mctx = NULL; RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS); + RUNTIME_CHECK(isc_entropy_create(mctx, &ectx) == ISC_R_SUCCESS); + RUNTIME_CHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE) + == ISC_R_SUCCESS); + while ((ch = isc_commandline_parse(argc, argv, "d:vw:")) != -1) { switch (ch) { case 'd': @@ -356,6 +363,9 @@ main(int argc, char *argv[]) { isc_log_destroy(&lctx); + isc_hash_destroy(); + isc_entropy_detach(&ectx); + if (verbose) isc_mem_stats(mctx, stdout); isc_mem_destroy(&mctx);