migrate t_names to lib/dns/tests/name_test

This commit is contained in:
Evan Hunt 2018-02-28 16:51:23 -08:00
parent 109546cbda
commit 8ecf69ef7b
45 changed files with 343 additions and 3176 deletions

View file

@ -7,7 +7,6 @@ sdig
t_db
gsstest
t_dst
t_names
conf.sh
dlopen
keycreate

View file

@ -32,7 +32,7 @@ ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
LIBS = @LIBS@
SUBDIR = db dst names system @PKCS11_TOOLS@ optional
SUBDIR = db dst system @PKCS11_TOOLS@ optional
TESTDIRS = system

View file

@ -1,50 +0,0 @@
# Copyright (C) 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/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${TEST_INCLUDES} ${DNS_INCLUDES} ${ISC_INCLUDES}
CDEFINES =
CWARNINGS =
# Note that we do not want to use libtool for libt_api
DNSLIBS = ../../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
ISCLIBS = ../../../lib/isc/libisc.@A@ @ISC_OPENSSL_LIBS@
DNSDEPLIBS = ../../../lib/dns/libdns.@A@
ISCDEPLIBS = ../../../lib/isc/libisc.@A@
DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS}
LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@
TLIB = ../../../lib/tests/libt_api.@A@
TARGETS = t_names@EXEEXT@
SRCS = t_names.c
@BIND9_MAKE_RULES@
t_names@EXEEXT@: t_names.@O@ ${DEPLIBS} ${TLIB}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ t_names.@O@ ${TLIB} ${LIBS}
test: t_names@EXEEXT@
-@./t_names@EXEEXT@ -c @top_srcdir@/t_config -b @srcdir@ -a
testhelp:
@./t_names@EXEEXT@ -h
clean distclean::
rm -f ${TARGETS}

View file

@ -1,11 +0,0 @@
#
# test data for dns_name_compare
# format:
# <name1> <tab> <name2> <tab> <exp_order>
# where: exp_order may be one of: -1, 0, 1
#
# and where: exp_nlabels and exp_nbits are not tested if < 0
#
c.d a.b.c.d -1
a.b.c.d c.d 1
a.b.c a.b.c 0

View file

@ -1,10 +0,0 @@
#
# test data for dns_name_countlabels
# format:
# <name> <tab> <nlabels>
#
c.d 2
c.d. 3
a.b.c.d 4
a.b.c 3
. 1

View file

@ -1,12 +0,0 @@
#
# test data for dns_name_fromregion
# format:
# <test_name>
# where: exp_order may be one of: -1, 0, 1
#
# and where: exp_nlabels and exp_nbits are not tested if < 0
#
a.b.c.d.
a.b.c.d.[A].[aaa.
Ba\x\aa.b.c\[\[o\\.Z
Ba\x\aa.b.c\[\[o\\\..\.Z

View file

@ -1,9 +0,0 @@
#
# test data for dns_name_fromtext
# format:
# <name1> <tab> <name2> <tab> <origin> <tab> <downcase>
#
a.b a.b.c.d C.d 1
a.b a.b.c.d C.d 1
a.b a.b.C.d C.d 0
a.b. a.b. C.d 0

View file

@ -1,30 +0,0 @@
#
# test data for dns_name_fromwire_1
# format:
# <msgfile> <testname_offset> <downcase>
# <dc_method> <exp_name> <exp_result>
#
# where msgfile contains a DNS message in hex form
#
# and where testname_offset is the byte offset in this message of
# the start of a name
#
# and where downcase is 1 or 0
#
# and where dc_method is one of
# DNS_COMPRESS_ALL
# DNS_COMPRESS_GLOBAL14
# DNS_COMPRESS_NONE
#
# and where exp_name is the expected name after any decompression
# or case conversion
#
# and where exp_result may be one of
# ISC_R_NOSPACE
# DNS_R_BADLABELTYPE
# DNS_R_DISALLOWED
# DNS_R_BADPOINTER
# ISC_R_UNEXPECTEDEND
# DNS_R_TOOMANYHOPS
#
wire_test1.data 25 1 DNS_COMPRESS_ALL vix.com. ISC_R_SUCCESS

View file

@ -1,30 +0,0 @@
#
# test data for dns_name_fromwire_2
# format:
# <msgfile> <testname_offset> <downcase>
# <dc_method> <exp_name> <exp_result>
#
# where msgfile contains a DNS message in hex form
#
# and where testname_offset is the byte offset in this message of
# the start of a name
#
# and where downcase is 1 or 0
#
# and where dc_method is one of
# DNS_COMPRESS_ALL
# DNS_COMPRESS_GLOBAL14
# DNS_COMPRESS_NONE
#
# and where exp_name is the expected name after any decompression
# or case conversion
#
# and where exp_result may be one of
# ISC_R_NOSPACE
# DNS_R_BADLABELTYPE
# DNS_R_DISALLOWED
# DNS_R_BADPOINTER
# ISC_R_UNEXPECTEDEND
# DNS_R_TOOMANYHOPS
#
wire_test2.data 25 1 DNS_COMPRESS_ALL vix.com. ISC_R_NOSPACE

View file

@ -1,31 +0,0 @@
#
# test data for dns_name_fromwire_3
# format:
# <msgfile> <testname_offset> <downcase>
# <dc_method> <exp_name> <exp_result>
#
# where msgfile contains a DNS message in hex form
#
# and where testname_offset is the byte offset in this message of
# the start of a name
#
# and where downcase is 1 or 0
#
# and where dc_method is one of
# DNS_COMPRESS_ALL
# DNS_COMPRESS_GLOBAL14
# DNS_COMPRESS_NONE
#
# and where exp_name is the expected name after any decompression
# or case conversion
#
# and where exp_result may be one of
# ISC_R_NOSPACE
# DNS_R_BADLABELTYPE
# DNS_R_DISALLOWED
# DNS_R_BADPOINTER
# ISC_R_UNEXPECTEDEND
# DNS_R_TOOMANYHOPS
#
wire_test3_1.data 25 1 DNS_COMPRESS_ALL vix.com. DNS_R_BADLABELTYPE
wire_test3_2.data 25 1 DNS_COMPRESS_ALL vix.com. DNS_R_BADLABELTYPE

View file

@ -1,30 +0,0 @@
#
# test data for dns_name_fromwire_4
# format:
# <msgfile> <testname_offset> <downcase>
# <dc_method> <exp_name> <exp_result>
#
# where msgfile contains a DNS message in hex form
#
# and where testname_offset is the byte offset in this message of
# the start of a name
#
# and where downcase is 1 or 0
#
# and where dc_method is one of
# DNS_COMPRESS_ALL
# DNS_COMPRESS_GLOBAL14
# DNS_COMPRESS_NONE
#
# and where exp_name is the expected name after any decompression
# or case conversion
#
# and where exp_result may be one of
# ISC_R_NOSPACE
# DNS_R_BADLABELTYPE
# DNS_R_DISALLOWED
# DNS_R_BADPOINTER
# ISC_R_UNEXPECTEDEND
# DNS_R_TOOMANYHOPS
#
wire_test4.data 550 1 DNS_COMPRESS_ALL vix.com. DNS_R_NAMETOOLONG

View file

@ -1,30 +0,0 @@
#
# test data for dns_name_fromwire_5
# format:
# <msgfile> <testname_offset> <downcase>
# <dc_method> <exp_name> <exp_result>
#
# where msgfile contains a DNS message in hex form
#
# and where testname_offset is the byte offset in this message of
# the start of a name
#
# and where downcase is 1 or 0
#
# and where dc_method is one of
# DNS_COMPRESS_ALL
# DNS_COMPRESS_GLOBAL14
# DNS_COMPRESS_NONE
#
# and where exp_name is the expected name after any decompression
# or case conversion
#
# and where exp_result may be one of
# ISC_R_NOSPACE
# DNS_R_BADLABELTYPE
# DNS_R_DISALLOWED
# DNS_R_BADPOINTER
# ISC_R_UNEXPECTEDEND
# DNS_R_TOOMANYHOPS
#
wire_test5.data 25 1 DNS_COMPRESS_NONE vix.com. DNS_R_DISALLOWED

View file

@ -1,30 +0,0 @@
#
# test data for dns_name_fromwire_6
# format:
# <msgfile> <testname_offset> <downcase>
# <dc_method> <exp_name> <exp_result>
#
# where msgfile contains a DNS message in hex form
#
# and where testname_offset is the byte offset in this message of
# the start of a name
#
# and where downcase is 1 or 0
#
# and where dc_method is one of
# DNS_COMPRESS_ALL
# DNS_COMPRESS_GLOBAL14
# DNS_COMPRESS_NONE
#
# and where exp_name is the expected name after any decompression
# or case conversion
#
# and where exp_result may be one of
# ISC_R_NOSPACE
# DNS_R_BADLABELTYPE
# DNS_R_DISALLOWED
# DNS_R_BADPOINTER
# ISC_R_UNEXPECTEDEND
# DNS_R_TOOMANYHOPS
#
wire_test6.data 25 1 DNS_COMPRESS_ALL vix.com. DNS_R_BADPOINTER

View file

@ -1,30 +0,0 @@
#
# test data for dns_name_fromwire_7
# format:
# <msgfile> <testname_offset> <downcase>
# <dc_method> <exp_name> <exp_result>
#
# where msgfile contains a DNS message in hex form
#
# and where testname_offset is the byte offset in this message of
# the start of a name
#
# and where downcase is 1 or 0
#
# and where dc_method is one of
# DNS_COMPRESS_ALL
# DNS_COMPRESS_GLOBAL14
# DNS_COMPRESS_NONE
#
# and where exp_name is the expected name after any decompression
# or case conversion
#
# and where exp_result may be one of
# ISC_R_NOSPACE
# DNS_R_BADLABELTYPE
# DNS_R_DISALLOWED
# DNS_R_BADPOINTER
# ISC_R_UNEXPECTEDEND
# DNS_R_TOOMANYHOPS
#
wire_test7.data 25 1 DNS_COMPRESS_ALL vix.com. ISC_R_UNEXPECTEDEND

View file

@ -1,30 +0,0 @@
#
# test data for dns_name_fromwire_9
# format:
# <msgfile> <testname_offset> <downcase>
# <dc_method> <exp_name> <exp_result>
#
# where msgfile contains a DNS message in hex form
#
# and where testname_offset is the byte offset in this message of
# the start of a name
#
# and where downcase is 1 or 0
#
# and where dc_method is one of
# DNS_COMPRESS_ALL
# DNS_COMPRESS_GLOBAL14
# DNS_COMPRESS_NONE
#
# and where exp_name is the expected name after any decompression
# or case conversion
#
# and where exp_result may be one of
# ISC_R_NOSPACE
# DNS_R_BADLABELTYPE
# DNS_R_DISALLOWED
# DNS_R_BADPOINTER
# ISC_R_UNEXPECTEDEND
# DNS_R_TOOMANYHOPS
#
wire_test8.data 25 1 DNS_COMPRESS_ALL vix.com. ISC_R_NOSPACE

View file

@ -1,10 +0,0 @@
#
# test data for dns_name_fullcompare
# format:
# <name1> <tab> <name2> <tab> <exp_reln> <tab> <exp_order> <tab> <exp_nlabels> <tab> <exp_nbits>
# where: exp_reln may be one of:
# none, equal, contains, subdomain, commonancestor
# and where: exp_nlabels and exp_nbits are not tested if < 0
#
c.d a.b.c.d contains -1 2 0
a.b.c.d c.d subdomain 1 2 0

View file

@ -1,10 +0,0 @@
#
# test data for dns_name_compare
# format:
# <name1> <tab> <label1_pos> <tab> <name2> <tab> <label2_pos>
# where: label1_pos and label2_pos identify the label position of
# the common label shared by name1 and name2 respectively
#
c.d 1 a.b.c.d 3
a.b.c.d 3 c.d 1
a.b.c. 3 a.b.c. 3

View file

@ -1,9 +0,0 @@
#
# test data for dns_name_getlabelsequence
# format:
# <name1> <tab> <label1_start> <tab> <name2> <tab> <label2_start> <tab> <extent>
#
#
c.d 1 a.b.c.d 3 1
a.b.c.d.e 2 c.d 0 2
a.b.c 0 a.b.c 0 3

View file

@ -1,12 +0,0 @@
#
# test data for dns_name_hash
# format:
# <testname1> <tab> <testname2> <tab> <cshm> <tab> <cishm>
# where:
# cshm is 0 if a case sensitive hash of testname1 should match a
# case sensitive hash of testname2, otherwise cshm != 0
# and:
# cishm is 0 if a case insensitive hash of testname1 should match a
# case insensitive hash of testname2, otherwise cishm != 0
#
a.b.c.d A.B.C.D 0 1

View file

@ -1,8 +0,0 @@
#
# test data for dns_name_isabsolute
# format is:
# <testname> <tab> <expected value>
#
x. 1
a.b.c.d 0
x.z. 1

View file

@ -1,11 +0,0 @@
#
# test data for dns_name_issubdomain
# format:
# <name1> <tab> <name2> <tab> <issubdomain>
# where: issubdomain is 0 if false, else non-zero
#
# and where: exp_nlabels and exp_nbits are not tested if < 0
#
c.d a.b.c.d 0
a.b.c.d c.d 1
a.b.c. a.b.c. 1

View file

@ -1,11 +0,0 @@
#
# test data for dns_name_rdatacompare
# format:
# <name1> <tab> <name2> <tab> <exp_order>
# where: exp_order may be one of: -1, 0, 1
#
# and where: exp_nlabels and exp_nbits are not tested if < 0
#
c.d. a.b.c.d. 1
a.b.c.d. c.d. -1
a.b.c. a.b.c. 0

View file

@ -1,8 +0,0 @@
#
# test data for dns_name_toregion
# format:
# <test_name>
#
a.b.c.d.
a.b.c.d.[A].[aaa.
Ba\x\aa.b.c\[\[o\\.Z

View file

@ -1,9 +0,0 @@
#
# test data for dns_name_totext
# format:
# <name1> <tab> <omit_final_dot>
#
a.b.c.d 1
a.\\[\[.c.d 1
a.b.C.d 0
a.b. 0

View file

@ -1,17 +0,0 @@
# test data for dns_name_towire_1
# format:
# <testname> <dc_method> <exp_data>
# <exp_data_len> <exp_result>
#
# where testname is the test name to be converted to wire format
#
# and where dc_method is one of
# DNS_COMPRESS_ALL
# DNS_COMPRESS_GLOBAL14
# DNS_COMPRESS_NONE
#
# and where exp_data is the expected wire format data in hex format
# and where exp_data_len is the length of the expected data in decimal format
# and where exp_result is the expected return value of dns_name_towire
#
a.vix.com. DNS_COMPRESS_NONE 01610376697803636f6d00 11 ISC_R_SUCCESS

View file

@ -1,17 +0,0 @@
# test data for dns_name_towire_1
# format:
# <testname> <dc_method> <exp_data>
# <exp_data_len> <exp_result>
#
# where testname is the test name to be converted to wire format
#
# and where dc_method is one of
# DNS_COMPRESS_ALL
# DNS_COMPRESS_GLOBAL14
# DNS_COMPRESS_NONE
#
# and where exp_data is the expected wire format data in hex format
# and where exp_data_len is the length of the expected data in decimal format
# and where exp_result is the expected return value of dns_name_towire
#
a.vix.com DNS_COMPRESS_NONE 01610376697803636f6d 10 ISC_R_NOSPACE

File diff suppressed because it is too large Load diff

View file

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\t_names.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View file

@ -1,110 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{124DC0D3-3096-41D2-B490-CE85E890FF33}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>t_names</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<AdditionalIncludeDirectories>.\;..\..\..\..\;@LIBXML2_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\dns\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\dns\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@LIBXML2_LIB@libisc.lib;libdns.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalIncludeDirectories>.\;..\..\..\..\;@LIBXML2_INC@..\..\..\..\lib\isc\win32;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;..\..\..\..\lib\dns\include;..\..\..\..\lib\tests\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>..\..\..\..\lib\isc\win32\$(Configuration);..\..\..\..\lib\dns\win32\$(Configuration);..\..\..\..\lib\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@LIBXML2_LIB@libisc.lib;libdns.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\t_names.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View file

@ -1,13 +0,0 @@
#
# a global14 compression pointer
#
000a85800001000300000003
0376697803636f6d0000020001c00c00
02000100000e10000b05697372763102
7061c00cc00c0002000100000e100009
066e732d657874c00cc00c0002000100
000e10000e036e733104676e61630363
6f6d00c0250001000100000e100004cc
98b886c03c0001000100000e100004cc
98b840c051000100010002a14a0004c6
97f8f6

View file

@ -1,13 +0,0 @@
#
# a global14 compression pointer
#
000a85800001000300000003
8376697803636f6d0000020001c00c00
02000100000e10000b05697372763102
7061c00cc00c0002000100000e100009
066e732d657874c00cc00c0002000100
000e10000e036e733104676e61630363
6f6d00c0250001000100000e100004cc
98b886c03c0001000100000e100004cc
98b840c051000100010002a14a0004c6
97f8f6

View file

@ -1,11 +0,0 @@
#
# a bad compression pointer starting with the bits 1111
#
000a85800001000300000003
03766978 03636f6d 00 0002 0001
f00c 0002 0001 0000 0e10 000b 056973727631 027061 c00c
c00c 0002 0001 0000 0e10 0009 066e732d657874 c00c
c00c 0002 0001 0000 0e10 000e 036e7331 04676e6163 03636f6d 00
c025 0001 0001 0000 0e10 0004 cc98b886
c03c 0001 0001 0000 0e10 0004 cc98b840
c051 0001 0001 0002 a14a 0004 c697f8f6

View file

@ -1,12 +0,0 @@
#
# a bad compression pointer due to forward reference of 0x30 to
# another compression pointer with a valid backreference
#
000a85800001000300000003
03766978 03636f6d 00 0002 0001
c030 0002 0001 0000 0e10 000b 056973727631 027061 c00c
c00c 0002 0001 0000 0e10 0009 066e732d657874 c00c
c00c 0002 0001 0000 0e10 000e 036e7331 04676e6163 03636f6d 00
c025 0001 0001 0000 0e10 0004 cc98b886
c03c 0001 0001 0000 0e10 0004 cc98b840
c051 0001 0001 0002 a14a 0004 c697f8f6

View file

@ -1,45 +0,0 @@
#
# invalid name length, pointer at offset 0x0226 points to
# long name at offset 0x25
#
000a 8580 0001 0003 0000 0001
03 766978 03 636f6d 00 0002 0001
c00c 0002 0001 00000e10
0101
# long name starts here
03616263 0358595a 03616263 0358595a
03414243 0378797a 03414243 0378797a
03616263 0358595a 03616263 0358595a
03414243 0378797a 03414243 0378797a
03616263 0358595a 03616263 0358595a
03414243 0378797a 03414243 0378797a
03616263 0358595a 03616263 0358595a
03414243 0378797a 03414243 0378797a
03616263 0358595a 03616263 0358595a
03414243 0378797a 03414243 0378797a
03616263 0358595a 03616263 0358595a
03414243 0378797a 03414243 0378797a
03616263 0358595a 03616263 0358595a
03414243 0378797a 03414243 0378797a
03616263 0358595a 03616263 0358595a
03414243 0378797a 03414243 0378797a
03616263 0358595a 03616263 0358595a
03414243 0378797a 03414243 0378797a
03616263 0358595a 03616263 0358595a
03414243 0378797a 03414243 0378797a
03616263 0358595a 03616263 0358595a
03414243 0378797a 03414243 0378797a
03616263 0358595a 03616263 0358595a
03414243 0378797a 03414243 0378797a
03616263 0358595a 03616263 0358595a
03414243 0378797a 03414243 0378797a
03616263 0358595a 03616263 0358595a
03414243 0378797a 03414243 0378797a
03616263 0358595a 03616263 0358595a
03414243 0378797a 03414243 0378797a
03616263 0358595a 03616263 0358595a
03414243 0378797a 03414243 0378797a 00
# compression pointer start here and refers back to long name
c023 0002 0001 00000e10 0009 066e732d657874 c00c
c00c 0002 0001 00000e10 000e 036e733104676e616303636f6d00
c025 0001 0001 00000e10 0004 cc98b886

View file

@ -1,13 +0,0 @@
#
# a global14 compression pointer
#
000a85800001000300000003
0376697803636f6d0000020001c00c00
02000100000e10000b05697372763102
7061c00cc00c0002000100000e100009
066e732d657874c00cc00c0002000100
000e10000e036e733104676e61630363
6f6d00c0250001000100000e100004cc
98b886c03c0001000100000e100004cc
98b840c051000100010002a14a0004c6
97f8f6

View file

@ -1,13 +0,0 @@
#
# a bad pointer
#
000a85800001000300000003
0376697803636f6d0000020001f00c00
02000100000e10000b05697372763102
7061c00cc00c0002000100000e100009
066e732d657874c00cc00c0002000100
000e10000e036e733104676e61630363
6f6d00c0250001000100000e100004cc
98b886c03c0001000100000e100004cc
98b840c051000100010002a14a0004c6
97f8f6

View file

@ -1,5 +0,0 @@
#
# input ends unexpectedly
#
000a85800001000300000003
0376697803636f6d0000020001c0

View file

@ -1,28 +0,0 @@
#
# too many hops DNS_POINTER_MAXHOPS is defined as 16
# in lib/dns/include/dns/name.h
#
000a85800001000300000013
03 766978 03 636f6d 00 0002 0001
c00c 0002 0001 00000e10 000b 056973727631027061 c00c
c019 0002 0001 00000e10 0009 066e732d657874 c00c
c030 0002 0001 00000e10 000e 036e7331 04676e6163 03636f6d 00
c045 0001 0001 00000e10 0004 cc98b886
c05f 0001 0001 00000e10 0004 cc98b840
c06f 0001 0001 0002a14a 0004 c697f8f6
c07f 0001 0001 0002a14a 0004 c697f8f6
c08f 0001 0001 0002a14a 0004 c697f8f6
c09f 0001 0001 0002a14a 0004 c697f8f6
c0af 0001 0001 0002a14a 0004 c697f8f6
c0bf 0001 0001 0002a14a 0004 c697f8f6
c0cf 0001 0001 0002a14a 0004 c697f8f6
c0df 0001 0001 0002a14a 0004 c697f8f6
c0ef 0001 0001 0002a14a 0004 c697f8f6
c0ff 0001 0001 0002a14a 0004 c697f8f6
c10f 0001 0001 0002a14a 0004 c697f8f6
c11f 0001 0001 0002a14a 0004 c697f8f6
c12f 0001 0001 0002a14a 0004 c697f8f6
c13f 0001 0001 0002a14a 0004 c697f8f6
c14f 0001 0001 0002a14a 0004 c697f8f6
c15f 0001 0001 0002a14a 0004 c697f8f6
c16f 0001 0001 0002a14a 0004 c697f8f6

3
configure vendored
View file

@ -24157,7 +24157,7 @@ ac_config_commands="$ac_config_commands chmod"
# elsewhere if there's a good reason for doing so.
#
ac_config_files="$ac_config_files make/Makefile make/mkdep Makefile bin/Makefile bin/check/Makefile bin/confgen/Makefile bin/confgen/unix/Makefile bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile bin/named/Makefile bin/named/unix/Makefile bin/nsupdate/Makefile bin/pkcs11/Makefile bin/python/Makefile bin/python/isc/Makefile bin/python/isc/utils.py bin/python/isc/tests/Makefile bin/python/dnssec-checkds.py bin/python/dnssec-coverage.py bin/python/dnssec-keymgr.py bin/python/isc/__init__.py bin/python/isc/checkds.py bin/python/isc/coverage.py bin/python/isc/dnskey.py bin/python/isc/eventlist.py bin/python/isc/keydict.py bin/python/isc/keyevent.py bin/python/isc/keymgr.py bin/python/isc/keyseries.py bin/python/isc/keyzone.py bin/python/isc/policy.py bin/python/isc/rndc.py bin/python/isc/tests/dnskey_test.py bin/python/isc/tests/policy_test.py bin/rndc/Makefile bin/tests/Makefile bin/tests/db/Makefile bin/tests/dst/Makefile bin/tests/dst/Kdh.+002+18602.key bin/tests/dst/Kdh.+002+18602.private bin/tests/dst/Kdh.+002+48957.key bin/tests/dst/Kdh.+002+48957.private bin/tests/dst/Ktest.+001+00002.key bin/tests/dst/Ktest.+001+54622.key bin/tests/dst/Ktest.+001+54622.private bin/tests/dst/Ktest.+003+23616.key bin/tests/dst/Ktest.+003+23616.private bin/tests/dst/Ktest.+003+49667.key bin/tests/dst/dst_2_data bin/tests/dst/t2_data_1 bin/tests/dst/t2_data_2 bin/tests/dst/t2_dsasig bin/tests/dst/t2_rsasig bin/tests/headerdep_test.sh bin/tests/names/Makefile bin/tests/optional/Makefile bin/tests/pkcs11/Makefile bin/tests/pkcs11/benchmarks/Makefile bin/tests/system/Makefile bin/tests/system/conf.sh bin/tests/system/dlz/prereq.sh bin/tests/system/dlzexternal/Makefile bin/tests/system/dlzexternal/ns1/dlzs.conf bin/tests/system/dyndb/Makefile bin/tests/system/dyndb/driver/Makefile bin/tests/system/inline/checkdsa.sh bin/tests/system/pipelined/Makefile bin/tests/system/rndc/Makefile bin/tests/system/rpz/Makefile bin/tests/system/rsabigexponent/Makefile bin/tests/system/tkey/Makefile bin/tests/virtual-time/Makefile bin/tests/virtual-time/conf.sh bin/tools/Makefile contrib/scripts/check-secure-delegation.pl contrib/scripts/zone-edit.sh doc/Makefile doc/arm/Makefile doc/arm/noteversion.xml doc/arm/pkgversion.xml doc/arm/releaseinfo.xml doc/doxygen/Doxyfile doc/doxygen/Makefile doc/doxygen/doxygen-input-filter doc/misc/Makefile doc/tex/Makefile doc/tex/armstyle.sty doc/xsl/Makefile doc/xsl/isc-docbook-chunk.xsl doc/xsl/isc-docbook-html.xsl doc/xsl/isc-manpage.xsl doc/xsl/isc-notes-html.xsl isc-config.sh lib/Makefile lib/bind9/Makefile lib/bind9/include/Makefile lib/bind9/include/bind9/Makefile lib/dns/Makefile lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile lib/irs/include/irs/netdb.h lib/irs/include/irs/platform.h lib/irs/tests/Makefile lib/isc/$arch/Makefile lib/isc/$arch/include/Makefile lib/isc/$arch/include/isc/Makefile lib/isc/$thread_dir/Makefile lib/isc/$thread_dir/include/Makefile lib/isc/$thread_dir/include/isc/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/include/isc/platform.h lib/isc/include/pk11/Makefile lib/isc/include/pkcs11/Makefile lib/isc/tests/Makefile lib/isc/nls/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isc/unix/include/pkcs11/Makefile lib/isccc/Makefile lib/isccc/include/Makefile lib/isccc/include/isccc/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/isccfg/tests/Makefile lib/ns/Makefile lib/ns/include/Makefile lib/ns/include/ns/Makefile lib/ns/tests/Makefile lib/tests/Makefile lib/tests/include/Makefile lib/tests/include/tests/Makefile lib/samples/Makefile lib/samples/Makefile-postinstall unit/Makefile unit/unittest.sh"
ac_config_files="$ac_config_files make/Makefile make/mkdep Makefile bin/Makefile bin/check/Makefile bin/confgen/Makefile bin/confgen/unix/Makefile bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile bin/named/Makefile bin/named/unix/Makefile bin/nsupdate/Makefile bin/pkcs11/Makefile bin/python/Makefile bin/python/isc/Makefile bin/python/isc/utils.py bin/python/isc/tests/Makefile bin/python/dnssec-checkds.py bin/python/dnssec-coverage.py bin/python/dnssec-keymgr.py bin/python/isc/__init__.py bin/python/isc/checkds.py bin/python/isc/coverage.py bin/python/isc/dnskey.py bin/python/isc/eventlist.py bin/python/isc/keydict.py bin/python/isc/keyevent.py bin/python/isc/keymgr.py bin/python/isc/keyseries.py bin/python/isc/keyzone.py bin/python/isc/policy.py bin/python/isc/rndc.py bin/python/isc/tests/dnskey_test.py bin/python/isc/tests/policy_test.py bin/rndc/Makefile bin/tests/Makefile bin/tests/db/Makefile bin/tests/dst/Makefile bin/tests/dst/Kdh.+002+18602.key bin/tests/dst/Kdh.+002+18602.private bin/tests/dst/Kdh.+002+48957.key bin/tests/dst/Kdh.+002+48957.private bin/tests/dst/Ktest.+001+00002.key bin/tests/dst/Ktest.+001+54622.key bin/tests/dst/Ktest.+001+54622.private bin/tests/dst/Ktest.+003+23616.key bin/tests/dst/Ktest.+003+23616.private bin/tests/dst/Ktest.+003+49667.key bin/tests/dst/dst_2_data bin/tests/dst/t2_data_1 bin/tests/dst/t2_data_2 bin/tests/dst/t2_dsasig bin/tests/dst/t2_rsasig bin/tests/headerdep_test.sh bin/tests/optional/Makefile bin/tests/pkcs11/Makefile bin/tests/pkcs11/benchmarks/Makefile bin/tests/system/Makefile bin/tests/system/conf.sh bin/tests/system/dlz/prereq.sh bin/tests/system/dlzexternal/Makefile bin/tests/system/dlzexternal/ns1/dlzs.conf bin/tests/system/dyndb/Makefile bin/tests/system/dyndb/driver/Makefile bin/tests/system/inline/checkdsa.sh bin/tests/system/pipelined/Makefile bin/tests/system/rndc/Makefile bin/tests/system/rpz/Makefile bin/tests/system/rsabigexponent/Makefile bin/tests/system/tkey/Makefile bin/tests/virtual-time/Makefile bin/tests/virtual-time/conf.sh bin/tools/Makefile contrib/scripts/check-secure-delegation.pl contrib/scripts/zone-edit.sh doc/Makefile doc/arm/Makefile doc/arm/noteversion.xml doc/arm/pkgversion.xml doc/arm/releaseinfo.xml doc/doxygen/Doxyfile doc/doxygen/Makefile doc/doxygen/doxygen-input-filter doc/misc/Makefile doc/tex/Makefile doc/tex/armstyle.sty doc/xsl/Makefile doc/xsl/isc-docbook-chunk.xsl doc/xsl/isc-docbook-html.xsl doc/xsl/isc-manpage.xsl doc/xsl/isc-notes-html.xsl isc-config.sh lib/Makefile lib/bind9/Makefile lib/bind9/include/Makefile lib/bind9/include/bind9/Makefile lib/dns/Makefile lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile lib/irs/include/irs/netdb.h lib/irs/include/irs/platform.h lib/irs/tests/Makefile lib/isc/$arch/Makefile lib/isc/$arch/include/Makefile lib/isc/$arch/include/isc/Makefile lib/isc/$thread_dir/Makefile lib/isc/$thread_dir/include/Makefile lib/isc/$thread_dir/include/isc/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/include/isc/platform.h lib/isc/include/pk11/Makefile lib/isc/include/pkcs11/Makefile lib/isc/tests/Makefile lib/isc/nls/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isc/unix/include/pkcs11/Makefile lib/isccc/Makefile lib/isccc/include/Makefile lib/isccc/include/isccc/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/isccfg/tests/Makefile lib/ns/Makefile lib/ns/include/Makefile lib/ns/include/ns/Makefile lib/ns/tests/Makefile lib/tests/Makefile lib/tests/include/Makefile lib/tests/include/tests/Makefile lib/samples/Makefile lib/samples/Makefile-postinstall unit/Makefile unit/unittest.sh"
#
@ -25214,7 +25214,6 @@ do
"bin/tests/dst/t2_dsasig") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/t2_dsasig" ;;
"bin/tests/dst/t2_rsasig") CONFIG_FILES="$CONFIG_FILES bin/tests/dst/t2_rsasig" ;;
"bin/tests/headerdep_test.sh") CONFIG_FILES="$CONFIG_FILES bin/tests/headerdep_test.sh" ;;
"bin/tests/names/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/names/Makefile" ;;
"bin/tests/optional/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/optional/Makefile" ;;
"bin/tests/pkcs11/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/pkcs11/Makefile" ;;
"bin/tests/pkcs11/benchmarks/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/pkcs11/benchmarks/Makefile" ;;

View file

@ -5331,7 +5331,6 @@ AC_CONFIG_FILES([
bin/tests/dst/t2_dsasig
bin/tests/dst/t2_rsasig
bin/tests/headerdep_test.sh
bin/tests/names/Makefile
bin/tests/optional/Makefile
bin/tests/pkcs11/Makefile
bin/tests/pkcs11/benchmarks/Makefile

View file

@ -9,8 +9,6 @@
* information regarding copyright ownership.
*/
/* $Id$ */
/*! \file */
#include <config.h>
@ -328,6 +326,338 @@ ATF_TC_BODY(istat, tc) {
}
}
ATF_TC(init);
ATF_TC_HEAD(init, tc) {
atf_tc_set_md_var(tc, "descr", "dns_nane_init");
}
ATF_TC_BODY(init, tc) {
dns_name_t name;
unsigned char offsets[1];
dns_name_init(&name, offsets);
ATF_CHECK_EQ(name.ndata, NULL);
ATF_CHECK_EQ(name.length, 0);
ATF_CHECK_EQ(name.labels, 0);
ATF_CHECK_EQ(name.attributes, 0);
ATF_CHECK_EQ(name.offsets, offsets);
ATF_CHECK_EQ(name.buffer, NULL);
}
ATF_TC(invalidate);
ATF_TC_HEAD(invalidate, tc) {
atf_tc_set_md_var(tc, "descr", "dns_nane_invalidate");
}
ATF_TC_BODY(invalidate, tc) {
dns_name_t name;
unsigned char offsets[1];
dns_name_init(&name, offsets);
dns_name_invalidate(&name);
ATF_CHECK_EQ(name.ndata, NULL);
ATF_CHECK_EQ(name.length, 0);
ATF_CHECK_EQ(name.labels, 0);
ATF_CHECK_EQ(name.attributes, 0);
ATF_CHECK_EQ(name.offsets, NULL);
ATF_CHECK_EQ(name.buffer, NULL);
}
ATF_TC(buffer);
ATF_TC_HEAD(buffer, tc) {
atf_tc_set_md_var(tc, "descr", "dns_nane_setbuffer/hasbuffer");
}
ATF_TC_BODY(buffer, tc) {
dns_name_t name;
unsigned char buf[BUFSIZ];
isc_buffer_t b;
isc_buffer_init(&b, buf, BUFSIZ);
dns_name_init(&name, NULL);
dns_name_setbuffer(&name, &b);
ATF_CHECK_EQ(name.buffer, &b);
ATF_CHECK(dns_name_hasbuffer(&name));
}
ATF_TC(isabsolute);
ATF_TC_HEAD(isabsolute, tc) {
atf_tc_set_md_var(tc, "descr", "dns_nane_isabsolute");
}
ATF_TC_BODY(isabsolute, tc) {
struct {
const char *namestr;
isc_boolean_t expect;
} testcases[] = {
{ "x", ISC_FALSE },
{ "a.b.c.d.", ISC_TRUE },
{ "x.z", ISC_FALSE}
};
unsigned int i;
for (i = 0; i < (sizeof(testcases)/sizeof(testcases[0])); i++) {
isc_result_t result;
dns_name_t name;
unsigned char data[BUFSIZ];
isc_buffer_t b, nb;
size_t len;
len = strlen(testcases[i].namestr);
isc_buffer_constinit(&b, testcases[i].namestr, len);
isc_buffer_add(&b, len);
dns_name_init(&name, NULL);
isc_buffer_init(&nb, data, BUFSIZ);
dns_name_setbuffer(&name, &nb);
result = dns_name_fromtext(&name, &b, NULL, 0, NULL);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
ATF_CHECK_EQ(dns_name_isabsolute(&name), testcases[i].expect);
}
}
ATF_TC(hash);
ATF_TC_HEAD(hash, tc) {
atf_tc_set_md_var(tc, "descr", "dns_nane_hash");
}
ATF_TC_BODY(hash, tc) {
struct {
const char *name1;
const char *name2;
isc_boolean_t expect;
isc_boolean_t expecti;
} testcases[] = {
{ "a.b.c.d", "A.B.C.D", ISC_TRUE, ISC_FALSE },
{ "a.b.c.d.", "A.B.C.D.", ISC_TRUE, ISC_FALSE },
{ "a.b.c.d", "a.b.c.d", ISC_TRUE, ISC_TRUE },
{ "A.B.C.D.", "A.B.C.D.", ISC_TRUE, ISC_FALSE },
{ "x.y.z.w", "a.b.c.d", ISC_FALSE, ISC_FALSE },
{ "x.y.z.w.", "a.b.c.d.", ISC_FALSE, ISC_FALSE },
};
unsigned int i;
for (i = 0; i < (sizeof(testcases)/sizeof(testcases[0])); i++) {
isc_result_t result;
dns_fixedname_t f1, f2;
dns_name_t *n1, *n2;
unsigned int h1, h2;
dns_fixedname_init(&f1);
n1 = dns_fixedname_name(&f1);
dns_fixedname_init(&f2);
n2 = dns_fixedname_name(&f2);
result = dns_name_fromstring2(n1, testcases[i].name1,
NULL, 0, NULL);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = dns_name_fromstring2(n2, testcases[i].name2,
NULL, 0, NULL);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
/* Check case-insensitive hashing first */
h1 = dns_name_hash(n1, ISC_FALSE);
h2 = dns_name_hash(n2, ISC_FALSE);
printf("%s hashes to %u, %s to %u, case insensitive\n",
testcases[i].name1, h1, testcases[i].name2, h2);
ATF_REQUIRE_EQ(ISC_TF(h1 == h2), testcases[i].expect);
/* Now case-sensitive */
h1 = dns_name_hash(n1, ISC_FALSE);
h2 = dns_name_hash(n2, ISC_FALSE);
printf("%s hashes to %u, %s to %u, case sensitive\n",
testcases[i].name1, h1, testcases[i].name2, h2);
ATF_REQUIRE_EQ(ISC_TF(h1 == h2), testcases[i].expect);
}
}
ATF_TC(issubdomain);
ATF_TC_HEAD(issubdomain, tc) {
atf_tc_set_md_var(tc, "descr", "dns_nane_issubdomain");
}
ATF_TC_BODY(issubdomain, tc) {
struct {
const char *name1;
const char *name2;
isc_boolean_t expect;
} testcases[] = {
{ "c.d", "a.b.c.d", ISC_FALSE },
{ "c.d.", "a.b.c.d.", ISC_FALSE },
{ "b.c.d", "c.d", ISC_TRUE },
{ "a.b.c.d.", "c.d.", ISC_TRUE },
{ "a.b.c", "a.b.c", ISC_TRUE },
{ "a.b.c.", "a.b.c.", ISC_TRUE },
{ "x.y.z", "a.b.c", ISC_FALSE}
};
unsigned int i;
for (i = 0; i < (sizeof(testcases)/sizeof(testcases[0])); i++) {
isc_result_t result;
dns_fixedname_t f1, f2;
dns_name_t *n1, *n2;
dns_fixedname_init(&f1);
n1 = dns_fixedname_name(&f1);
dns_fixedname_init(&f2);
n2 = dns_fixedname_name(&f2);
result = dns_name_fromstring2(n1, testcases[i].name1,
NULL, 0, NULL);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = dns_name_fromstring2(n2, testcases[i].name2,
NULL, 0, NULL);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
printf("check: %s %s a subdomain of %s\n",
testcases[i].name1,
testcases[i].expect ? "is" : "is not",
testcases[i].name2);
ATF_CHECK_EQ(dns_name_issubdomain(n1, n2),
testcases[i].expect);
}
}
ATF_TC(countlabels);
ATF_TC_HEAD(countlabels, tc) {
atf_tc_set_md_var(tc, "descr", "dns_nane_countlabels");
}
ATF_TC_BODY(countlabels, tc) {
struct {
const char *namestr;
unsigned int expect;
} testcases[] = {
{ "c.d", 2 },
{ "c.d.", 3 },
{ "a.b.c.d.", 5 },
{ "a.b.c.d", 4 },
{ "a.b.c", 3 },
{ ".", 1 },
};
unsigned int i;
for (i = 0; i < (sizeof(testcases)/sizeof(testcases[0])); i++) {
isc_result_t result;
dns_fixedname_t fname;
dns_name_t *name;
dns_fixedname_init(&fname);
name = dns_fixedname_name(&fname);
result = dns_name_fromstring2(name, testcases[i].namestr,
NULL, 0, NULL);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
printf("%s: expect %d labels\n",
testcases[i].namestr, testcases[i].expect);
ATF_REQUIRE_EQ(dns_name_countlabels(name),
testcases[i].expect);
}
}
ATF_TC(getlabel);
ATF_TC_HEAD(getlabel, tc) {
atf_tc_set_md_var(tc, "descr", "dns_nane_getlabel");
}
ATF_TC_BODY(getlabel, tc) {
struct {
const char *name1;
unsigned int pos1;
const char *name2;
unsigned int pos2;
} testcases[] = {
{ "c.d", 1, "a.b.c.d", 3 },
{ "a.b.c.d", 3, "c.d", 1 },
{ "a.b.c.", 3, "A.B.C.", 3 },
};
unsigned int i;
for (i = 0; i < (sizeof(testcases)/sizeof(testcases[0])); i++) {
isc_result_t result;
dns_fixedname_t f1, f2;
dns_name_t *n1, *n2;
dns_label_t l1, l2;
unsigned char *p1, *p2;
unsigned int j;
dns_fixedname_init(&f1);
n1 = dns_fixedname_name(&f1);
dns_fixedname_init(&f2);
n2 = dns_fixedname_name(&f2);
result = dns_name_fromstring2(n1, testcases[i].name1,
NULL, 0, NULL);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = dns_name_fromstring2(n2, testcases[i].name2,
NULL, 0, NULL);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
dns_name_getlabel(n1, testcases[i].pos1, &l1);
dns_name_getlabel(n2, testcases[i].pos2, &l2);
ATF_CHECK_EQ(l1.length, l2.length);
p1 = l1.base;
p2 = l2.base;
for (j = 0; j < l1.length; j++) {
ATF_REQUIRE_EQ(*p1++, *p2++);
}
}
}
ATF_TC(getlabelsequence);
ATF_TC_HEAD(getlabelsequence, tc) {
atf_tc_set_md_var(tc, "descr", "dns_nane_getlabelsequence");
}
ATF_TC_BODY(getlabelsequence, tc) {
struct {
const char *name1;
unsigned int pos1;
const char *name2;
unsigned int pos2;
unsigned int range;
} testcases[] = {
{ "c.d", 1, "a.b.c.d", 3, 1 },
{ "a.b.c.d.e", 2, "c.d", 0, 2 },
{ "a.b.c", 0, "a.b.c", 0, 3 },
};
unsigned int i;
for (i = 0; i < (sizeof(testcases)/sizeof(testcases[0])); i++) {
isc_result_t result;
dns_name_t t1, t2;
dns_fixedname_t f1, f2;
dns_name_t *n1, *n2;
/* target names */
dns_name_init(&t1, NULL);
dns_name_init(&t2, NULL);
/* source names */
dns_fixedname_init(&f1);
n1 = dns_fixedname_name(&f1);
dns_fixedname_init(&f2);
n2 = dns_fixedname_name(&f2);
result = dns_name_fromstring2(n1, testcases[i].name1,
NULL, 0, NULL);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = dns_name_fromstring2(n2, testcases[i].name2,
NULL, 0, NULL);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
dns_name_getlabelsequence(n1, testcases[i].pos1,
testcases[i].range, &t1);
dns_name_getlabelsequence(n2, testcases[i].pos2,
testcases[i].range, &t2);
ATF_REQUIRE(dns_name_equal(&t1, &t2));
}
}
#ifdef ISC_PLATFORM_USETHREADS
#ifdef DNS_BENCHMARK_TESTS
@ -433,6 +763,15 @@ ATF_TP_ADD_TCS(tp) {
ATF_TP_ADD_TC(tp, fullcompare);
ATF_TP_ADD_TC(tp, compression);
ATF_TP_ADD_TC(tp, istat);
ATF_TP_ADD_TC(tp, init);
ATF_TP_ADD_TC(tp, invalidate);
ATF_TP_ADD_TC(tp, buffer);
ATF_TP_ADD_TC(tp, isabsolute);
ATF_TP_ADD_TC(tp, hash);
ATF_TP_ADD_TC(tp, issubdomain);
ATF_TP_ADD_TC(tp, countlabels);
ATF_TP_ADD_TC(tp, getlabel);
ATF_TP_ADD_TC(tp, getlabelsequence);
#ifdef ISC_PLATFORM_USETHREADS
#ifdef DNS_BENCHMARK_TESTS
ATF_TP_ADD_TC(tp, benchmark);

View file

@ -440,43 +440,6 @@
./bin/tests/mempool_test.c C 1999,2000,2001,2004,2007,2016,2018
./bin/tests/name_test.c C 1998,1999,2000,2001,2003,2004,2005,2007,2009,2015,2016,2017,2018
./bin/tests/named.conf CONF-C 1999,2000,2001,2004,2007,2011,2015,2016,2018
./bin/tests/names/Makefile.in MAKE 1999,2000,2001,2002,2004,2007,2009,2012,2014,2016,2017,2018
./bin/tests/names/dns_name_compare_data X 1999,2000,2001,2018
./bin/tests/names/dns_name_countlabels_data X 1999,2000,2001,2003,2018
./bin/tests/names/dns_name_fromregion_data X 1999,2000,2001,2003,2018
./bin/tests/names/dns_name_fromtext_data X 1999,2000,2001,2018
./bin/tests/names/dns_name_fromwire_1_data X 1999,2000,2001,2018
./bin/tests/names/dns_name_fromwire_2_data X 1999,2000,2001,2018
./bin/tests/names/dns_name_fromwire_3_data X 1999,2000,2001,2018
./bin/tests/names/dns_name_fromwire_4_data X 1999,2000,2001,2018
./bin/tests/names/dns_name_fromwire_5_data X 1999,2000,2001,2018
./bin/tests/names/dns_name_fromwire_6_data X 1999,2000,2001,2018
./bin/tests/names/dns_name_fromwire_7_data X 1999,2000,2001,2018
./bin/tests/names/dns_name_fromwire_8_data X 1999,2000,2001,2006,2018
./bin/tests/names/dns_name_fullcompare_data X 1999,2000,2001,2018
./bin/tests/names/dns_name_getlabel_data X 1999,2000,2001,2018
./bin/tests/names/dns_name_getlabelsequence_data X 1999,2000,2001,2018
./bin/tests/names/dns_name_hash_data X 1999,2000,2001,2003,2012,2018
./bin/tests/names/dns_name_isabsolute_data X 1999,2000,2001,2003,2018
./bin/tests/names/dns_name_issubdomain_data X 1999,2000,2001,2018
./bin/tests/names/dns_name_rdatacompare_data X 1999,2000,2001,2018
./bin/tests/names/dns_name_toregion_data X 1999,2000,2001,2003,2018
./bin/tests/names/dns_name_totext_data X 1999,2000,2001,2018
./bin/tests/names/dns_name_towire_1_data X 1999,2000,2001,2018
./bin/tests/names/dns_name_towire_2_data X 1999,2000,2001,2018
./bin/tests/names/t_names.c C 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2018
./bin/tests/names/win32/t_names.vcxproj.filters.in X 2013,2015,2018
./bin/tests/names/win32/t_names.vcxproj.in X 2013,2015,2016,2017,2018
./bin/tests/names/win32/t_names.vcxproj.user X 2013,2018
./bin/tests/names/wire_test1.data X 1999,2000,2001,2018
./bin/tests/names/wire_test2.data X 1999,2000,2001,2018
./bin/tests/names/wire_test3_1.data X 1999,2000,2001,2018
./bin/tests/names/wire_test3_2.data X 1999,2000,2001,2018
./bin/tests/names/wire_test4.data X 1999,2000,2001,2018
./bin/tests/names/wire_test5.data X 1999,2000,2001,2018
./bin/tests/names/wire_test6.data X 1999,2000,2001,2018
./bin/tests/names/wire_test7.data X 1999,2000,2001,2018
./bin/tests/names/wire_test8.data X 1999,2000,2001,2018
./bin/tests/ndc.conf CONF-C 2000,2001,2004,2007,2016,2018
./bin/tests/ndc.conf-include CONF-C 2001,2004,2007,2016,2018
./bin/tests/nsecify.c C 1999,2000,2001,2003,2004,2007,2008,2009,2011,2015,2016,2017,2018

View file

@ -120,8 +120,6 @@ my @projectlist = ("..\\bin\\check\\win32\\checkconf.vcxproj",
"..\\bin\\tests\\db\\win32\\t_db.vcxproj.filters",
"..\\bin\\tests\\dst\\win32\\t_dst.vcxproj",
"..\\bin\\tests\\dst\\win32\\t_dst.vcxproj.filters",
"..\\bin\\tests\\names\\win32\\t_names.vcxproj",
"..\\bin\\tests\\names\\win32\\t_names.vcxproj.filters",
"..\\bin\\tests\\system\\win32\\bigkey.vcxproj",
"..\\bin\\tests\\system\\win32\\bigkey.vcxproj.filters",
"..\\bin\\tests\\system\\win32\\feature-test.vcxproj",

View file

@ -516,14 +516,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t_dst", "..\bin\tests\dst\w
{B4AC7F81-E3DC-43E9-B339-4FA5149FA8F7} = {B4AC7F81-E3DC-43E9-B339-4FA5149FA8F7}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t_names", "..\bin\tests\names\win32\t_names.vcxproj", "{124DC0D3-3096-41D2-B490-CE85E890FF33}"
ProjectSection(ProjectDependencies) = postProject
{A3F71D12-F38A-4C77-8D87-8E8854CA74A1} = {A3F71D12-F38A-4C77-8D87-8E8854CA74A1}
{3840E563-D180-4761-AA9C-E6155F02EAFF} = {3840E563-D180-4761-AA9C-E6155F02EAFF}
{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A} = {5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}
{F6F08940-7597-4FEE-9CE0-E09A009C45A3} = {F6F08940-7597-4FEE-9CE0-E09A009C45A3}
EndProjectSection
EndProject
@END TESTS
@IF XTESTS
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "backtrace_test", "..\bin\tests\win32\backtrace_test.vcxproj", "{14751171-C40E-40EE-A2F0-37FFC3CCD4A2}"