t_master.c revision 5fc7ba3e1ac5d72239e9971e0f469dd5796738f9
/*
* 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/rdataset.h>
#define BUFLEN 255
static void t1(void);
static dns_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) {
if (dns_result == DNS_R_SUCCESS) {
1,
&soacount,
&nscount,
T1_mctx);
if (dns_result == exp_result)
else {
t_info("dns_master_load: got %s, expected %s\n",
}
}
else {
t_info("dns_name_fromtext failed %s\n",
}
}
else {
}
return(result);
}
static int
test_master_x(char *filename) {
char *p;
int line;
int cnt;
int result;
line = 0;
++line;
/* skip comment lines */
if ((isspace(*p)) || (*p == '#'))
continue;
/* name of data file, origin, expected result */
if (cnt == 3) {
Tokens[0],
Tokens[1],
}
else {
t_info("bad format in %s at line %d\n",
}
(void) free(p);
}
}
else {
}
return(result);
}
static char *a1 = "dns_master_load loads a valid master file and "
"returns DNS_R_SUCCESS";
static void
t1() {
int result;
}
static char *a2 = "dns_master_load returns DNS_R_UNEXPECTEDEND when the "
"masterfile input ends unexpectedly";
static void
t2() {
int result;
}
static char *a3 = "dns_master_load returns DNS_R_NOOWNER when the "
"an ownername is not specified";
static void
t3() {
int result;
}
static char *a4 = "dns_master_load returns DNS_R_NOTTL when the "
"the ttl is not specified";
static void
t4() {
int result;
}
static char *a5 = "dns_master_load returns DNS_R_BADCLASS when the "
"the record class did not match the zone class";
static void
t5() {
int result;
}
testspec_t T_testlist[] = {
{ t1, "DNS_R_SUCCESS" },
{ t2, "DNS_R_UNEXPECTEDEND" },
{ t3, "DNS_NOOWNER" },
{ t4, "DNS_NOTTL" },
{ t5, "DNS_BADCLASS" },
};