t_master.c revision 3ddd814a97de1d152ba0913c592d6e6dc83d38a6
/*
* Copyright (C) 1998, 1999 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#include <config.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dns/rdataclass.h>
#include <dns/rdataset.h>
#define BUFLEN 255
static void t1(void);
static isc_result_t
&target);
if (result != DNS_R_SUCCESS)
return(result);
}
static int
{
int result;
int len;
int soacount;
int nscount;
else
if (isc_result != ISC_R_SUCCESS) {
return(T_UNRESOLVED);
}
if (dns_result != DNS_R_SUCCESS) {
t_info("dns_name_fromtext failed %s\n",
return(T_UNRESOLVED);
}
if (dns_result != DNS_R_SUCCESS) {
t_info("dns_rdataclass_fromtext failed %s\n",
return(T_UNRESOLVED);
}
&soacount,
&nscount,
T1_mctx);
if (dns_result == exp_result)
else {
t_info("dns_master_loadfile: got %s, expected %s\n",
}
return(result);
}
static int
test_master_x(char *filename) {
char *p;
int line;
int cnt;
int result;
line = 0;
++line;
/* skip comment lines */
continue;
/* name of data file, origin, zclass, expected result */
if (cnt == 4) {
Tokens[0],
Tokens[1],
Tokens[2],
}
else {
t_info("bad format in %s at line %d\n",
}
(void) free(p);
}
}
else {
}
return(result);
}
static char *a1 = "dns_master_loadfile loads a valid master file and "
"returns DNS_R_SUCCESS";
static void
t1() {
int result;
}
static char *a2 = "dns_master_loadfile returns DNS_R_UNEXPECTEDEND when the "
"masterfile input ends unexpectedly";
static void
t2() {
int result;
}
static char *a3 = "dns_master_loadfile returns DNS_R_NOOWNER when the "
"an ownername is not specified";
static void
t3() {
int result;
}
static char *a4 = "dns_master_loadfile returns DNS_R_NOTTL when the "
"the ttl is not specified";
static void
t4() {
int result;
}
static char *a5 = "dns_master_loadfile returns DNS_R_BADCLASS when the "
"the record class did not match the zone class";
static void
t5() {
int result;
}
static char *a6 = "dns_master_loadfile understands KEY RR specifications "
"containing key material";
static void
t6() {
int result;
}
static char *a7 = "dns_master_loadfile understands KEY RR specifications "
"containing no key material";
static void
t7() {
int result;
}
testspec_t T_testlist[] = {
{ t1, "DNS_R_SUCCESS" },
{ t2, "DNS_R_UNEXPECTEDEND" },
{ t3, "DNS_NOOWNER" },
{ t4, "DNS_NOTTL" },
{ t5, "DNS_BADCLASS" },
{ t6, "KEY RR 1" },
{ t7, "KEY RR 2" },
};