From c9978f9dce7a768a95155a47d59911be8866fd0c Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Thu, 11 Feb 1999 04:56:56 +0000 Subject: [PATCH] allow db_type to be specified --- bin/tests/db_test.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bin/tests/db_test.c b/bin/tests/db_test.c index f9a7efe92a..348faacf43 100644 --- a/bin/tests/db_test.c +++ b/bin/tests/db_test.c @@ -88,15 +88,20 @@ main(int argc, char *argv[]) { dns_rdataset_t rdataset; isc_region_t r; char basetext[1000]; + char dbtype[128]; int ch; dns_rdatatype_t type = 2; strcpy(basetext, ""); - while ((ch = getopt(argc, argv, "z:t:")) != -1) { + strcpy(dbtype, "rbt"); + while ((ch = getopt(argc, argv, "z:d:t:")) != -1) { switch (ch) { case 'z': strcpy(basetext, optarg); break; + case 'd': + strcpy(dbtype, optarg); + break; case 't': type = atoi(optarg); break; @@ -118,9 +123,13 @@ main(int argc, char *argv[]) { makename(mctx, basetext, &base, NULL); db = NULL; - result = dns_db_create(mctx, "rbt", &base, ISC_FALSE, 1, 0, NULL, + result = dns_db_create(mctx, dbtype, &base, ISC_FALSE, 1, 0, NULL, &db); - RUNTIME_CHECK(result == DNS_R_SUCCESS); + if (result != DNS_R_SUCCESS) { + printf("dns_db_create(), DB type '%s', failed: %s\n", + dbtype, dns_result_totext(result)); + exit(1); + } origin = &base; printf("loading %s\n", argv[0]);