name_test.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* $Id$ */
/*! \file */
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <atf-c.h>
#include <isc/commandline.h>
#include <dns/compress.h>
#include <dns/fixedname.h>
#include "dnstest.h"
/*
* Individual unit tests
*/
}
int i;
struct {
const char *name1;
const char *name2;
int order;
unsigned int nlabels;
} data[] = {
/* relative */
4, 1 },
/* absolute */
4, 2 },
};
int order = 3000;
unsigned int nlabels = 3000;
} else {
}
} else {
}
ATF_REQUIRE_EQ(order, 0);
/* Some random initializer */
order = 3001;
nlabels = 3001;
}
}
static void
{
unsigned char buf1[1024];
unsigned char buf2[1024];
&target) == ISC_R_SUCCESS);
&target) == ISC_R_SUCCESS);
&target) == ISC_R_SUCCESS);
&target) == ISC_R_SUCCESS);
}
}
unsigned int allowed;
isc_region_t r;
unsigned char plain1[] = "\003yyy\003foo";
unsigned char plain2[] = "\003bar\003yyy\003foo";
unsigned char plain3[] = "\003xxx\003bar\003foo";
unsigned char plain[] = "\003yyy\003foo\0\003bar\003yyy\003foo\0\003"
"bar\003yyy\003foo\0\003xxx\003bar\003foo";
dns_name_fromregion(&name1, &r);
dns_name_fromregion(&name2, &r);
dns_name_fromregion(&name3, &r);
/* Test 1: NONE */
dns_compress_rollback(&cctx, 0);
/* Test2: GLOBAL14 */
dns_compress_rollback(&cctx, 0);
/* Test3: ALL */
dns_compress_rollback(&cctx, 0);
/* Test4: NONE disabled */
dns_compress_rollback(&cctx, 0);
/* Test5: GLOBAL14 disabled */
dns_compress_rollback(&cctx, 0);
/* Test6: ALL disabled */
dns_compress_rollback(&cctx, 0);
dns_test_end();
}
#ifdef ISC_PLATFORM_USETHREADS
#ifdef DNS_BENCHMARK_TESTS
/*
* XXXMUKS: Don't delete this code. It is useful in benchmarking the
* name parser, but we don't require it as part of the unit test runs.
*/
"Benchmark dns_name_fromwire() implementation");
}
static void *
fromwire_thread(void *arg) {
unsigned int maxval = 32000000;
3, 'w', 'w', 'w',
7, 'e', 'x', 'a', 'm', 'p', 'l', 'e',
7, 'i', 'n', 'v', 'a', 'l', 'i', 'd',
0
};
unsigned char output_data[DNS_NAME_MAXWIRE];
unsigned int i;
/* Parse 32 million names in each thread */
for (i = 0; i < maxval; i++) {
}
return (NULL);
}
unsigned int i;
double t;
unsigned int nthreads;
for (i = 0; i < nthreads; i++) {
}
for (i = 0; i < nthreads; i++) {
}
dns_test_end();
}
#endif /* DNS_BENCHMARK_TESTS */
#endif /* ISC_PLATFORM_USETHREADS */
/*
* Main
*/
ATF_TP_ADD_TCS(tp) {
#ifdef ISC_PLATFORM_USETHREADS
#ifdef DNS_BENCHMARK_TESTS
#endif /* DNS_BENCHMARK_TESTS */
#endif /* ISC_PLATFORM_USETHREADS */
return (atf_no_error());
}