mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-22 14:49:20 -04:00
migrate t_timers to lib/isc/tests/timer_test
This commit is contained in:
parent
874e2fc70c
commit
e2b8699df9
30 changed files with 657 additions and 1392 deletions
1
bin/tests/.gitignore
vendored
1
bin/tests/.gitignore
vendored
|
|
@ -16,5 +16,4 @@ keycreate
|
|||
keydelete
|
||||
gssapi_krb
|
||||
t_tasks
|
||||
t_timers
|
||||
makejournal
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
|
|||
|
||||
LIBS = @LIBS@
|
||||
|
||||
SUBDIR = db dst names \
|
||||
rbt resolver tasks timers system @PKCS11_TOOLS@ optional
|
||||
SUBDIR = db dst names rbt resolver tasks system \
|
||||
@PKCS11_TOOLS@ optional
|
||||
|
||||
TESTDIRS = system
|
||||
|
||||
|
|
|
|||
|
|
@ -1,47 +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} ${ISC_INCLUDES}
|
||||
|
||||
CDEFINES =
|
||||
CWARNINGS =
|
||||
|
||||
ISCLIBS = ../../../lib/isc/libisc.@A@ @ISC_OPENSSL_LIBS@
|
||||
|
||||
ISCDEPLIBS = ../../../lib/isc/libisc.@A@
|
||||
|
||||
DEPLIBS = ${ISCDEPLIBS}
|
||||
|
||||
LIBS = ${ISCLIBS} @LIBS@
|
||||
|
||||
TLIB = ../../../lib/tests/libt_api.@A@
|
||||
|
||||
TARGETS = t_timers@EXEEXT@
|
||||
|
||||
SRCS = t_timers.c
|
||||
|
||||
@BIND9_MAKE_RULES@
|
||||
|
||||
t_timers@EXEEXT@: t_timers.@O@ ${DEPLIBS} ${TLIB}
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ t_timers.@O@ ${TLIB} ${LIBS}
|
||||
|
||||
test: t_timers@EXEEXT@
|
||||
-@./t_timers@EXEEXT@ -c @top_srcdir@/t_config -b @srcdir@ -q 60 -a
|
||||
|
||||
testhelp:
|
||||
@./t_timers@EXEEXT@ -h
|
||||
|
||||
clean distclean::
|
||||
rm -f ${TARGETS}
|
||||
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_timers.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>{4E6F5A7C-89AA-4259-99DB-F89DAE418B3F}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>t_timers</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\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\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>@LIBXML2_LIB@libisc.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\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\tests\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>@LIBXML2_LIB@libisc.lib;libtests.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\t_timers.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/resolver/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/tasks/Makefile bin/tests/timers/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/rbt/Makefile bin/tests/resolver/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/tasks/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"
|
||||
|
||||
|
||||
#
|
||||
|
|
@ -25234,7 +25234,6 @@ do
|
|||
"bin/tests/system/rsabigexponent/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/system/rsabigexponent/Makefile" ;;
|
||||
"bin/tests/system/tkey/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/system/tkey/Makefile" ;;
|
||||
"bin/tests/tasks/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/tasks/Makefile" ;;
|
||||
"bin/tests/timers/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/timers/Makefile" ;;
|
||||
"bin/tests/virtual-time/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tests/virtual-time/Makefile" ;;
|
||||
"bin/tests/virtual-time/conf.sh") CONFIG_FILES="$CONFIG_FILES bin/tests/virtual-time/conf.sh" ;;
|
||||
"bin/tools/Makefile") CONFIG_FILES="$CONFIG_FILES bin/tools/Makefile" ;;
|
||||
|
|
|
|||
|
|
@ -5351,7 +5351,6 @@ AC_CONFIG_FILES([
|
|||
bin/tests/system/rsabigexponent/Makefile
|
||||
bin/tests/system/tkey/Makefile
|
||||
bin/tests/tasks/Makefile
|
||||
bin/tests/timers/Makefile
|
||||
bin/tests/virtual-time/Makefile
|
||||
bin/tests/virtual-time/conf.sh
|
||||
bin/tools/Makefile
|
||||
|
|
|
|||
|
|
@ -28,4 +28,5 @@ tp: socket_test
|
|||
tp: symtab_test
|
||||
tp: task_test
|
||||
tp: taskpool_test
|
||||
tp: timer_test
|
||||
tp: time_test
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ SRCS = isctest.c aes_test.c atomic_test.c buffer_test.c \
|
|||
print_test.c queue_test.c radix_test.c random_test.c \
|
||||
regex_test.c result_test.c safe_test.c sockaddr_test.c \
|
||||
socket_test.c socket_test.c symtab_test.c task_test.c \
|
||||
taskpool_test.c time_test.c
|
||||
taskpool_test.c time_test.c timer_test.c
|
||||
|
||||
SUBDIRS =
|
||||
TARGETS = aes_test@EXEEXT@ atomic_test@EXEEXT@ buffer_test@EXEEXT@ \
|
||||
|
|
@ -47,7 +47,7 @@ TARGETS = aes_test@EXEEXT@ atomic_test@EXEEXT@ buffer_test@EXEEXT@ \
|
|||
random_test@EXEEXT@ regex_test@EXEEXT@ result_test@EXEEXT@ \
|
||||
safe_test@EXEEXT@ sockaddr_test@EXEEXT@ socket_test@EXEEXT@ \
|
||||
socket_test@EXEEXT@ symtab_test@EXEEXT@ task_test@EXEEXT@ \
|
||||
taskpool_test@EXEEXT@ time_test@EXEEXT@
|
||||
taskpool_test@EXEEXT@ time_test@EXEEXT@ timer_test@EXEEXT@
|
||||
|
||||
@BIND9_MAKE_RULES@
|
||||
|
||||
|
|
@ -165,6 +165,10 @@ time_test@EXEEXT@: time_test.@O@ ${ISCDEPLIBS}
|
|||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
|
||||
time_test.@O@ ${ISCLIBS} ${LIBS}
|
||||
|
||||
timer_test@EXEEXT@: timer_test.@O@ isctest.@O@ ${ISCDEPLIBS}
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
|
||||
timer_test.@O@ isctest.@O@ ${ISCLIBS} ${LIBS}
|
||||
|
||||
unit::
|
||||
sh ${top_builddir}/unit/unittest.sh
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ ATF_TC_BODY(atomic_xadd, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
memset(counters, 0, sizeof(counters));
|
||||
|
|
@ -126,7 +126,7 @@ ATF_TC_BODY(atomic_xaddq, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
memset(counters, 0, sizeof(counters));
|
||||
|
|
@ -196,7 +196,7 @@ ATF_TC_BODY(atomic_store, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
memset(counters, 0, sizeof(counters));
|
||||
|
|
@ -273,7 +273,7 @@ ATF_TC_BODY(atomic_storeq, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
memset(counters, 0, sizeof(counters));
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ ATF_TC_BODY(isc_buffer_reserve, tc) {
|
|||
isc_result_t result;
|
||||
isc_buffer_t *b;
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
b = NULL;
|
||||
|
|
@ -105,7 +105,7 @@ ATF_TC_BODY(isc_buffer_reallocate, tc) {
|
|||
isc_result_t result;
|
||||
isc_buffer_t *b;
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
b = NULL;
|
||||
|
|
@ -142,7 +142,7 @@ ATF_TC_BODY(isc_buffer_dynamic, tc) {
|
|||
size_t last_length = 10;
|
||||
int i;
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
b = NULL;
|
||||
|
|
@ -205,7 +205,7 @@ ATF_TC_BODY(isc_buffer_printf, tc) {
|
|||
isc_buffer_t *b, sb;
|
||||
char buf[8];
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ ATF_TC_BODY(isc_counter, tc) {
|
|||
isc_counter_t *counter = NULL;
|
||||
int i;
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_counter_create(mctx, 0, &counter);
|
||||
|
|
|
|||
|
|
@ -9,12 +9,11 @@
|
|||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <isc/app.h>
|
||||
|
|
@ -70,15 +69,24 @@ cleanup_managers(void) {
|
|||
}
|
||||
|
||||
static isc_result_t
|
||||
create_managers(void) {
|
||||
create_managers(unsigned int workers) {
|
||||
isc_result_t result;
|
||||
#ifdef ISC_PLATFORM_USETHREADS
|
||||
ncpus = isc_os_ncpus();
|
||||
#else
|
||||
ncpus = 1;
|
||||
#endif
|
||||
char *p;
|
||||
|
||||
CHECK(isc_taskmgr_create(mctx, ncpus, 0, &taskmgr));
|
||||
if (workers == 0) {
|
||||
#ifdef ISC_PLATFORM_USETHREADS
|
||||
workers = isc_os_ncpus();
|
||||
#else
|
||||
workers = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
p = getenv("ISC_TASK_WORKERS");
|
||||
if (p != NULL) {
|
||||
workers = atoi(p);
|
||||
}
|
||||
|
||||
CHECK(isc_taskmgr_create(mctx, workers, 0, &taskmgr));
|
||||
CHECK(isc_task_create(taskmgr, 0, &maintask));
|
||||
isc_taskmgr_setexcltask(taskmgr, maintask);
|
||||
|
||||
|
|
@ -92,7 +100,9 @@ create_managers(void) {
|
|||
}
|
||||
|
||||
isc_result_t
|
||||
isc_test_begin(FILE *logfile, isc_boolean_t start_managers) {
|
||||
isc_test_begin(FILE *logfile, isc_boolean_t start_managers,
|
||||
unsigned int workers)
|
||||
{
|
||||
isc_result_t result;
|
||||
|
||||
isc_mem_debugging |= ISC_MEM_DEBUGRECORD;
|
||||
|
|
@ -127,8 +137,9 @@ isc_test_begin(FILE *logfile, isc_boolean_t start_managers) {
|
|||
ncpus = 1;
|
||||
#endif
|
||||
|
||||
if (start_managers)
|
||||
CHECK(create_managers());
|
||||
if (start_managers) {
|
||||
CHECK(create_managers(workers));
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@
|
|||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <config.h>
|
||||
|
|
@ -43,7 +41,18 @@ extern isc_socketmgr_t *socketmgr;
|
|||
extern int ncpus;
|
||||
|
||||
isc_result_t
|
||||
isc_test_begin(FILE *logfile, isc_boolean_t start_managers);
|
||||
isc_test_begin(FILE *logfile, isc_boolean_t start_managers,
|
||||
unsigned int workers);
|
||||
/*%<
|
||||
* Begin test, logging to 'logfile' or default if not specified.
|
||||
*
|
||||
* If 'start_managers' is set, start a task manager, timer manager,
|
||||
* and socket manager.
|
||||
*
|
||||
* If 'workers' is zero, use the number of CPUs on the system as a default;
|
||||
* otherwise, set up the task manager with the specified number of worker
|
||||
* threads. The environment variable ISC_TASK_WORKERS overrides this value.
|
||||
*/
|
||||
|
||||
void
|
||||
isc_test_end(void);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ ATF_TC_BODY(isc_mem, tc) {
|
|||
unsigned int i, j;
|
||||
int rval;
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_mem_create(0, 0, &localmctx);
|
||||
|
|
@ -152,7 +152,7 @@ ATF_TC_BODY(isc_mem_total, tc) {
|
|||
ssize_t diff;
|
||||
int i;
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
/* Local alloc, free */
|
||||
|
|
@ -219,7 +219,7 @@ ATF_TC_BODY(isc_mem_inuse, tc) {
|
|||
ssize_t diff;
|
||||
void *ptr;
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
mctx2 = NULL;
|
||||
|
|
@ -264,7 +264,7 @@ ATF_TC_BODY(isc_mem_noflags, tc) {
|
|||
result = isc_stdio_open("mem.output", "w", &f);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_mem_createx2(0, 0, default_memalloc, default_memfree,
|
||||
|
|
@ -316,7 +316,7 @@ ATF_TC_BODY(isc_mem_recordflag, tc) {
|
|||
result = isc_stdio_open("mem.output", "w", &f);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_FALSE);
|
||||
result = isc_test_begin(NULL, ISC_FALSE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_mem_createx2(0, 0, default_memalloc, default_memfree,
|
||||
|
|
@ -366,7 +366,7 @@ ATF_TC_BODY(isc_mem_traceflag, tc) {
|
|||
f = freopen("mem.output", "w", stderr);
|
||||
ATF_REQUIRE(f != NULL);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_mem_createx2(0, 0, default_memalloc, default_memfree,
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@
|
|||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <config.h>
|
||||
|
|
@ -38,7 +36,7 @@ ATF_TC_BODY(parse_overflow, tc) {
|
|||
isc_uint32_t output;
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_parse_uint32(&output, "1234567890", 10);
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@
|
|||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <config.h>
|
||||
|
|
@ -60,7 +58,7 @@ ATF_TC_BODY(create_pool, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_pool_create(mctx, 8, poolfree, poolinit, taskmgr, &pool);
|
||||
|
|
@ -84,7 +82,7 @@ ATF_TC_BODY(expand_pool, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_pool_create(mctx, 10, poolfree, poolinit, taskmgr, &pool1);
|
||||
|
|
@ -138,7 +136,7 @@ ATF_TC_BODY(get_objects, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_pool_create(mctx, 2, poolfree, poolinit, taskmgr, &pool);
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@
|
|||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <config.h>
|
||||
|
|
@ -63,7 +61,7 @@ ATF_TC_BODY(queue_valid, tc) {
|
|||
item_init(&four, 4);
|
||||
item_init(&five, 5);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
ATF_CHECK(ISC_QUEUE_EMPTY(queue));
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ ATF_TC_BODY(isc_radix_search, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_radix_create(mctx, &radix, 32);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ ATF_TC_BODY(sockaddr_hash, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
in.s_addr = inet_addr("127.0.0.1");
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ ATF_TC_BODY(udp_sendto, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
in.s_addr = inet_addr("127.0.0.1");
|
||||
|
|
@ -232,7 +232,7 @@ ATF_TC_BODY(udp_dup, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
in.s_addr = inet_addr("127.0.0.1");
|
||||
|
|
@ -334,7 +334,7 @@ ATF_TC_BODY(udp_dscp_v4, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
in.s_addr = inet_addr("127.0.0.1");
|
||||
|
|
@ -439,7 +439,7 @@ ATF_TC_BODY(udp_dscp_v6, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
n = inet_pton(AF_INET6, "::1", &in6.s6_addr);
|
||||
|
|
@ -544,7 +544,7 @@ ATF_TC_BODY(tcp_dscp_v4, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
in.s_addr = inet_addr("127.0.0.1");
|
||||
|
|
@ -644,7 +644,7 @@ ATF_TC_BODY(tcp_dscp_v6, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
n = inet_pton(AF_INET6, "::1", &in6.s6_addr);
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@
|
|||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <config.h>
|
||||
|
|
@ -50,7 +48,7 @@ ATF_TC_BODY(symtab_grow, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_symtab_create(mctx, 3, undefine, NULL, ISC_FALSE, &st);
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ ATF_TC_BODY(create_task, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_task_create(taskmgr, 0, &task);
|
||||
|
|
@ -102,7 +102,7 @@ ATF_TC_BODY(all_events, tc) {
|
|||
result = isc_mutex_init(&set_lock);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_task_create(taskmgr, 0, &task);
|
||||
|
|
@ -158,7 +158,7 @@ ATF_TC_BODY(privileged_events, tc) {
|
|||
result = isc_mutex_init(&set_lock);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
#ifdef ISC_PLATFORM_USETHREADS
|
||||
|
|
@ -287,7 +287,7 @@ ATF_TC_BODY(privilege_drop, tc) {
|
|||
result = isc_mutex_init(&set_lock);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
#ifdef ISC_PLATFORM_USETHREADS
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@
|
|||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <config.h>
|
||||
|
|
@ -39,7 +37,7 @@ ATF_TC_BODY(create_pool, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_taskpool_create(taskmgr, mctx, 8, 2, &pool);
|
||||
|
|
@ -63,7 +61,7 @@ ATF_TC_BODY(expand_pool, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_taskpool_create(taskmgr, mctx, 10, 2, &pool1);
|
||||
|
|
@ -116,7 +114,7 @@ ATF_TC_BODY(get_tasks, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_taskpool_create(taskmgr, mctx, 2, 2, &pool);
|
||||
|
|
@ -155,7 +153,7 @@ ATF_TC_BODY(set_privilege, tc) {
|
|||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE);
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 0);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_taskpool_create(taskmgr, mctx, 2, 2, &pool);
|
||||
|
|
|
|||
575
lib/isc/tests/timer_test.c
Normal file
575
lib/isc/tests/timer_test.c
Normal file
|
|
@ -0,0 +1,575 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <atf-c.h>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include <isc/condition.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/platform.h>
|
||||
#include <isc/task.h>
|
||||
#include <isc/time.h>
|
||||
#include <isc/timer.h>
|
||||
#include <isc/util.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
#include "isctest.h"
|
||||
|
||||
/*
|
||||
* Helper functions
|
||||
*/
|
||||
#define FUDGE_SECONDS 0 /* in absence of clock_getres() */
|
||||
#define FUDGE_NANOSECONDS 500000000 /* in absence of clock_getres() */
|
||||
|
||||
static isc_timer_t *timer = NULL;
|
||||
static isc_condition_t cv;
|
||||
static isc_mutex_t mx;
|
||||
static isc_time_t endtime;
|
||||
static isc_time_t lasttime;
|
||||
static int seconds;
|
||||
static int nanoseconds;
|
||||
static int eventcnt;
|
||||
static int nevents;
|
||||
|
||||
static void
|
||||
shutdown(isc_task_t *task, isc_event_t *event) {
|
||||
isc_result_t result;
|
||||
|
||||
UNUSED(task);
|
||||
|
||||
/*
|
||||
* Signal shutdown processing complete.
|
||||
*/
|
||||
result = isc_mutex_lock(&mx);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_condition_signal(&cv);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_mutex_unlock(&mx);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_event_free(&event);
|
||||
}
|
||||
|
||||
static void
|
||||
setup_test(isc_timertype_t timertype, isc_time_t *expires,
|
||||
isc_interval_t *interval,
|
||||
void (*action)(isc_task_t *, isc_event_t *))
|
||||
{
|
||||
isc_result_t result;
|
||||
isc_task_t *task = NULL;
|
||||
isc_time_settoepoch(&endtime);
|
||||
eventcnt = 0;
|
||||
|
||||
result = isc_mutex_init(&mx);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_condition_init(&cv);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
LOCK(&mx);
|
||||
|
||||
result = isc_task_create(taskmgr, 0, &task);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_task_onshutdown(task, shutdown, NULL);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_time_now(&lasttime);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_timer_create(timermgr, timertype, expires, interval,
|
||||
task, action, (void *)timertype,
|
||||
&timer);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
/*
|
||||
* Wait for shutdown processing to complete.
|
||||
*/
|
||||
while (eventcnt != nevents) {
|
||||
result = isc_condition_wait(&cv, &mx);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
UNLOCK(&mx);
|
||||
|
||||
isc_task_detach(&task);
|
||||
DESTROYLOCK(&mx);
|
||||
(void) isc_condition_destroy(&cv);
|
||||
}
|
||||
|
||||
static void
|
||||
ticktock(isc_task_t *task, isc_event_t *event) {
|
||||
isc_result_t result;
|
||||
isc_time_t now;
|
||||
isc_time_t base;
|
||||
isc_time_t ulim;
|
||||
isc_time_t llim;
|
||||
isc_interval_t interval;
|
||||
isc_eventtype_t expected_event_type;
|
||||
|
||||
++eventcnt;
|
||||
|
||||
printf("tick %d\n", eventcnt);
|
||||
|
||||
expected_event_type = ISC_TIMEREVENT_LIFE;
|
||||
if ((isc_timertype_t) event->ev_arg == isc_timertype_ticker) {
|
||||
expected_event_type = ISC_TIMEREVENT_TICK;
|
||||
}
|
||||
|
||||
if (event->ev_type != expected_event_type) {
|
||||
printf("expected event type %d, got %d\n",
|
||||
expected_event_type, (int) event->ev_type);
|
||||
}
|
||||
|
||||
result = isc_time_now(&now);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_interval_set(&interval, seconds, nanoseconds);
|
||||
result = isc_time_add(&lasttime, &interval, &base);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_interval_set(&interval, FUDGE_SECONDS, FUDGE_NANOSECONDS);
|
||||
result = isc_time_add(&base, &interval, &ulim);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_time_subtract(&base, &interval, &llim);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
ATF_CHECK(isc_time_compare(&llim, &now) <= 0);
|
||||
ATF_CHECK(isc_time_compare(&ulim, &now) >= 0);
|
||||
lasttime = now;
|
||||
|
||||
if (eventcnt == nevents) {
|
||||
result = isc_time_now(&endtime);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
isc_timer_detach(&timer);
|
||||
isc_task_shutdown(task);
|
||||
}
|
||||
|
||||
isc_event_free(&event);
|
||||
}
|
||||
|
||||
/*
|
||||
* Individual unit tests
|
||||
*/
|
||||
|
||||
ATF_TC(ticker);
|
||||
ATF_TC_HEAD(ticker, tc) {
|
||||
atf_tc_set_md_var(tc, "descr", "timer type ticker");
|
||||
}
|
||||
ATF_TC_BODY(ticker, tc) {
|
||||
isc_result_t result;
|
||||
isc_time_t expires;
|
||||
isc_interval_t interval;
|
||||
|
||||
UNUSED(tc);
|
||||
|
||||
nevents = 12;
|
||||
seconds = 0;
|
||||
nanoseconds = 500000000;
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 2);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_interval_set(&interval, seconds, nanoseconds);
|
||||
isc_time_settoepoch(&expires);
|
||||
|
||||
setup_test(isc_timertype_ticker, &expires, &interval, ticktock);
|
||||
|
||||
isc_test_end();
|
||||
}
|
||||
|
||||
ATF_TC(once_life);
|
||||
ATF_TC_HEAD(once_life, tc) {
|
||||
atf_tc_set_md_var(tc, "descr", "timer type once reaches lifetime");
|
||||
}
|
||||
ATF_TC_BODY(once_life, tc) {
|
||||
isc_result_t result;
|
||||
isc_time_t expires;
|
||||
isc_interval_t interval;
|
||||
|
||||
UNUSED(tc);
|
||||
|
||||
nevents = 1;
|
||||
seconds = 1;
|
||||
nanoseconds = 100000000;
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 2);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_interval_set(&interval, seconds, nanoseconds);
|
||||
result = isc_time_nowplusinterval(&expires, &interval);
|
||||
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_interval_set(&interval, 0, 0);
|
||||
|
||||
setup_test(isc_timertype_once, &expires, &interval, ticktock);
|
||||
|
||||
isc_test_end();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
test_idle(isc_task_t *task, isc_event_t *event) {
|
||||
isc_result_t result;
|
||||
isc_time_t now;
|
||||
isc_time_t base;
|
||||
isc_time_t ulim;
|
||||
isc_time_t llim;
|
||||
isc_interval_t interval;
|
||||
|
||||
++eventcnt;
|
||||
|
||||
printf("tick %d\n", eventcnt);
|
||||
|
||||
result = isc_time_now(&now);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_interval_set(&interval, seconds, nanoseconds);
|
||||
result = isc_time_add(&lasttime, &interval, &base);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_interval_set(&interval, FUDGE_SECONDS, FUDGE_NANOSECONDS);
|
||||
result = isc_time_add(&base, &interval, &ulim);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_time_subtract(&base, &interval, &llim);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
ATF_CHECK(isc_time_compare(&llim, &now) <= 0);
|
||||
ATF_CHECK(isc_time_compare(&ulim, &now) >= 0);
|
||||
lasttime = now;
|
||||
|
||||
ATF_CHECK_EQ(event->ev_type, ISC_TIMEREVENT_IDLE);
|
||||
|
||||
isc_timer_detach(&timer);
|
||||
isc_task_shutdown(task);
|
||||
isc_event_free(&event);
|
||||
}
|
||||
|
||||
ATF_TC(once_idle);
|
||||
ATF_TC_HEAD(once_idle, tc) {
|
||||
atf_tc_set_md_var(tc, "descr", "timer type once idles out");
|
||||
}
|
||||
ATF_TC_BODY(once_idle, tc) {
|
||||
isc_result_t result;
|
||||
isc_time_t expires;
|
||||
isc_interval_t interval;
|
||||
|
||||
UNUSED(tc);
|
||||
|
||||
nevents = 1;
|
||||
seconds = 1;
|
||||
nanoseconds = 200000000;
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 2);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_interval_set(&interval, seconds + 1, nanoseconds);
|
||||
result = isc_time_nowplusinterval(&expires, &interval);
|
||||
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_interval_set(&interval, seconds, nanoseconds);
|
||||
|
||||
setup_test(isc_timertype_once, &expires, &interval, test_idle);
|
||||
|
||||
isc_test_end();
|
||||
}
|
||||
|
||||
static void
|
||||
test_reset(isc_task_t *task, isc_event_t *event) {
|
||||
isc_result_t result;
|
||||
isc_time_t now;
|
||||
isc_time_t base;
|
||||
isc_time_t ulim;
|
||||
isc_time_t llim;
|
||||
isc_time_t expires;
|
||||
isc_interval_t interval;
|
||||
|
||||
++eventcnt;
|
||||
|
||||
printf("tick %d\n", eventcnt);
|
||||
|
||||
/*
|
||||
* Check expired time.
|
||||
*/
|
||||
|
||||
result = isc_time_now(&now);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_interval_set(&interval, seconds, nanoseconds);
|
||||
result = isc_time_add(&lasttime, &interval, &base);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_interval_set(&interval, FUDGE_SECONDS, FUDGE_NANOSECONDS);
|
||||
result = isc_time_add(&base, &interval, &ulim);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_time_subtract(&base, &interval, &llim);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
ATF_CHECK(isc_time_compare(&llim, &now) <= 0);
|
||||
ATF_CHECK(isc_time_compare(&ulim, &now) >= 0);
|
||||
lasttime = now;
|
||||
|
||||
if (eventcnt < 3) {
|
||||
ATF_CHECK_EQ(event->ev_type, ISC_TIMEREVENT_TICK);
|
||||
|
||||
if (eventcnt == 2) {
|
||||
isc_interval_set(&interval, seconds, nanoseconds);
|
||||
result = isc_time_nowplusinterval(&expires, &interval);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_interval_set(&interval, 0, 0);
|
||||
result = isc_timer_reset(timer, isc_timertype_once,
|
||||
&expires, &interval,
|
||||
ISC_FALSE);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
}
|
||||
} else {
|
||||
ATF_CHECK_EQ(event->ev_type, ISC_TIMEREVENT_LIFE);
|
||||
|
||||
isc_timer_detach(&timer);
|
||||
isc_task_shutdown(task);
|
||||
}
|
||||
|
||||
isc_event_free(&event);
|
||||
}
|
||||
|
||||
ATF_TC(reset);
|
||||
ATF_TC_HEAD(reset, tc) {
|
||||
atf_tc_set_md_var(tc, "descr", "timer reset");
|
||||
}
|
||||
ATF_TC_BODY(reset, tc) {
|
||||
isc_result_t result;
|
||||
isc_time_t expires;
|
||||
isc_interval_t interval;
|
||||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 2);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
nevents = 3;
|
||||
seconds = 0;
|
||||
nanoseconds = 750000000;
|
||||
|
||||
isc_interval_set(&interval, seconds, nanoseconds);
|
||||
isc_time_settoepoch(&expires);
|
||||
|
||||
setup_test(isc_timertype_ticker, &expires, &interval, test_reset);
|
||||
|
||||
isc_test_end();
|
||||
}
|
||||
|
||||
static int startflag;
|
||||
static int shutdownflag;
|
||||
static isc_timer_t *tickertimer = NULL;
|
||||
static isc_timer_t *oncetimer = NULL;
|
||||
static isc_task_t *task1 = NULL;
|
||||
static isc_task_t *task2 = NULL;
|
||||
|
||||
/*
|
||||
* task1 blocks on mx while events accumulate
|
||||
* in its queue, until signaled by task2.
|
||||
*/
|
||||
|
||||
static void
|
||||
start_event(isc_task_t *task, isc_event_t *event) {
|
||||
UNUSED(task);
|
||||
|
||||
printf("start_event\n");
|
||||
|
||||
LOCK(&mx);
|
||||
while (! startflag) {
|
||||
(void) isc_condition_wait(&cv, &mx);
|
||||
}
|
||||
UNLOCK(&mx);
|
||||
|
||||
isc_event_free(&event);
|
||||
}
|
||||
|
||||
static void
|
||||
tick_event(isc_task_t *task, isc_event_t *event) {
|
||||
isc_result_t result;
|
||||
isc_time_t expires;
|
||||
isc_interval_t interval;
|
||||
|
||||
UNUSED(task);
|
||||
|
||||
++eventcnt;
|
||||
printf("tick_event %d\n", eventcnt);
|
||||
|
||||
/*
|
||||
* On the first tick, purge all remaining tick events
|
||||
* and then shut down the task.
|
||||
*/
|
||||
if (eventcnt == 1) {
|
||||
isc_time_settoepoch(&expires);
|
||||
isc_interval_set(&interval, seconds, 0);
|
||||
result = isc_timer_reset(tickertimer, isc_timertype_ticker,
|
||||
&expires, &interval, ISC_TRUE);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_task_shutdown(task);
|
||||
}
|
||||
|
||||
isc_event_free(&event);
|
||||
}
|
||||
|
||||
static void
|
||||
once_event(isc_task_t *task, isc_event_t *event) {
|
||||
isc_result_t result;
|
||||
|
||||
printf("once_event\n");
|
||||
|
||||
/*
|
||||
* Allow task1 to start processing events.
|
||||
*/
|
||||
LOCK(&mx);
|
||||
startflag = 1;
|
||||
|
||||
result = isc_condition_broadcast(&cv);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
UNLOCK(&mx);
|
||||
|
||||
isc_event_free(&event);
|
||||
isc_task_shutdown(task);
|
||||
}
|
||||
|
||||
static void
|
||||
shutdown_purge(isc_task_t *task, isc_event_t *event) {
|
||||
isc_result_t result;
|
||||
|
||||
UNUSED(task);
|
||||
UNUSED(event);
|
||||
|
||||
printf("shutdown_event\n");
|
||||
|
||||
/*
|
||||
* Signal shutdown processing complete.
|
||||
*/
|
||||
LOCK(&mx);
|
||||
shutdownflag = 1;
|
||||
|
||||
result = isc_condition_signal(&cv);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
UNLOCK(&mx);
|
||||
|
||||
isc_event_free(&event);
|
||||
}
|
||||
|
||||
ATF_TC(purge);
|
||||
ATF_TC_HEAD(purge, tc) {
|
||||
atf_tc_set_md_var(tc, "descr", "timer events purged");
|
||||
}
|
||||
ATF_TC_BODY(purge, tc) {
|
||||
isc_result_t result;
|
||||
isc_event_t *event = NULL;
|
||||
isc_time_t expires;
|
||||
isc_interval_t interval;
|
||||
|
||||
UNUSED(tc);
|
||||
|
||||
result = isc_test_begin(NULL, ISC_TRUE, 2);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
startflag = 0;
|
||||
shutdownflag = 0;
|
||||
eventcnt = 0;
|
||||
seconds = 1;
|
||||
nanoseconds = 0;
|
||||
|
||||
result = isc_mutex_init(&mx);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_condition_init(&cv);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_task_create(taskmgr, 0, &task1);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_task_onshutdown(task1, shutdown_purge, NULL);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = isc_task_create(taskmgr, 0, &task2);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
LOCK(&mx);
|
||||
|
||||
event = isc_event_allocate(mctx, (void *)1 , (isc_eventtype_t)1,
|
||||
start_event, NULL, sizeof(*event));
|
||||
ATF_REQUIRE(event != NULL);
|
||||
isc_task_send(task1, &event);
|
||||
|
||||
isc_time_settoepoch(&expires);
|
||||
isc_interval_set(&interval, seconds, 0);
|
||||
|
||||
tickertimer = NULL;
|
||||
result = isc_timer_create(timermgr, isc_timertype_ticker,
|
||||
&expires, &interval, task1,
|
||||
tick_event, NULL, &tickertimer);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
oncetimer = NULL;
|
||||
|
||||
isc_interval_set(&interval, (seconds * 2) + 1, 0);
|
||||
result = isc_time_nowplusinterval(&expires, &interval);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
isc_interval_set(&interval, 0, 0);
|
||||
result = isc_timer_create(timermgr, isc_timertype_once,
|
||||
&expires, &interval, task2,
|
||||
once_event, NULL, &oncetimer);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
/*
|
||||
* Wait for shutdown processing to complete.
|
||||
*/
|
||||
while (! shutdownflag) {
|
||||
result = isc_condition_wait(&cv, &mx);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
UNLOCK(&mx);
|
||||
|
||||
ATF_CHECK_EQ(eventcnt, 1);
|
||||
|
||||
isc_timer_detach(&tickertimer);
|
||||
isc_timer_detach(&oncetimer);
|
||||
isc_task_destroy(&task1);
|
||||
isc_task_destroy(&task2);
|
||||
DESTROYLOCK(&mx);
|
||||
|
||||
isc_test_end();
|
||||
}
|
||||
|
||||
/*
|
||||
* Main
|
||||
*/
|
||||
ATF_TP_ADD_TCS(tp) {
|
||||
#ifdef ISC_PLATFORM_USETHREADS
|
||||
ATF_TP_ADD_TC(tp, ticker);
|
||||
ATF_TP_ADD_TC(tp, once_life);
|
||||
ATF_TP_ADD_TC(tp, once_idle);
|
||||
ATF_TP_ADD_TC(tp, reset);
|
||||
ATF_TP_ADD_TC(tp, purge);
|
||||
#endif
|
||||
|
||||
return (atf_no_error());
|
||||
}
|
||||
|
|
@ -2470,11 +2470,6 @@
|
|||
./bin/tests/tasks/win32/t_tasks.vcxproj.in X 2013,2015,2016,2017,2018
|
||||
./bin/tests/tasks/win32/t_tasks.vcxproj.user X 2013,2015,2018
|
||||
./bin/tests/timer_test.c C 1998,1999,2000,2001,2004,2007,2013,2014,2015,2016,2018
|
||||
./bin/tests/timers/Makefile.in MAKE 1999,2000,2001,2002,2004,2007,2009,2012,2014,2016,2017,2018
|
||||
./bin/tests/timers/t_timers.c C 1999,2000,2001,2004,2007,2008,2009,2011,2013,2016,2018
|
||||
./bin/tests/timers/win32/t_timers.vcxproj.filters.in X 2013,2015,2018
|
||||
./bin/tests/timers/win32/t_timers.vcxproj.in X 2013,2015,2016,2017,2018
|
||||
./bin/tests/timers/win32/t_timers.vcxproj.user X 2013,2018
|
||||
./bin/tests/virtual-time/Makefile.in MAKE 2010,2012,2016,2018
|
||||
./bin/tests/virtual-time/README TXT.BRIEF 2010,2016,2018
|
||||
./bin/tests/virtual-time/autosign-ksk/clean.sh SH 2010,2012,2015,2016,2018
|
||||
|
|
|
|||
|
|
@ -140,8 +140,6 @@ my @projectlist = ("..\\bin\\check\\win32\\checkconf.vcxproj",
|
|||
"..\\bin\\tests\\system\\win32\\pipequeries.vcxproj.filters",
|
||||
"..\\bin\\tests\\tasks\\win32\\t_tasks.vcxproj",
|
||||
"..\\bin\\tests\\tasks\\win32\\t_tasks.vcxproj.filters",
|
||||
"..\\bin\\tests\\timers\\win32\\t_timers.vcxproj",
|
||||
"..\\bin\\tests\\timers\\win32\\t_timers.vcxproj.filters",
|
||||
"..\\bin\\tests\\win32\\backtrace_test.vcxproj",
|
||||
"..\\bin\\tests\\win32\\backtrace_test.vcxproj.filters",
|
||||
"..\\bin\\tests\\win32\\inter_test.vcxproj",
|
||||
|
|
|
|||
|
|
@ -546,12 +546,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t_tasks", "..\bin\tests\tas
|
|||
{F6F08940-7597-4FEE-9CE0-E09A009C45A3} = {F6F08940-7597-4FEE-9CE0-E09A009C45A3}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t_timers", "..\bin\tests\timers\win32\t_timers.vcxproj", "{4E6F5A7C-89AA-4259-99DB-F89DAE418B3F}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{3840E563-D180-4761-AA9C-E6155F02EAFF} = {3840E563-D180-4761-AA9C-E6155F02EAFF}
|
||||
{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}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue