apply the modified style

This commit is contained in:
Evan Hunt
2020-02-13 14:44:37 -08:00
parent 0255a97473
commit e851ed0bb5
669 changed files with 35995 additions and 42219 deletions

View File

@@ -43,11 +43,10 @@
#define TAPSOCK "testdata/dnstap/dnstap.sock"
#define TAPSAVED "testdata/dnstap/dnstap.saved"
#define TAPTEXT "testdata/dnstap/dnstap.text"
#define TAPTEXT "testdata/dnstap/dnstap.text"
static int
_setup(void **state)
{
_setup(void **state) {
isc_result_t result;
UNUSED(state);
@@ -59,8 +58,7 @@ _setup(void **state)
}
static int
_teardown(void **state)
{
_teardown(void **state) {
UNUSED(state);
dns_test_end();
@@ -69,18 +67,16 @@ _teardown(void **state)
}
static void
cleanup()
{
cleanup() {
(void)isc_file_remove(TAPFILE);
(void)isc_file_remove(TAPSOCK);
}
/* set up dnstap environment */
static void
create_test(void **state)
{
isc_result_t result;
dns_dtenv_t * dtenv = NULL;
create_test(void **state) {
isc_result_t result;
dns_dtenv_t *dtenv = NULL;
struct fstrm_iothr_options *fopt;
UNUSED(state);
@@ -139,29 +135,28 @@ create_test(void **state)
/* send dnstap messages */
static void
send_test(void **state)
{
isc_result_t result;
dns_dtenv_t * dtenv = NULL;
dns_dthandle_t * handle = NULL;
uint8_t * data;
size_t dsize;
unsigned char zone[DNS_NAME_MAXWIRE];
unsigned char qambuffer[4096], rambuffer[4096];
unsigned char qrmbuffer[4096], rrmbuffer[4096];
isc_buffer_t zb, qamsg, ramsg, qrmsg, rrmsg;
size_t qasize, qrsize, rasize, rrsize;
dns_fixedname_t zfname;
dns_name_t * zname;
dns_dtmsgtype_t dt;
dns_view_t * view = NULL;
dns_compress_t cctx;
isc_region_t zr;
isc_sockaddr_t qaddr;
isc_sockaddr_t raddr;
struct in_addr in;
isc_stdtime_t now;
isc_time_t p, f;
send_test(void **state) {
isc_result_t result;
dns_dtenv_t *dtenv = NULL;
dns_dthandle_t *handle = NULL;
uint8_t *data;
size_t dsize;
unsigned char zone[DNS_NAME_MAXWIRE];
unsigned char qambuffer[4096], rambuffer[4096];
unsigned char qrmbuffer[4096], rrmbuffer[4096];
isc_buffer_t zb, qamsg, ramsg, qrmsg, rrmsg;
size_t qasize, qrsize, rasize, rrsize;
dns_fixedname_t zfname;
dns_name_t *zname;
dns_dtmsgtype_t dt;
dns_view_t *view = NULL;
dns_compress_t cctx;
isc_region_t zr;
isc_sockaddr_t qaddr;
isc_sockaddr_t raddr;
struct in_addr in;
isc_stdtime_t now;
isc_time_t p, f;
struct fstrm_iothr_options *fopt;
UNUSED(state);
@@ -235,7 +230,7 @@ send_test(void **state)
isc_buffer_add(&rrmsg, rrsize);
for (dt = DNS_DTTYPE_SQ; dt <= DNS_DTTYPE_TR; dt <<= 1) {
isc_buffer_t * m;
isc_buffer_t *m;
isc_sockaddr_t *q = &qaddr, *r = &raddr;
switch (dt) {
@@ -271,10 +266,10 @@ send_test(void **state)
assert_int_equal(result, ISC_R_SUCCESS);
while (dns_dt_getframe(handle, &data, &dsize) == ISC_R_SUCCESS) {
dns_dtdata_t * dtdata = NULL;
isc_region_t r;
dns_dtdata_t *dtdata = NULL;
isc_region_t r;
static dns_dtmsgtype_t expected = DNS_DTTYPE_SQ;
static int n = 0;
static int n = 0;
r.base = data;
r.length = dsize;
@@ -305,13 +300,12 @@ send_test(void **state)
/* dnstap message to text */
static void
totext_test(void **state)
{
isc_result_t result;
totext_test(void **state) {
isc_result_t result;
dns_dthandle_t *handle = NULL;
uint8_t * data;
size_t dsize;
FILE * fp = NULL;
uint8_t *data;
size_t dsize;
FILE *fp = NULL;
UNUSED(state);
@@ -324,8 +318,8 @@ totext_test(void **state)
while (dns_dt_getframe(handle, &data, &dsize) == ISC_R_SUCCESS) {
dns_dtdata_t *dtdata = NULL;
isc_buffer_t *b = NULL;
isc_region_t r;
char s[BUFSIZ], *p;
isc_region_t r;
char s[BUFSIZ], *p;
r.base = data;
r.length = dsize;
@@ -373,8 +367,7 @@ totext_test(void **state)
#endif /* HAVE_DNSTAP */
int
main(void)
{
main(void) {
#if HAVE_DNSTAP
const struct CMUnitTest tests[] = {
cmocka_unit_test_setup_teardown(create_test, _setup, _teardown),
@@ -396,8 +389,7 @@ main(void)
#include <stdio.h>
int
main(void)
{
main(void) {
printf("1..0 # Skipped: cmocka not available\n");
return (0);
}