dbversion_test.c revision e236b52ce069b9cfc9da991e3a52538e22b177fd
/*
* Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
*
* 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 ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC 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.
*/
/* $Id: dbversion_test.c,v 1.3 2011/10/13 07:56:32 marka Exp $ */
/*! \file */
#include <config.h>
#include <atf-c.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
#include <dns/rdatasetiter.h>
#include "dnstest.h"
static void
const char *cond)
{
atf_tc_pass();
exit(0);
}
static void
setup_db() {
}
static void
close_db() {
}
dns_db_detach(&db1);
}
}
dns_db_detach(&db2);
}
}
/*
* Individual unit tests
*/
static void
dns_dbversion_t *v = NULL;
setup_db();
atf_tc_fail("dns_db_attachversion did not assert");
ATF_REQUIRE_EQ(v, v1);
ATF_REQUIRE_EQ(v, NULL);
close_db();
dns_test_end();
}
}
}
}
}
static void
setup_db();
atf_tc_fail("dns_db_closeversion did not assert");
close_db();
dns_test_end();
}
}
}
}
}
static void
setup_db();
dns_rdatatype_soa, 0, 0, NULL,
atf_tc_fail("dns_db_find did not assert");
close_db();
dns_test_end();
}
}
}
}
}
static void
setup_db();
&iterator);
atf_tc_fail("dns_db_allrdatasets did not assert");
close_db();
dns_test_end();
}
}
}
}
}
static void
setup_db();
atf_tc_fail("dns_db_findrdataset did not assert");
close_db();
dns_test_end();
}
}
}
}
}
static void
setup_db();
dns_rdatatype_soa, 0);
atf_tc_fail("dns_db_deleterdataset did not assert");
close_db();
dns_test_end();
}
}
}
}
}
static void
setup_db();
atf_tc_fail("dns_db_dns_db_subtractrdataset did not assert");
close_db();
dns_test_end();
}
}
}
atf_tc_set_md_var(tc, "descr", "check dns_db_subtractrdataset aborts with mis-matching db/version");
}
}
static void
setup_db();
fclose(f);
atf_tc_fail("dns_db_dump did not assert");
close_db();
dns_test_end();
}
}
}
}
}
static void
setup_db();
0, NULL);
atf_tc_fail("dns_db_adddataset did not assert");
close_db();
dns_test_end();
}
}
}
}
}
static void
unsigned char salt[DNS_NSEC3_SALTSIZE];
setup_db();
&salt_length);
atf_tc_fail("dns_db_dump did not assert");
close_db();
dns_test_end();
}
}
}
atf_tc_set_md_var(tc, "descr", "check dns_db_getnsec3parameters aborts with mis-matching db/version");
}
}
static void
isc_buffer_t b;
unsigned char buf[1024];
setup_db();
/*
* Create a dummy RRSIG record and set a resigning time.
*/
rrsig.originalttl = 0;
rrsig.timesigned = 0;
dns_rdatatype_rrsig, &rrsig, &b);
atf_tc_fail("dns_db_resigned did not assert");
close_db();
dns_test_end();
}
}
}
}
}
/*
* Main
*/
ATF_TP_ADD_TCS(tp) {
return (atf_no_error());
}