mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 07:19:59 -04:00
[v9_9] Refactor RDATA unit tests
4667. [cleanup] Refactor RDATA unit tests. [RT #45610]
(cherry picked from commit 41620b94c4)
This commit is contained in:
parent
5e64f32ce7
commit
60b55fe41c
6 changed files with 881 additions and 1777 deletions
2
CHANGES
2
CHANGES
|
|
@ -1,3 +1,5 @@
|
|||
4667. [cleanup] Refactor RDATA unit tests. [RT #45610]
|
||||
|
||||
4665. [protocol] Added support for ED25519 and ED448 DNSSEC signing
|
||||
algorithms (RFC 8080). (Note: these algorithms
|
||||
depend on code currently in the development branch
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ XTARGETS = adb_test@EXEEXT@ \
|
|||
nsecify@EXEEXT@ \
|
||||
ratelimiter_test@EXEEXT@ \
|
||||
rbt_test@EXEEXT@ \
|
||||
rdata_test@EXEEXT@ \
|
||||
rwlock_test@EXEEXT@ \
|
||||
serial_test@EXEEXT@ \
|
||||
shutdown_test@EXEEXT@ \
|
||||
|
|
@ -120,7 +119,6 @@ XSRCS = adb_test.c \
|
|||
nsecify.c \
|
||||
ratelimiter_test.c \
|
||||
rbt_test.c \
|
||||
rdata_test.c \
|
||||
rwlock_test.c \
|
||||
serial_test.c \
|
||||
shutdown_test.c \
|
||||
|
|
@ -238,10 +236,6 @@ rbt_test@EXEEXT@: rbt_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
|
|||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ rbt_test.@O@ \
|
||||
${DNSLIBS} ${ISCLIBS} ${LIBS}
|
||||
|
||||
rdata_test@EXEEXT@: rdata_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ rdata_test.@O@ \
|
||||
${DNSLIBS} ${ISCLIBS} ${LIBS}
|
||||
|
||||
rwlock_test@EXEEXT@: rwlock_test.@O@ ${ISCDEPLIBS}
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ rwlock_test.@O@ \
|
||||
${ISCLIBS} ${LIBS}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <atf-c.h>
|
||||
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
|
@ -27,6 +29,7 @@
|
|||
#include <isc/buffer.h>
|
||||
#include <isc/entropy.h>
|
||||
#include <isc/hash.h>
|
||||
#include <isc/hex.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/os.h>
|
||||
#include <isc/string.h>
|
||||
|
|
@ -326,3 +329,26 @@ dns_test_loaddb(dns_db_t **db, dns_dbtype_t dbtype, const char *origin,
|
|||
result = dns_db_load(*db, testfile);
|
||||
return (result);
|
||||
}
|
||||
|
||||
/*
|
||||
* Format contents of given memory region as a hex string, using the buffer
|
||||
* of length 'buflen' pointed to by 'buf'. 'buflen' must be at least three
|
||||
* times 'len'. Always returns 'buf'.
|
||||
*/
|
||||
char *
|
||||
dns_test_tohex(const unsigned char *data, size_t len, char *buf, size_t buflen)
|
||||
{
|
||||
isc_constregion_t source = {
|
||||
.base = data,
|
||||
.length = len
|
||||
};
|
||||
isc_buffer_t target;
|
||||
isc_result_t result;
|
||||
|
||||
memset(buf, 0, buflen);
|
||||
isc_buffer_init(&target, buf, buflen);
|
||||
result = isc_hex_totext((isc_region_t *)&source, 1, " ", &target);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
return (buf);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,8 +14,6 @@
|
|||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <config.h>
|
||||
|
|
@ -80,3 +78,6 @@ dns_test_nap(isc_uint32_t usec);
|
|||
isc_result_t
|
||||
dns_test_loaddb(dns_db_t **db, dns_dbtype_t dbtype, const char *origin,
|
||||
const char *testfile);
|
||||
|
||||
char *
|
||||
dns_test_tohex(const unsigned char *data, size_t len, char *buf, size_t buflen);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue