mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
migrate t_rbt to lib/dns/tests/rbt_test
This commit is contained in:
1
bin/tests/.gitignore
vendored
1
bin/tests/.gitignore
vendored
@@ -8,7 +8,6 @@ t_db
|
||||
gsstest
|
||||
t_dst
|
||||
t_names
|
||||
t_rbt
|
||||
conf.sh
|
||||
dlopen
|
||||
keycreate
|
||||
|
@@ -32,8 +32,7 @@ ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
|
||||
|
||||
LIBS = @LIBS@
|
||||
|
||||
SUBDIR = db dst names rbt system \
|
||||
@PKCS11_TOOLS@ optional
|
||||
SUBDIR = db dst names system @PKCS11_TOOLS@ optional
|
||||
|
||||
TESTDIRS = system
|
||||
|
||||
|
@@ -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_rbt@EXEEXT@
|
||||
|
||||
SRCS = t_rbt.c
|
||||
|
||||
@BIND9_MAKE_RULES@
|
||||
|
||||
t_rbt@EXEEXT@: t_rbt.@O@ ${DEPLIBS} ${TLIB}
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ t_rbt.@O@ ${TLIB} ${LIBS}
|
||||
|
||||
test: t_rbt@EXEEXT@
|
||||
-@./t_rbt@EXEEXT@ -c @top_srcdir@/t_config -b @srcdir@ -a
|
||||
|
||||
testhelp:
|
||||
@./t_rbt@EXEEXT@ -h
|
||||
|
||||
clean distclean::
|
||||
rm -f ${TARGETS}
|
@@ -1,14 +0,0 @@
|
||||
a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.
|
||||
a.b.c.d.e.f.vix.com
|
||||
a.d.e.f.vix.com
|
||||
a.vix.com
|
||||
b.b.c.d.e.f.vix.com
|
||||
b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.
|
||||
b.vix.com
|
||||
c.b.c.d.e.f.vix.com
|
||||
c.vix.com
|
||||
d.e.f.vix.com
|
||||
g.h.vix.com
|
||||
q.d.e.f.vix.com
|
||||
x.a.vix.com
|
||||
y.x.a.vix.com
|
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# test data for dns_rbt_addname assertion 1
|
||||
#
|
||||
# format is: <dbfile> <command> <testname> <exp_result>
|
||||
#
|
||||
dns_rbt.data add new.name ISC_R_SUCCESS
|
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# test data for dns_rbt_addname assertion 2
|
||||
#
|
||||
# format is: <dbfile> <command> <testname> <exp_result>
|
||||
#
|
||||
dns_rbt.data add a.vix.com ISC_R_EXISTS
|
@@ -1,10 +0,0 @@
|
||||
a.vix.com
|
||||
b.vix.com
|
||||
c.vix.com
|
||||
a.a.vix.com
|
||||
a.a.a.vix.com
|
||||
a.a.a.a.vix.com
|
||||
a.a.a.a.a.vix.com
|
||||
a.a.a.a.a.a.vix.com
|
||||
a.a.a.a.a.a.a.vix.com
|
||||
a.a.a.a.a.a.a.a.vix.com
|
@@ -1,7 +0,0 @@
|
||||
#
|
||||
# test data for dns_rbt_create assertion 1
|
||||
#
|
||||
# format is: <dbfile> <command> <testname> <exp_result>
|
||||
#
|
||||
dns_rbt.data create not.used ISC_R_SUCCESS
|
||||
dns_rbt_bitstring.data create not.used ISC_R_SUCCESS
|
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# test data for dns_rbt_delete assertion 1
|
||||
#
|
||||
# format is: <dbfile> <command> <testname> <exp_result>
|
||||
#
|
||||
dns_rbt.data delete a.vix.com ISC_R_SUCCESS
|
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# test data for dns_rbt_delete assertion 2
|
||||
#
|
||||
# format is: <dbfile> <command> <testname> <exp_result>
|
||||
#
|
||||
dns_rbt.data delete new.name ISC_R_NOTFOUND
|
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# test data for dns_rbt_findname assertion 1
|
||||
#
|
||||
# format is: <dbfile> <command> <testname> <exp_result>
|
||||
#
|
||||
dns_rbt.data search a.vix.com ISC_R_SUCCESS
|
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# test data for dns_rbt_findname assertion 2
|
||||
#
|
||||
# format is: <dbfile> <command> <testname> <exp_result>
|
||||
#
|
||||
dns_rbt.data search not.used.here ISC_R_NOTFOUND
|
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# test data for dns_rbt_findname assertion 3
|
||||
#
|
||||
# format is: <dbfile> <command> <testname> <exp_result>
|
||||
#
|
||||
dns_rbt.data search a.b.vix.com DNS_R_PARTIALMATCH
|
@@ -1,13 +0,0 @@
|
||||
b.com
|
||||
a.vix.com
|
||||
b.vix.com
|
||||
c.vix.com
|
||||
a.a.vix.com
|
||||
b.a.vix.com
|
||||
a.b.vix.com
|
||||
b.b.vix.com
|
||||
a.c.vix.com
|
||||
b.c.vix.com
|
||||
iengines.net
|
||||
isc.org
|
||||
|
@@ -1,9 +0,0 @@
|
||||
a.a.vix.com
|
||||
b.a.vix.com
|
||||
a.b.vix.com
|
||||
b.b.vix.com
|
||||
a.c.vix.com
|
||||
b.c.vix.com
|
||||
iengines.net
|
||||
isc.org
|
||||
|
@@ -1,7 +0,0 @@
|
||||
#
|
||||
# test data for dns_rbtnodechain_first
|
||||
#
|
||||
# format is: <dbfile> <firstname> <firstorigin> <nextname> <nextorigin>
|
||||
#
|
||||
dns_rbtnodechain_first_1.data @ . com .
|
||||
dns_rbtnodechain_first_2.data @ . vix.com .
|
@@ -1,13 +0,0 @@
|
||||
vix.com
|
||||
a.vix.com
|
||||
b.vix.com
|
||||
c.vix.com
|
||||
a.a.vix.com
|
||||
b.a.vix.com
|
||||
a.b.vix.com
|
||||
b.b.vix.com
|
||||
a.c.vix.com
|
||||
b.c.vix.com
|
||||
iengines.net
|
||||
isc.org
|
||||
|
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# test data for dns_rbtnodechain_init
|
||||
#
|
||||
# format is: <dbfile> <findnode> <next> <nextorigin> <prev> <prevorigin> <first> <firstorigin> <last> <lastorigin>
|
||||
#
|
||||
dns_rbtnodechain_init.data b.vix.com. a b.vix.com. b a.vix.com. @ . isc.org .
|
@@ -1,13 +0,0 @@
|
||||
vix.com
|
||||
a.vix.com
|
||||
b.vix.com
|
||||
c.vix.com
|
||||
a.a.vix.com
|
||||
b.a.vix.com
|
||||
a.b.vix.com
|
||||
b.b.vix.com
|
||||
a.c.vix.com
|
||||
b.c.vix.com
|
||||
iengines.net
|
||||
isc.org
|
||||
|
@@ -1,7 +0,0 @@
|
||||
a.b.vix.com
|
||||
b.b.vix.com
|
||||
a.c.vix.com
|
||||
b.c.vix.com
|
||||
vayu.com
|
||||
isc.org
|
||||
|
@@ -1,7 +0,0 @@
|
||||
#
|
||||
# test data for dns_rbtnodechain_last
|
||||
#
|
||||
# format is: <dbfile> <last> <lastorigin> <prev> <prevorigin>
|
||||
#
|
||||
dns_rbtnodechain_last_1.data isc.org . iengines.net .
|
||||
dns_rbtnodechain_last_2.data isc.org . b c.vix.com.
|
@@ -1,13 +0,0 @@
|
||||
vix.com
|
||||
a.vix.com
|
||||
b.vix.com
|
||||
c.vix.com
|
||||
a.a.vix.com
|
||||
b.a.vix.com
|
||||
a.b.vix.com
|
||||
b.b.vix.com
|
||||
a.c.vix.com
|
||||
b.c.vix.com
|
||||
iengines.net
|
||||
isc.org
|
||||
|
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# test data for dns_rbtnodechain_next
|
||||
#
|
||||
# format is: <dbfile> <startname> <expected_name> <expected_origin>
|
||||
#
|
||||
dns_rbtnodechain_next.data c.vix.com. a c.vix.com.
|
@@ -1,13 +0,0 @@
|
||||
vix.com
|
||||
a.vix.com
|
||||
b.vix.com
|
||||
c.vix.com
|
||||
a.a.vix.com
|
||||
b.a.vix.com
|
||||
a.b.vix.com
|
||||
b.b.vix.com
|
||||
a.c.vix.com
|
||||
b.c.vix.com
|
||||
iengines.net
|
||||
isc.org
|
||||
|
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# test data for dns_rbtnodechain_prev
|
||||
#
|
||||
# format is: <dbfile> <startname> <expected_name> <expected_origin>
|
||||
#
|
||||
dns_rbtnodechain_prev.data a.b.vix.com. b vix.com.
|
File diff suppressed because it is too large
Load Diff
@@ -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_rbt.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -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>{39F714D4-FEFB-4E23-91DB-1F6FC80A98B5}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>t_rbt</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_rbt.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@@ -1,3 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
</Project>
|
3
configure
vendored
3
configure
vendored
@@ -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/rbt/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/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"
|
||||
|
||||
|
||||
#
|
||||
@@ -25218,7 +25218,6 @@ do
|
||||
"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" ;;
|
||||
"bin/tests/rbt/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/rbt/Makefile" ;;
|
||||
"bin/tests/system/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/system/Makefile" ;;
|
||||
"bin/tests/system/conf.sh") CONFIG_FILES="$CONFIG_FILES bin/tests/system/conf.sh" ;;
|
||||
"bin/tests/system/dlz/prereq.sh") CONFIG_FILES="$CONFIG_FILES bin/tests/system/dlz/prereq.sh" ;;
|
||||
|
@@ -5335,7 +5335,6 @@ AC_CONFIG_FILES([
|
||||
bin/tests/optional/Makefile
|
||||
bin/tests/pkcs11/Makefile
|
||||
bin/tests/pkcs11/benchmarks/Makefile
|
||||
bin/tests/rbt/Makefile
|
||||
bin/tests/system/Makefile
|
||||
bin/tests/system/conf.sh
|
||||
bin/tests/system/dlz/prereq.sh
|
||||
|
@@ -493,3 +493,25 @@ dns_test_rdata_fromstring(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
void
|
||||
dns_test_namefromstring(const char *namestr, dns_fixedname_t *fname) {
|
||||
size_t length;
|
||||
isc_buffer_t *b = NULL;
|
||||
isc_result_t result;
|
||||
dns_name_t *name;
|
||||
|
||||
length = strlen(namestr);
|
||||
|
||||
result = isc_buffer_allocate(mctx, &b, length);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
isc_buffer_putmem(b, (const unsigned char *) namestr, length);
|
||||
|
||||
dns_fixedname_init(fname);
|
||||
name = dns_fixedname_name(fname);
|
||||
ATF_REQUIRE(name != NULL);
|
||||
result = dns_name_fromtext(name, b, dns_rootname, 0, NULL);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_buffer_free(&b);
|
||||
}
|
||||
|
@@ -93,3 +93,6 @@ isc_result_t
|
||||
dns_test_rdata_fromstring(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
|
||||
dns_rdatatype_t rdtype, unsigned char *dst,
|
||||
size_t dstlen, const char *src);
|
||||
|
||||
void
|
||||
dns_test_namefromstring(const char *namestr, dns_fixedname_t *fname);
|
||||
|
@@ -9,8 +9,6 @@
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
/* $Id: rbt_test.c,v 1.1.14.8 2012/02/10 16:24:37 ckb Exp $ */
|
||||
|
||||
/* ! \file */
|
||||
|
||||
#include <config.h>
|
||||
@@ -27,6 +25,7 @@
|
||||
|
||||
#include <dns/rbt.h>
|
||||
#include <dns/fixedname.h>
|
||||
#include <dns/name.h>
|
||||
#include <dns/result.h>
|
||||
#include <dns/compress.h>
|
||||
#include "dnstest.h"
|
||||
@@ -136,28 +135,6 @@ delete_data(void *data, void *arg) {
|
||||
isc_mem_put(mctx, data, sizeof(size_t));
|
||||
}
|
||||
|
||||
static void
|
||||
build_name_from_str(const char *namestr, dns_fixedname_t *fname) {
|
||||
size_t length;
|
||||
isc_buffer_t *b = NULL;
|
||||
isc_result_t result;
|
||||
dns_name_t *name;
|
||||
|
||||
length = strlen(namestr);
|
||||
|
||||
result = isc_buffer_allocate(mctx, &b, length);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
isc_buffer_putmem(b, (const unsigned char *) namestr, length);
|
||||
|
||||
dns_fixedname_init(fname);
|
||||
name = dns_fixedname_name(fname);
|
||||
ATF_REQUIRE(name != NULL);
|
||||
result = dns_name_fromtext(name, b, dns_rootname, 0, NULL);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_buffer_free(&b);
|
||||
}
|
||||
|
||||
static test_context_t *
|
||||
test_context_setup(void) {
|
||||
test_context_t *ctx;
|
||||
@@ -180,7 +157,7 @@ test_context_setup(void) {
|
||||
dns_fixedname_t fname;
|
||||
dns_name_t *name;
|
||||
|
||||
build_name_from_str(domain_names[i], &fname);
|
||||
dns_test_namefromstring(domain_names[i], &fname);
|
||||
|
||||
name = dns_fixedname_name(&fname);
|
||||
|
||||
@@ -224,7 +201,7 @@ check_test_data(dns_rbt_t *rbt) {
|
||||
dns_name_t *name;
|
||||
size_t *n;
|
||||
|
||||
build_name_from_str(domain_names[i], &fname);
|
||||
dns_test_namefromstring(domain_names[i], &fname);
|
||||
|
||||
name = dns_fixedname_name(&fname);
|
||||
n = NULL;
|
||||
@@ -310,7 +287,7 @@ ATF_TC_BODY(rbtnode_get_distance, tc) {
|
||||
|
||||
ctx = test_context_setup();
|
||||
|
||||
build_name_from_str(name_str, &fname);
|
||||
dns_test_namefromstring(name_str, &fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
|
||||
dns_rbtnodechain_init(&chain, mctx);
|
||||
@@ -397,7 +374,7 @@ ATF_TC_BODY(rbt_check_distance_random, tc) {
|
||||
namebuf[32] = '.';
|
||||
namebuf[33] = 0;
|
||||
|
||||
build_name_from_str(namebuf, &fname);
|
||||
dns_test_namefromstring(namebuf, &fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
|
||||
result = dns_rbt_addname(mytree, name, n);
|
||||
@@ -471,7 +448,7 @@ ATF_TC_BODY(rbt_check_distance_ordered, tc) {
|
||||
*n = i + 1;
|
||||
|
||||
snprintf(namebuf, sizeof(namebuf), "name%08x.", i);
|
||||
build_name_from_str(namebuf, &fname);
|
||||
dns_test_namefromstring(namebuf, &fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
|
||||
result = dns_rbt_addname(mytree, name, n);
|
||||
@@ -500,7 +477,7 @@ insert_helper(dns_rbt_t *rbt, const char *namestr, dns_rbtnode_t **node) {
|
||||
dns_fixedname_t fname;
|
||||
dns_name_t *name;
|
||||
|
||||
build_name_from_str(namestr, &fname);
|
||||
dns_test_namefromstring(namestr, &fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
|
||||
return (dns_rbt_addnode(rbt, name, node));
|
||||
@@ -739,7 +716,7 @@ ATF_TC_BODY(rbt_remove, tc) {
|
||||
dns_fixedname_t fname;
|
||||
dns_name_t *name;
|
||||
|
||||
build_name_from_str(ordered_names[i], &fname);
|
||||
dns_test_namefromstring(ordered_names[i], &fname);
|
||||
|
||||
name = dns_fixedname_name(&fname);
|
||||
node = NULL;
|
||||
@@ -764,7 +741,7 @@ ATF_TC_BODY(rbt_remove, tc) {
|
||||
dns_fixedname_t fname;
|
||||
dns_name_t *name;
|
||||
|
||||
build_name_from_str(ordered_names[j], &fname);
|
||||
dns_test_namefromstring(ordered_names[j], &fname);
|
||||
|
||||
name = dns_fixedname_name(&fname);
|
||||
|
||||
@@ -787,7 +764,7 @@ ATF_TC_BODY(rbt_remove, tc) {
|
||||
dns_fixedname_t fname;
|
||||
dns_name_t *name;
|
||||
|
||||
build_name_from_str(ordered_names[0], &fname);
|
||||
dns_test_namefromstring(ordered_names[0], &fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
node = NULL;
|
||||
result = dns_rbt_findnode(mytree, name, NULL,
|
||||
@@ -796,7 +773,7 @@ ATF_TC_BODY(rbt_remove, tc) {
|
||||
NULL, NULL);
|
||||
ATF_CHECK_EQ(result, ISC_R_NOTFOUND);
|
||||
|
||||
build_name_from_str(ordered_names[1], &fname);
|
||||
dns_test_namefromstring(ordered_names[1], &fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
node = NULL;
|
||||
result = dns_rbt_findnode(mytree, name, NULL,
|
||||
@@ -810,7 +787,7 @@ ATF_TC_BODY(rbt_remove, tc) {
|
||||
dns_fixedname_t fname;
|
||||
dns_name_t *name;
|
||||
|
||||
build_name_from_str(ordered_names[0], &fname);
|
||||
dns_test_namefromstring(ordered_names[0], &fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
node = NULL;
|
||||
result = dns_rbt_findnode(mytree, name, NULL,
|
||||
@@ -829,9 +806,9 @@ ATF_TC_BODY(rbt_remove, tc) {
|
||||
dns_fixedname_t fname_j, fname_i;
|
||||
dns_name_t *name_j, *name_i;
|
||||
|
||||
build_name_from_str(ordered_names[j], &fname_j);
|
||||
dns_test_namefromstring(ordered_names[j], &fname_j);
|
||||
name_j = dns_fixedname_name(&fname_j);
|
||||
build_name_from_str(ordered_names[i], &fname_i);
|
||||
dns_test_namefromstring(ordered_names[i], &fname_i);
|
||||
name_i = dns_fixedname_name(&fname_i);
|
||||
|
||||
if (dns_name_equal(name_i, name_j)) {
|
||||
@@ -922,7 +899,7 @@ insert_nodes(dns_rbt_t *mytree, char **names,
|
||||
namebuf[32] = '.';
|
||||
namebuf[33] = 0;
|
||||
|
||||
build_name_from_str(namebuf, &fname);
|
||||
dns_test_namefromstring(namebuf, &fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
|
||||
node = NULL;
|
||||
@@ -956,7 +933,7 @@ remove_nodes(dns_rbt_t *mytree, char **names,
|
||||
|
||||
node %= *names_count;
|
||||
|
||||
build_name_from_str(names[node], &fname);
|
||||
dns_test_namefromstring(names[node], &fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
|
||||
result = dns_rbt_deletename(mytree, name, ISC_FALSE);
|
||||
@@ -1081,6 +1058,213 @@ ATF_TC_BODY(rbt_insert_and_remove, tc) {
|
||||
dns_test_end();
|
||||
}
|
||||
|
||||
ATF_TC(rbt_findname);
|
||||
ATF_TC_HEAD(rbt_findname, tc) {
|
||||
atf_tc_set_md_var(tc, "descr", "findname return values");
|
||||
}
|
||||
ATF_TC_BODY(rbt_findname, tc) {
|
||||
isc_result_t result;
|
||||
test_context_t *ctx = NULL;
|
||||
dns_fixedname_t fname, found;
|
||||
dns_name_t *name = NULL, *foundname = NULL;
|
||||
size_t *n = NULL;
|
||||
|
||||
UNUSED(tc);
|
||||
|
||||
isc_mem_debugging = ISC_MEM_DEBUGRECORD;
|
||||
|
||||
result = dns_test_begin(NULL, ISC_TRUE);
|
||||
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
ctx = test_context_setup();
|
||||
|
||||
/* Try to find a name that exists. */
|
||||
dns_test_namefromstring("d.e.f", &fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
|
||||
dns_fixedname_init(&found);
|
||||
foundname = dns_fixedname_name(&found);
|
||||
|
||||
result = dns_rbt_findname(ctx->rbt, name,
|
||||
DNS_RBTFIND_EMPTYDATA,
|
||||
foundname, (void *) &n);
|
||||
ATF_CHECK(dns_name_equal(foundname, name));
|
||||
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
/* Now without EMPTYDATA */
|
||||
result = dns_rbt_findname(ctx->rbt, name, 0,
|
||||
foundname, (void *) &n);
|
||||
ATF_CHECK_EQ(result, ISC_R_NOTFOUND);
|
||||
|
||||
/* Now one that partially matches */
|
||||
dns_test_namefromstring("d.e.f.g.h.i.j", &fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
result = dns_rbt_findname(ctx->rbt, name,
|
||||
DNS_RBTFIND_EMPTYDATA,
|
||||
foundname, (void *) &n);
|
||||
ATF_CHECK_EQ(result, DNS_R_PARTIALMATCH);
|
||||
|
||||
/* Now one that doesn't match */
|
||||
dns_test_namefromstring("1.2", &fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
result = dns_rbt_findname(ctx->rbt, name,
|
||||
DNS_RBTFIND_EMPTYDATA,
|
||||
foundname, (void *) &n);
|
||||
ATF_CHECK_EQ(result, DNS_R_PARTIALMATCH);
|
||||
ATF_CHECK(dns_name_equal(foundname, dns_rootname));
|
||||
|
||||
test_context_teardown(ctx);
|
||||
|
||||
dns_test_end();
|
||||
}
|
||||
|
||||
ATF_TC(rbt_addname);
|
||||
ATF_TC_HEAD(rbt_addname, tc) {
|
||||
atf_tc_set_md_var(tc, "descr", "addname return values");
|
||||
}
|
||||
ATF_TC_BODY(rbt_addname, tc) {
|
||||
isc_result_t result;
|
||||
test_context_t *ctx = NULL;
|
||||
dns_fixedname_t fname;
|
||||
dns_name_t *name = NULL;
|
||||
size_t *n;
|
||||
|
||||
UNUSED(tc);
|
||||
|
||||
isc_mem_debugging = ISC_MEM_DEBUGRECORD;
|
||||
|
||||
result = dns_test_begin(NULL, ISC_TRUE);
|
||||
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
ctx = test_context_setup();
|
||||
|
||||
n = isc_mem_get(mctx, sizeof(size_t));
|
||||
*n = 1;
|
||||
|
||||
dns_test_namefromstring("d.e.f.g.h.i.j.k", &fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
|
||||
/* Add a name that doesn't exist */
|
||||
result = dns_rbt_addname(ctx->rbt, name, n);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
/* Now add again, should get ISC_R_EXISTS */
|
||||
n = isc_mem_get(mctx, sizeof(size_t));
|
||||
*n = 2;
|
||||
result = dns_rbt_addname(ctx->rbt, name, n);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_EXISTS);
|
||||
isc_mem_put(mctx, n, sizeof(size_t));
|
||||
|
||||
test_context_teardown(ctx);
|
||||
|
||||
dns_test_end();
|
||||
}
|
||||
|
||||
ATF_TC(rbt_deletename);
|
||||
ATF_TC_HEAD(rbt_deletename, tc) {
|
||||
atf_tc_set_md_var(tc, "descr", "deletename return values");
|
||||
}
|
||||
ATF_TC_BODY(rbt_deletename, tc) {
|
||||
isc_result_t result;
|
||||
test_context_t *ctx = NULL;
|
||||
dns_fixedname_t fname;
|
||||
dns_name_t *name = NULL;
|
||||
|
||||
UNUSED(tc);
|
||||
|
||||
isc_mem_debugging = ISC_MEM_DEBUGRECORD;
|
||||
|
||||
result = dns_test_begin(NULL, ISC_TRUE);
|
||||
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
ctx = test_context_setup();
|
||||
|
||||
/* Delete a name that doesn't exist */
|
||||
dns_test_namefromstring("z.x.y.w", &fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
result = dns_rbt_deletename(ctx->rbt, name, ISC_FALSE);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_NOTFOUND);
|
||||
|
||||
/* Now one that does */
|
||||
dns_test_namefromstring("d.e.f", &fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
result = dns_rbt_deletename(ctx->rbt, name, ISC_FALSE);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_NOTFOUND);
|
||||
|
||||
test_context_teardown(ctx);
|
||||
|
||||
dns_test_end();
|
||||
}
|
||||
|
||||
ATF_TC(rbt_nodechain);
|
||||
ATF_TC_HEAD(rbt_nodechain, tc) {
|
||||
atf_tc_set_md_var(tc, "descr", "nodechain");
|
||||
}
|
||||
ATF_TC_BODY(rbt_nodechain, tc) {
|
||||
isc_result_t result;
|
||||
test_context_t *ctx;
|
||||
dns_fixedname_t fname, found, expect;
|
||||
dns_name_t *name, *foundname, *expected;
|
||||
dns_rbtnode_t *node = NULL;
|
||||
dns_rbtnodechain_t chain;
|
||||
|
||||
UNUSED(tc);
|
||||
|
||||
isc_mem_debugging = ISC_MEM_DEBUGRECORD;
|
||||
|
||||
result = dns_test_begin(NULL, ISC_TRUE);
|
||||
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
ctx = test_context_setup();
|
||||
|
||||
dns_rbtnodechain_init(&chain, mctx);
|
||||
|
||||
dns_test_namefromstring("a", &fname);
|
||||
name = dns_fixedname_name(&fname);
|
||||
|
||||
result = dns_rbt_findnode(ctx->rbt, name, NULL,
|
||||
&node, &chain, 0, NULL, NULL);
|
||||
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
dns_fixedname_init(&found);
|
||||
foundname = dns_fixedname_name(&found);
|
||||
|
||||
dns_test_namefromstring("a", &expect);
|
||||
expected = dns_fixedname_name(&expect);
|
||||
UNUSED(expected);
|
||||
|
||||
result = dns_rbtnodechain_first(&chain, ctx->rbt, foundname, NULL);
|
||||
ATF_CHECK_EQ(result, DNS_R_NEWORIGIN);
|
||||
ATF_CHECK_EQ(dns_name_countlabels(foundname), 0);
|
||||
|
||||
result = dns_rbtnodechain_prev(&chain, NULL, NULL);
|
||||
ATF_CHECK_EQ(result, ISC_R_NOMORE);
|
||||
|
||||
result = dns_rbtnodechain_next(&chain, NULL, NULL);
|
||||
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_rbtnodechain_next(&chain, NULL, NULL);
|
||||
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_rbtnodechain_last(&chain, ctx->rbt, NULL, NULL);
|
||||
ATF_CHECK_EQ(result, DNS_R_NEWORIGIN);
|
||||
|
||||
result = dns_rbtnodechain_next(&chain, NULL, NULL);
|
||||
ATF_CHECK_EQ(result, ISC_R_NOMORE);
|
||||
|
||||
result = dns_rbtnodechain_last(&chain, ctx->rbt, NULL, NULL);
|
||||
ATF_CHECK_EQ(result, DNS_R_NEWORIGIN);
|
||||
|
||||
result = dns_rbtnodechain_prev(&chain, NULL, NULL);
|
||||
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
dns_rbtnodechain_invalidate(&chain);
|
||||
|
||||
test_context_teardown(ctx);
|
||||
|
||||
dns_test_end();
|
||||
}
|
||||
|
||||
#ifdef ISC_PLATFORM_USETHREADS
|
||||
#ifdef DNS_BENCHMARK_TESTS
|
||||
|
||||
@@ -1156,7 +1340,7 @@ ATF_TC_BODY(benchmark, tc) {
|
||||
for (i = 0; i < 4000000; i++) {
|
||||
r = ((unsigned long) random()) % maxvalue;
|
||||
snprintf(namestr, sizeof(namestr), "name%u.example.org.", r);
|
||||
build_name_from_str(namestr, &fnames[i]);
|
||||
dns_test_namefromstring(namestr, &fnames[i]);
|
||||
names[i] = dns_fixedname_name(&fnames[i]);
|
||||
values[i] = r;
|
||||
}
|
||||
@@ -1223,6 +1407,10 @@ ATF_TP_ADD_TCS(tp) {
|
||||
ATF_TP_ADD_TC(tp, rbt_insert);
|
||||
ATF_TP_ADD_TC(tp, rbt_remove);
|
||||
ATF_TP_ADD_TC(tp, rbt_insert_and_remove);
|
||||
ATF_TP_ADD_TC(tp, rbt_findname);
|
||||
ATF_TP_ADD_TC(tp, rbt_addname);
|
||||
ATF_TP_ADD_TC(tp, rbt_deletename);
|
||||
ATF_TP_ADD_TC(tp, rbt_nodechain);
|
||||
#ifdef ISC_PLATFORM_USETHREADS
|
||||
#ifdef DNS_BENCHMARK_TESTS
|
||||
ATF_TP_ADD_TC(tp, benchmark);
|
||||
|
@@ -498,33 +498,6 @@
|
||||
./bin/tests/pkcs11/pkcs11-hmacmd5.c C 2014,2015,2016,2018
|
||||
./bin/tests/pkcs11/pkcs11-md5sum.c C 2014,2015,2016,2018
|
||||
./bin/tests/ratelimiter_test.c C 1999,2000,2001,2004,2007,2015,2016,2018
|
||||
./bin/tests/rbt/Makefile.in MAKE 1999,2000,2001,2002,2004,2007,2009,2012,2014,2016,2017,2018
|
||||
./bin/tests/rbt/dns_rbt.data X 1999,2000,2001,2018
|
||||
./bin/tests/rbt/dns_rbt_addname_1_data X 1999,2000,2001,2003,2018
|
||||
./bin/tests/rbt/dns_rbt_addname_2_data X 1999,2000,2001,2018
|
||||
./bin/tests/rbt/dns_rbt_bitstring.data X 1999,2000,2001,2003,2018
|
||||
./bin/tests/rbt/dns_rbt_create_1_data X 1999,2000,2001,2018
|
||||
./bin/tests/rbt/dns_rbt_deletename_1_data X 1999,2000,2001,2003,2018
|
||||
./bin/tests/rbt/dns_rbt_deletename_2_data X 1999,2000,2001,2003,2018
|
||||
./bin/tests/rbt/dns_rbt_findname_1_data X 1999,2000,2001,2003,2018
|
||||
./bin/tests/rbt/dns_rbt_findname_2_data X 1999,2000,2001,2003,2018
|
||||
./bin/tests/rbt/dns_rbt_findname_3_data X 1999,2000,2001,2003,2018
|
||||
./bin/tests/rbt/dns_rbtnodechain_first_1.data X 1999,2000,2001,2018
|
||||
./bin/tests/rbt/dns_rbtnodechain_first_2.data X 1999,2000,2001,2018
|
||||
./bin/tests/rbt/dns_rbtnodechain_first_data X 1999,2000,2001,2018
|
||||
./bin/tests/rbt/dns_rbtnodechain_init.data X 1999,2000,2001,2018
|
||||
./bin/tests/rbt/dns_rbtnodechain_init_data X 1999,2000,2001,2018
|
||||
./bin/tests/rbt/dns_rbtnodechain_last_1.data X 1999,2000,2001,2018
|
||||
./bin/tests/rbt/dns_rbtnodechain_last_2.data X 1999,2000,2001,2018
|
||||
./bin/tests/rbt/dns_rbtnodechain_last_data X 1999,2000,2001,2018
|
||||
./bin/tests/rbt/dns_rbtnodechain_next.data X 1999,2000,2001,2018
|
||||
./bin/tests/rbt/dns_rbtnodechain_next_data X 1999,2000,2001,2018
|
||||
./bin/tests/rbt/dns_rbtnodechain_prev.data X 1999,2000,2001,2018
|
||||
./bin/tests/rbt/dns_rbtnodechain_prev_data X 1999,2000,2001,2018
|
||||
./bin/tests/rbt/t_rbt.c C 1998,1999,2000,2001,2003,2004,2005,2007,2009,2011,2012,2013,2015,2016,2018
|
||||
./bin/tests/rbt/win32/t_rbt.vcxproj.filters.in X 2013,2015,2018
|
||||
./bin/tests/rbt/win32/t_rbt.vcxproj.in X 2013,2015,2016,2017,2018
|
||||
./bin/tests/rbt/win32/t_rbt.vcxproj.user X 2013,2018
|
||||
./bin/tests/rbt_test.c C 1999,2000,2001,2004,2005,2007,2009,2011,2012,2014,2015,2016,2018
|
||||
./bin/tests/rbt_test.out X 1999,2000,2001,2018
|
||||
./bin/tests/rbt_test.txt SH 1999,2000,2001,2004,2007,2012,2016,2018
|
||||
|
@@ -122,8 +122,6 @@ my @projectlist = ("..\\bin\\check\\win32\\checkconf.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\\rbt\\win32\\t_rbt.vcxproj",
|
||||
"..\\bin\\tests\\rbt\\win32\\t_rbt.vcxproj.filters",
|
||||
"..\\bin\\tests\\system\\win32\\bigkey.vcxproj",
|
||||
"..\\bin\\tests\\system\\win32\\bigkey.vcxproj.filters",
|
||||
"..\\bin\\tests\\system\\win32\\feature-test.vcxproj",
|
||||
|
@@ -524,14 +524,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t_names", "..\bin\tests\nam
|
||||
{F6F08940-7597-4FEE-9CE0-E09A009C45A3} = {F6F08940-7597-4FEE-9CE0-E09A009C45A3}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t_rbt", "..\bin\tests\rbt\win32\t_rbt.vcxproj", "{39F714D4-FEFB-4E23-91DB-1F6FC80A98B5}"
|
||||
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}"
|
||||
|
Reference in New Issue
Block a user