moved rtabmap-ros-pkg project in this project

git-svn-id: http://rtabmap.googlecode.com/svn/branches/0.3/rtabmap@52 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2011-06-05 14:45:39 +00:00
commit 2d73090f3a
338 changed files with 56859 additions and 0 deletions
+663
View File
@@ -0,0 +1,663 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="0.1790260204">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1790260204" moduleId="org.eclipse.cdt.core.settings" name="Unix">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.SOM" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.MachO" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="RTAB-Map" buildProperties="" description="Ubuntu 9.10" id="0.1790260204" name="Unix" parent="org.eclipse.cdt.build.core.prefbase.cfg">
<folderInfo id="0.1790260204." name="/" resourcePath="">
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.379189688" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.MachO;org.eclipse.cdt.core.SOM;org.eclipse.cdt.core.PE" id="org.eclipse.cdt.build.core.prefbase.toolchain.379189688.899900990" name=""/>
<builder arguments="-C ${ProjDirPath}/build VERBOSE=true" buildPath="${workspace_loc:/RTAB-Map}" command="make" id="org.eclipse.cdt.build.core.settings.default.builder.1868197384" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.45793018" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.894008781" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1694566822" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.1789919121" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1666253491" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.1172725717" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.230409752" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="build" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<scannerConfigBuildInfo instanceId="0.1790260204.1906025362">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1790260204">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="CMake-MinGW-Debug" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>cmake</buildCommand>
<buildArguments>-E chdir build/ cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=Debug ../</buildArguments>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="CMake-MinGW-Release" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>cmake</buildCommand>
<buildArguments>-E chdir build/ cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=Release ../</buildArguments>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="CMake-Unix-Debug" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>cmake</buildCommand>
<buildArguments>-E chdir build/ cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../</buildArguments>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="CMake-Unix-Release" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>cmake</buildCommand>
<buildArguments>-E chdir build/ cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release ../</buildArguments>
<buildTarget/>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
</buildTargets>
</storageModule>
</cconfiguration>
<cconfiguration id="0.1790260204.1906025362">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1790260204.1906025362" moduleId="org.eclipse.cdt.core.settings" name="MinGW">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.SOM" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.MachO" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="RTAB-Map" buildProperties="" description="Windows XP" id="0.1790260204.1906025362" name="MinGW" parent="org.eclipse.cdt.build.core.prefbase.cfg">
<folderInfo id="0.1790260204.1906025362." name="/" resourcePath="">
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1655844623" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.MachO;org.eclipse.cdt.core.SOM;org.eclipse.cdt.core.PE" id="org.eclipse.cdt.build.core.prefbase.toolchain.1655844623.223670391" name=""/>
<builder arguments="-C ${ProjDirPath}/build VERBOSE=true" buildPath="${workspace_loc:/RTAB-Map}" command="mingw32-make" id="org.eclipse.cdt.build.core.settings.default.builder.1893174344" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.359841287" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.2036478542" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.undef.incpaths.562568401" name="Undefined Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.undef.incpaths" valueType="undefIncludePath">
<listOptionValue builtIn="false" value="C:/OpenCV2.0/include/opencv"/>
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1080087738" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.2076089335" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.865357815" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.469283430" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1452552582" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="build" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<scannerConfigBuildInfo instanceId="0.1790260204.1906025362">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1790260204">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="CMake-MinGW-Debug" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>cmake</buildCommand>
<buildArguments>-E chdir build/ cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=Debug ../</buildArguments>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="CMake-MinGW-Release" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>cmake</buildCommand>
<buildArguments>-E chdir build/ cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=Release ../</buildArguments>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="CMake-Unix-Debug" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>cmake</buildCommand>
<buildArguments>-E chdir build/ cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../</buildArguments>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="CMake-Unix-Release" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>cmake</buildCommand>
<buildArguments>-E chdir build/ cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release ../</buildArguments>
<buildTarget/>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
</buildTargets>
</storageModule>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="CTAB-Map.null.2089313587" name="CTAB-Map"/>
</storageModule>
</cproject>
+82
View File
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>rtabmap</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value>-C ${ProjDirPath}/build VERBOSE=true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc:/RTAB-Map}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>false</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>
+76
View File
@@ -0,0 +1,76 @@
#ifndef CPPUNIT_ADDITIONALMESSAGE_H
#define CPPUNIT_ADDITIONALMESSAGE_H
#include <cppunit/Message.h>
CPPUNIT_NS_BEGIN
/*! \brief An additional Message for assertions.
* \ingroup CreatingNewAssertions
*
* Provides a implicit constructor that takes a single string. This allow this
* class to be used as the message arguments in macros.
*
* The constructed object is either a Message with a single detail string if
* a string was passed to the macro, or a copy of the Message passed to the macro.
*
* Here is an example of usage:
* \code
*
* void checkStringEquals( const std::string &expected,
* const std::string &actual,
* const CppUnit::SourceLine &sourceLine,
* const CppUnit::AdditionalMessage &message );
*
* #define XTLUT_ASSERT_STRING_EQUAL_MESSAGE( expected, actual, message ) \
* ::XtlUt::Impl::checkStringEquals( ::Xtl::toString(expected), \
* ::Xtl::toString(actual), \
* CPPUNIT_SOURCELINE(), \
* message )
* \endcode
*
* In the previous example, the user can specify a simple string for \a message,
* or a complex Message object.
*
* \see Message
*/
class CPPUNIT_API AdditionalMessage : public Message
{
public:
typedef Message SuperClass;
/// Constructs an empty Message.
AdditionalMessage();
/*! \brief Constructs a Message with the specified detail string.
* \param detail1 Detail string of the message. If empty, then it is not added.
*/
AdditionalMessage( const std::string &detail1 );
/*! \brief Constructs a Message with the specified detail string.
* \param detail1 Detail string of the message. If empty, then it is not added.
*/
AdditionalMessage( const char *detail1 );
/*! \brief Constructs a copy of the specified message.
* \param other Message to copy.
*/
AdditionalMessage( const Message &other );
/*! \brief Assignment operator.
* \param other Message to copy.
* \return Reference on this object.
*/
AdditionalMessage &operator =( const Message &other );
private:
};
CPPUNIT_NS_END
#endif // CPPUNIT_ADDITIONALMESSAGE_H
+143
View File
@@ -0,0 +1,143 @@
#ifndef CPPUNIT_ASSERTER_H
#define CPPUNIT_ASSERTER_H
#include <cppunit/AdditionalMessage.h>
#include <cppunit/SourceLine.h>
#include <string>
CPPUNIT_NS_BEGIN
class Message;
/*! \brief A set of functions to help writing assertion macros.
* \ingroup CreatingNewAssertions
*
* Here is an example of assertion, a simplified version of the
* actual assertion implemented in examples/cppunittest/XmlUniformiser.h:
* \code
* #include <cppunit/SourceLine.h>
* #include <cppunit/TestAssert.h>
*
* void
* checkXmlEqual( std::string expectedXml,
* std::string actualXml,
* CppUnit::SourceLine sourceLine )
* {
* std::string expected = XmlUniformiser( expectedXml ).stripped();
* std::string actual = XmlUniformiser( actualXml ).stripped();
*
* if ( expected == actual )
* return;
*
* ::CppUnit::Asserter::failNotEqual( expected,
* actual,
* sourceLine );
* }
*
* /// Asserts that two XML strings are equivalent.
* #define CPPUNITTEST_ASSERT_XML_EQUAL( expected, actual ) \
* checkXmlEqual( expected, actual, \
* CPPUNIT_SOURCELINE() )
* \endcode
*/
struct Asserter
{
/*! \brief Throws a Exception with the specified message and location.
*/
static void CPPUNIT_API fail( const Message &message,
const SourceLine &sourceLine = SourceLine() );
/*! \brief Throws a Exception with the specified message and location.
* \deprecated Use fail( Message, SourceLine ) instead.
*/
static void CPPUNIT_API fail( std::string message,
const SourceLine &sourceLine = SourceLine() );
/*! \brief Throws a Exception with the specified message and location.
* \param shouldFail if \c true then the exception is thrown. Otherwise
* nothing happen.
* \param message Message explaining the assertion failiure.
* \param sourceLine Location of the assertion.
*/
static void CPPUNIT_API failIf( bool shouldFail,
const Message &message,
const SourceLine &sourceLine = SourceLine() );
/*! \brief Throws a Exception with the specified message and location.
* \deprecated Use failIf( bool, Message, SourceLine ) instead.
* \param shouldFail if \c true then the exception is thrown. Otherwise
* nothing happen.
* \param message Message explaining the assertion failiure.
* \param sourceLine Location of the assertion.
*/
static void CPPUNIT_API failIf( bool shouldFail,
std::string message,
const SourceLine &sourceLine = SourceLine() );
/*! \brief Returns a expected value string for a message.
* Typically used to create 'not equal' message, or to check that a message
* contains the expected content when writing unit tests for your custom
* assertions.
*
* \param expectedValue String that represents the expected value.
* \return \a expectedValue prefixed with "Expected: ".
* \see makeActual().
*/
static std::string CPPUNIT_API makeExpected( const std::string &expectedValue );
/*! \brief Returns an actual value string for a message.
* Typically used to create 'not equal' message, or to check that a message
* contains the expected content when writing unit tests for your custom
* assertions.
*
* \param actualValue String that represents the actual value.
* \return \a actualValue prefixed with "Actual : ".
* \see makeExpected().
*/
static std::string CPPUNIT_API makeActual( const std::string &actualValue );
static Message CPPUNIT_API makeNotEqualMessage( const std::string &expectedValue,
const std::string &actualValue,
const AdditionalMessage &additionalMessage = AdditionalMessage(),
const std::string &shortDescription = "equality assertion failed");
/*! \brief Throws an Exception with the specified message and location.
* \param expected Text describing the expected value.
* \param actual Text describing the actual value.
* \param sourceLine Location of the assertion.
* \param additionalMessage Additional message. Usually used to report
* what are the differences between the expected and actual value.
* \param shortDescription Short description for the failure message.
*/
static void CPPUNIT_API failNotEqual( std::string expected,
std::string actual,
const SourceLine &sourceLine,
const AdditionalMessage &additionalMessage = AdditionalMessage(),
std::string shortDescription = "equality assertion failed" );
/*! \brief Throws an Exception with the specified message and location.
* \param shouldFail if \c true then the exception is thrown. Otherwise
* nothing happen.
* \param expected Text describing the expected value.
* \param actual Text describing the actual value.
* \param sourceLine Location of the assertion.
* \param additionalMessage Additional message. Usually used to report
* where the "difference" is located.
* \param shortDescription Short description for the failure message.
*/
static void CPPUNIT_API failNotEqualIf( bool shouldFail,
std::string expected,
std::string actual,
const SourceLine &sourceLine,
const AdditionalMessage &additionalMessage = AdditionalMessage(),
std::string shortDescription = "equality assertion failed" );
};
CPPUNIT_NS_END
#endif // CPPUNIT_ASSERTER_H
+43
View File
@@ -0,0 +1,43 @@
#ifndef CPPUNIT_BRIEFTESTPROGRESSLISTENER_H
#define CPPUNIT_BRIEFTESTPROGRESSLISTENER_H
#include <cppunit/TestListener.h>
CPPUNIT_NS_BEGIN
/*! \brief TestListener that prints the name of each test before running it.
* \ingroup TrackingTestExecution
*/
class CPPUNIT_API BriefTestProgressListener : public TestListener
{
public:
/*! Constructs a BriefTestProgressListener object.
*/
BriefTestProgressListener();
/// Destructor.
virtual ~BriefTestProgressListener();
void startTest( Test *test );
void addFailure( const TestFailure &failure );
void endTest( Test *test );
private:
/// Prevents the use of the copy constructor.
BriefTestProgressListener( const BriefTestProgressListener &copy );
/// Prevents the use of the copy operator.
void operator =( const BriefTestProgressListener &copy );
private:
bool m_lastTestFailed;
};
CPPUNIT_NS_END
#endif // CPPUNIT_BRIEFTESTPROGRESSLISTENER_H
+146
View File
@@ -0,0 +1,146 @@
#ifndef CPPUNIT_COMPILERTESTRESULTOUTPUTTER_H
#define CPPUNIT_COMPILERTESTRESULTOUTPUTTER_H
#include <cppunit/Portability.h>
#include <cppunit/Outputter.h>
#include <cppunit/portability/Stream.h>
CPPUNIT_NS_BEGIN
class Exception;
class SourceLine;
class Test;
class TestFailure;
class TestResultCollector;
/*!
* \brief Outputs a TestResultCollector in a compiler compatible format.
* \ingroup WritingTestResult
*
* Printing the test results in a compiler compatible format (assertion
* location has the same format as compiler error), allow you to use your
* IDE to jump to the assertion failure. Location format can be customized (see
* setLocationFormat() ).
*
* For example, when running the test in a post-build with VC++, if an assertion
* fails, you can jump to the assertion by pressing F4 (jump to next error).
*
* Heres is an example of usage (from examples/cppunittest/CppUnitTestMain.cpp):
* \code
* int main( int argc, char* argv[] ) {
* // if command line contains "-selftest" then this is the post build check
* // => the output must be in the compiler error format.
* bool selfTest = (argc > 1) &&
* (std::string("-selftest") == argv[1]);
*
* CppUnit::TextUi::TestRunner runner;
* runner.addTest( CppUnitTest::suite() ); // Add the top suite to the test runner
*
* if ( selfTest )
* { // Change the default outputter to a compiler error format outputter
* // The test runner owns the new outputter.
* runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
* std::cerr ) );
* }
*
* // Run the test and don't wait a key if post build check.
* bool wasSuccessful = runner.run( "", !selfTest );
*
* // Return error code 1 if the one of test failed.
* return wasSuccessful ? 0 : 1;
* }
* \endcode
*/
class CPPUNIT_API CompilerOutputter : public Outputter
{
public:
/*! \brief Constructs a CompilerOutputter object.
* \param result Result of the test run.
* \param stream Stream used to output test result.
* \param locationFormat Error location format used by your compiler. Default
* to \c CPPUNIT_COMPILER_LOCATION_FORMAT which is defined
* in the configuration file. See setLocationFormat() for detail.
* \see setLocationFormat().
*/
CompilerOutputter( TestResultCollector *result,
OStream &stream,
const std::string &locationFormat = CPPUNIT_COMPILER_LOCATION_FORMAT );
/// Destructor.
virtual ~CompilerOutputter();
/*! \brief Sets the error location format.
*
* Indicates the format used to report location of failed assertion. This format should
* match the one used by your compiler.
*
* The location format is a string in which the occurence of the following character
* sequence are replaced:
*
* - "%l" => replaced by the line number
* - "%p" => replaced by the full path name of the file ("G:\prg\vc\cppunit\MyTest.cpp")
* - "%f" => replaced by the base name of the file ("MyTest.cpp")
*
* Some examples:
*
* - VC++ error location format: "%p(%l):" => produce "G:\prg\MyTest.cpp(43):"
* - GCC error location format: "%f:%l:" => produce "MyTest.cpp:43:"
*
* Thoses are the two compilers currently <em>supported</em> (gcc format is used if
* VC++ is not detected). If you want your compiler to be automatically supported by
* CppUnit, send a mail to the mailing list (preferred), or submit a feature request
* that indicates how to detect your compiler with the preprocessor (\#ifdef...) and
* your compiler location format.
*/
void setLocationFormat( const std::string &locationFormat );
/*! \brief Creates an instance of an outputter that matches your current compiler.
* \deprecated This class is specialized through parameterization instead of subclassing...
* Use CompilerOutputter::CompilerOutputter instead.
*/
static CompilerOutputter *defaultOutputter( TestResultCollector *result,
OStream &stream );
void write();
void setNoWrap();
void setWrapColumn( int wrapColumn );
int wrapColumn() const;
virtual void printSuccess();
virtual void printFailureReport();
virtual void printFailuresList();
virtual void printStatistics();
virtual void printFailureDetail( TestFailure *failure );
virtual void printFailureLocation( SourceLine sourceLine );
virtual void printFailureType( TestFailure *failure );
virtual void printFailedTestName( TestFailure *failure );
virtual void printFailureMessage( TestFailure *failure );
private:
/// Prevents the use of the copy constructor.
CompilerOutputter( const CompilerOutputter &copy );
/// Prevents the use of the copy operator.
void operator =( const CompilerOutputter &copy );
virtual bool processLocationFormatCommand( char command,
const SourceLine &sourceLine );
virtual std::string extractBaseName( const std::string &fileName ) const;
private:
TestResultCollector *m_result;
OStream &m_stream;
std::string m_locationFormat;
int m_wrapColumn;
};
CPPUNIT_NS_END
#endif // CPPUNIT_COMPILERTESTRESULTOUTPUTTER_H
+90
View File
@@ -0,0 +1,90 @@
#ifndef CPPUNIT_EXCEPTION_H
#define CPPUNIT_EXCEPTION_H
#include <cppunit/Portability.h>
#include <cppunit/Message.h>
#include <cppunit/SourceLine.h>
#include <exception>
CPPUNIT_NS_BEGIN
/*! \brief Exceptions thrown by failed assertions.
* \ingroup BrowsingCollectedTestResult
*
* Exception is an exception that serves
* descriptive strings through its what() method
*/
class CPPUNIT_API Exception : public std::exception
{
public:
/*! \brief Constructs the exception with the specified message and source location.
* \param message Message associated to the exception.
* \param sourceLine Source location related to the exception.
*/
Exception( const Message &message = Message(),
const SourceLine &sourceLine = SourceLine() );
#ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED
/*!
* \deprecated Use other constructor instead.
*/
Exception( std::string message,
long lineNumber,
std::string fileName );
#endif
/*! \brief Constructs a copy of an exception.
* \param other Exception to copy.
*/
Exception( const Exception &other );
/// Destructs the exception
virtual ~Exception() throw();
/// Performs an assignment
Exception &operator =( const Exception &other );
/// Returns descriptive message
const char *what() const throw();
/// Location where the error occured
SourceLine sourceLine() const;
/// Message related to the exception.
Message message() const;
/// Set the message.
void setMessage( const Message &message );
#ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED
/// The line on which the error occurred
long lineNumber() const;
/// The file in which the error occurred
std::string fileName() const;
static const std::string UNKNOWNFILENAME;
static const long UNKNOWNLINENUMBER;
#endif
/// Clones the exception.
virtual Exception *clone() const;
protected:
// VC++ does not recognize call to parent class when prefixed
// with a namespace. This is a workaround.
typedef std::exception SuperClass;
Message m_message;
SourceLine m_sourceLine;
std::string m_whatMessage;
};
CPPUNIT_NS_END
#endif // CPPUNIT_EXCEPTION_H
+156
View File
@@ -0,0 +1,156 @@
#ifndef CPPUNIT_MESSAGE_H
#define CPPUNIT_MESSAGE_H
#include <cppunit/Portability.h>
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( push )
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
#endif
#include <cppunit/portability/CppUnitDeque.h>
#include <string>
CPPUNIT_NS_BEGIN
#if CPPUNIT_NEED_DLL_DECL
// template class CPPUNIT_API std::deque<std::string>;
#endif
/*! \brief Message associated to an Exception.
* \ingroup CreatingNewAssertions
* A message is composed of two items:
* - a short description (~20/30 characters)
* - a list of detail strings
*
* The short description is used to indicate how the detail strings should be
* interpreted. It usually indicates the failure types, such as
* "assertion failed", "forced failure", "unexpected exception caught",
* "equality assertion failed"... It should not contains new line character (\n).
*
* Detail strings are used to provide more information about the failure. It
* can contains the asserted expression, the expected and actual values in an
* equality assertion, some addional messages... Detail strings can contains
* new line characters (\n).
*/
class CPPUNIT_API Message
{
public:
Message();
// Ensure thread-safe copy by detaching the string.
Message( const Message &other );
explicit Message( const std::string &shortDescription );
Message( const std::string &shortDescription,
const std::string &detail1 );
Message( const std::string &shortDescription,
const std::string &detail1,
const std::string &detail2 );
Message( const std::string &shortDescription,
const std::string &detail1,
const std::string &detail2,
const std::string &detail3 );
Message &operator =( const Message &other );
/*! \brief Returns the short description.
* \return Short description.
*/
const std::string &shortDescription() const;
/*! \brief Returns the number of detail string.
* \return Number of detail string.
*/
int detailCount() const;
/*! \brief Returns the detail at the specified index.
* \param index Zero based index of the detail string to return.
* \returns Detail string at the specified index.
* \exception std::invalid_argument if \a index < 0 or index >= detailCount().
*/
std::string detailAt( int index ) const;
/*! \brief Returns a string that represents a list of the detail strings.
*
* Example:
* \code
* Message message( "not equal", "Expected: 3", "Actual: 7" );
* std::string details = message.details();
* // details contains:
* // "- Expected: 3\n- Actual: 7\n" \endcode
*
* \return A string that is a concatenation of all the detail strings. Each detail
* string is prefixed with '- ' and suffixed with '\n' before being
* concatenated to the other.
*/
std::string details() const;
/*! \brief Removes all detail strings.
*/
void clearDetails();
/*! \brief Adds a single detail string.
* \param detail Detail string to add.
*/
void addDetail( const std::string &detail );
/*! \brief Adds two detail strings.
* \param detail1 Detail string to add.
* \param detail2 Detail string to add.
*/
void addDetail( const std::string &detail1,
const std::string &detail2 );
/*! \brief Adds three detail strings.
* \param detail1 Detail string to add.
* \param detail2 Detail string to add.
* \param detail3 Detail string to add.
*/
void addDetail( const std::string &detail1,
const std::string &detail2,
const std::string &detail3 );
/*! \brief Adds the detail strings of the specified message.
* \param message All the detail strings of this message are added to this one.
*/
void addDetail( const Message &message );
/*! \brief Sets the short description.
* \param shortDescription New short description.
*/
void setShortDescription( const std::string &shortDescription );
/*! \brief Tests if a message is identical to another one.
* \param other Message this message is compared to.
* \return \c true if the two message are identical, \c false otherwise.
*/
bool operator ==( const Message &other ) const;
/*! \brief Tests if a message is different from another one.
* \param other Message this message is compared to.
* \return \c true if the two message are not identical, \c false otherwise.
*/
bool operator !=( const Message &other ) const;
private:
std::string m_shortDescription;
typedef CppUnitDeque<std::string> Details;
Details m_details;
};
CPPUNIT_NS_END
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( pop )
#endif
#endif // CPPUNIT_MESSAGE_H
+26
View File
@@ -0,0 +1,26 @@
#ifndef CPPUNIT_OUTPUTTER_H
#define CPPUNIT_OUTPUTTER_H
#include <cppunit/Portability.h>
CPPUNIT_NS_BEGIN
/*! \brief Abstract outputter to print test result summary.
* \ingroup WritingTestResult
*/
class CPPUNIT_API Outputter
{
public:
/// Destructor.
virtual ~Outputter() {}
virtual void write() =0;
};
CPPUNIT_NS_END
#endif // CPPUNIT_OUTPUTTER_H
+177
View File
@@ -0,0 +1,177 @@
#ifndef CPPUNIT_PORTABILITY_H
#define CPPUNIT_PORTABILITY_H
#if defined(_WIN32) && !defined(WIN32)
# define WIN32 1
#endif
/* include platform specific config */
#if defined(__BORLANDC__)
# include <cppunit/config/config-bcb5.h>
#elif defined (_MSC_VER)
# if _MSC_VER == 1200 && defined(_WIN32_WCE) //evc4
# include <cppunit/config/config-evc4.h>
# else
# include <cppunit/config/config-msvc6.h>
# endif
#else
# include <cppunit/config-auto.h>
#endif
// Version number of package
#ifndef CPPUNIT_VERSION
#define CPPUNIT_VERSION "1.12.0"
#endif
#include <cppunit/config/CppUnitApi.h> // define CPPUNIT_API & CPPUNIT_NEED_DLL_DECL
#include <cppunit/config/SelectDllLoader.h>
/* Options that the library user may switch on or off.
* If the user has not done so, we chose default values.
*/
/* Define to 1 if you wish to have the old-style macros
assert(), assertEqual(), assertDoublesEqual(), and assertLongsEqual() */
#if !defined(CPPUNIT_ENABLE_NAKED_ASSERT)
# define CPPUNIT_ENABLE_NAKED_ASSERT 0
#endif
/* Define to 1 if you wish to have the old-style CU_TEST family
of macros. */
#if !defined(CPPUNIT_ENABLE_CU_TEST_MACROS)
# define CPPUNIT_ENABLE_CU_TEST_MACROS 0
#endif
/* Define to 1 if the preprocessor expands (#foo) to "foo" (quotes incl.)
I don't think there is any C preprocess that does NOT support this! */
#if !defined(CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION)
# define CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION 1
#endif
/* Assumes that STL and CppUnit are in global space if the compiler does not
support namespace. */
#if !defined(CPPUNIT_HAVE_NAMESPACES)
# if !defined(CPPUNIT_NO_NAMESPACE)
# define CPPUNIT_NO_NAMESPACE 1
# endif // !defined(CPPUNIT_NO_NAMESPACE)
# if !defined(CPPUNIT_NO_STD_NAMESPACE)
# define CPPUNIT_NO_STD_NAMESPACE 1
# endif // !defined(CPPUNIT_NO_STD_NAMESPACE)
#endif // !defined(CPPUNIT_HAVE_NAMESPACES)
/* Define CPPUNIT_STD_NEED_ALLOCATOR to 1 if you need to specify
* the allocator you used when instantiating STL container. Typically
* used for compilers that do not support template default parameter.
* CPPUNIT_STD_ALLOCATOR will be used as the allocator. Default is
* std::allocator. On some compilers, you may need to change this to
* std::allocator<T>.
*/
#if CPPUNIT_STD_NEED_ALLOCATOR
# if !defined(CPPUNIT_STD_ALLOCATOR)
# define CPPUNIT_STD_ALLOCATOR std::allocator
# endif // !defined(CPPUNIT_STD_ALLOCATOR)
#endif // defined(CPPUNIT_STD_NEED_ALLOCATOR)
// Compiler error location format for CompilerOutputter
// If not define, assumes that it's gcc
// See class CompilerOutputter for format.
#if !defined(CPPUNIT_COMPILER_LOCATION_FORMAT)
#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) )
// gcc/Xcode integration on Mac OS X
# define CPPUNIT_COMPILER_LOCATION_FORMAT "%p:%l: "
#else
# define CPPUNIT_COMPILER_LOCATION_FORMAT "%f:%l:"
#endif
#endif
// If CPPUNIT_HAVE_CPP_CAST is defined, then c++ style cast will be used,
// otherwise, C style cast are used.
#if defined( CPPUNIT_HAVE_CPP_CAST )
# define CPPUNIT_CONST_CAST( TargetType, pointer ) \
const_cast<TargetType>( pointer )
# define CPPUNIT_STATIC_CAST( TargetType, pointer ) \
static_cast<TargetType>( pointer )
#else // defined( CPPUNIT_HAVE_CPP_CAST )
# define CPPUNIT_CONST_CAST( TargetType, pointer ) \
((TargetType)( pointer ))
# define CPPUNIT_STATIC_CAST( TargetType, pointer ) \
((TargetType)( pointer ))
#endif // defined( CPPUNIT_HAVE_CPP_CAST )
// If CPPUNIT_NO_STD_NAMESPACE is defined then STL are in the global space.
// => Define macro 'std' to nothing
#if defined(CPPUNIT_NO_STD_NAMESPACE)
# undef std
# define std
#endif // defined(CPPUNIT_NO_STD_NAMESPACE)
// If CPPUNIT_NO_NAMESPACE is defined, then put CppUnit classes in the
// global namespace: the compiler does not support namespace.
#if defined(CPPUNIT_NO_NAMESPACE)
# define CPPUNIT_NS_BEGIN
# define CPPUNIT_NS_END
# define CPPUNIT_NS
#else // defined(CPPUNIT_NO_NAMESPACE)
# define CPPUNIT_NS_BEGIN namespace CppUnit {
# define CPPUNIT_NS_END }
# define CPPUNIT_NS CppUnit
#endif // defined(CPPUNIT_NO_NAMESPACE)
/*! Stringize a symbol.
*
* Use this macro to convert a preprocessor symbol to a string.
*
* Example of usage:
* \code
* #define CPPUNIT_PLUGIN_EXPORTED_NAME cppunitTestPlugIn
* const char *name = CPPUNIT_STRINGIZE( CPPUNIT_PLUGIN_EXPORTED_NAME );
* \endcode
*/
#define CPPUNIT_STRINGIZE( symbol ) _CPPUNIT_DO_STRINGIZE( symbol )
/// \internal
#define _CPPUNIT_DO_STRINGIZE( symbol ) #symbol
/*! Joins to symbol after expanding them into string.
*
* Use this macro to join two symbols. Example of usage:
*
* \code
* #define MAKE_UNIQUE_NAME(prefix) CPPUNIT_JOIN( prefix, __LINE__ )
* \endcode
*
* The macro defined in the example concatenate a given prefix with the line number
* to obtain a 'unique' identifier.
*
* \internal From boost documentation:
* The following piece of macro magic joins the two
* arguments together, even when one of the arguments is
* itself a macro (see 16.3.1 in C++ standard). The key
* is that macro expansion of macro arguments does not
* occur in CPPUNIT_JOIN2 but does in CPPUNIT_JOIN.
*/
#define CPPUNIT_JOIN( symbol1, symbol2 ) _CPPUNIT_DO_JOIN( symbol1, symbol2 )
/// \internal
#define _CPPUNIT_DO_JOIN( symbol1, symbol2 ) _CPPUNIT_DO_JOIN2( symbol1, symbol2 )
/// \internal
#define _CPPUNIT_DO_JOIN2( symbol1, symbol2 ) symbol1##symbol2
/*! Adds the line number to the specified string to create a unique identifier.
* \param prefix Prefix added to the line number to create a unique identifier.
* \see CPPUNIT_TEST_SUITE_REGISTRATION for an example of usage.
*/
#define CPPUNIT_MAKE_UNIQUE_NAME( prefix ) CPPUNIT_JOIN( prefix, __LINE__ )
/*! Defines wrap colunm for %CppUnit. Used by CompilerOuputter.
*/
#if !defined(CPPUNIT_WRAP_COLUMN)
# define CPPUNIT_WRAP_COLUMN 79
#endif
#endif // CPPUNIT_PORTABILITY_H
+94
View File
@@ -0,0 +1,94 @@
#ifndef CPPUNIT_PROTECTOR_H
#define CPPUNIT_PROTECTOR_H
#include <cppunit/SourceLine.h>
CPPUNIT_NS_BEGIN
class Exception;
class Message;
class ProtectorContext;
class TestResult;
class CPPUNIT_API Functor
{
public:
virtual ~Functor();
virtual bool operator()() const =0;
};
/*! \brief Protects one or more test case run.
*
* Protector are used to globably 'decorate' a test case. The most common
* usage of Protector is to catch exception that do not subclass std::exception,
* such as MFC CException class or Rogue Wave RWXMsg class, and capture the
* message associated to the exception. In fact, CppUnit capture message from
* Exception and std::exception using a Protector.
*
* Protector are chained. When you add a Protector using
* TestResult::pushProtector(), your protector is in fact passed as a Functor
* to the first protector of the chain.
*
* TestCase protects call to setUp(), runTest() and tearDown() by calling
* TestResult::protect().
*
* Because the protector chain is handled by TestResult, a protector can be
* active for a single test, or a complete test run.
*
* Here are some possible usages:
* - run all test case in a separate thread and assumes the test failed if it
* did not finish in a given time (infinite loop work around)
* - performance tracing : time only the runTest() time.
* \sa TestResult, TestCase, TestListener.
*/
class CPPUNIT_API Protector
{
public:
virtual ~Protector();
virtual bool protect( const Functor &functor,
const ProtectorContext &context ) =0;
protected:
void reportError( const ProtectorContext &context,
const Exception &error ) const;
void reportError( const ProtectorContext &context,
const Message &message,
const SourceLine &sourceLine = SourceLine() ) const;
void reportFailure( const ProtectorContext &context,
const Exception &failure ) const;
Message actualMessage( const Message &message,
const ProtectorContext &context ) const;
};
/*! \brief Scoped protector push to TestResult.
*
* Adds the specified Protector to the specified TestResult for the object
* life-time.
*/
class CPPUNIT_API ProtectorGuard
{
public:
/// Pushes the specified protector.
ProtectorGuard( TestResult *result,
Protector *protector );
/// Pops the protector.
~ProtectorGuard();
private:
TestResult *m_result;
};
CPPUNIT_NS_END
#endif // CPPUNIT_PROTECTOR_H
+63
View File
@@ -0,0 +1,63 @@
#ifndef CPPUNIT_SOURCELINE_H
#define CPPUNIT_SOURCELINE_H
#include <cppunit/Portability.h>
#include <string>
/*! \brief Constructs a SourceLine object initialized with the location where the macro is expanded.
* \ingroup CreatingNewAssertions
* \relates CppUnit::SourceLine
* Used to write your own assertion macros.
* \see Asserter for example of usage.
*/
#define CPPUNIT_SOURCELINE() CPPUNIT_NS::SourceLine( __FILE__, __LINE__ )
CPPUNIT_NS_BEGIN
/*! \brief Represents a source line location.
* \ingroup CreatingNewAssertions
* \ingroup BrowsingCollectedTestResult
*
* Used to capture the failure location in assertion.
*
* Use the CPPUNIT_SOURCELINE() macro to construct that object. Typically used when
* writing an assertion macro in association with Asserter.
*
* \see Asserter.
*/
class CPPUNIT_API SourceLine
{
public:
SourceLine();
// Ensure thread-safe copy by detaching the string buffer.
SourceLine( const SourceLine &other );
SourceLine( const std::string &fileName,
int lineNumber );
SourceLine &operator =( const SourceLine &other );
/// Destructor.
virtual ~SourceLine();
bool isValid() const;
int lineNumber() const;
std::string fileName() const;
bool operator ==( const SourceLine &other ) const;
bool operator !=( const SourceLine &other ) const;
private:
std::string m_fileName;
int m_lineNumber;
};
CPPUNIT_NS_END
#endif // CPPUNIT_SOURCELINE_H
+80
View File
@@ -0,0 +1,80 @@
#ifndef CPPUNIT_SYNCHRONIZEDOBJECT_H
#define CPPUNIT_SYNCHRONIZEDOBJECT_H
#include <cppunit/Portability.h>
CPPUNIT_NS_BEGIN
/*! \brief Base class for synchronized object.
*
* Synchronized object are object which members are used concurrently by mutiple
* threads.
*
* This class define the class SynchronizationObject which must be subclassed
* to implement an actual lock.
*
* Each instance of this class holds a pointer on a lock object.
*
* See src/msvc6/MfcSynchronizedObject.h for an example.
*/
class CPPUNIT_API SynchronizedObject
{
public:
/*! \brief Abstract synchronization object (mutex)
*/
class SynchronizationObject
{
public:
SynchronizationObject() {}
virtual ~SynchronizationObject() {}
virtual void lock() {}
virtual void unlock() {}
};
/*! Constructs a SynchronizedObject object.
*/
SynchronizedObject( SynchronizationObject *syncObject =0 );
/// Destructor.
virtual ~SynchronizedObject();
protected:
/*! \brief Locks a synchronization object in the current scope.
*/
class ExclusiveZone
{
SynchronizationObject *m_syncObject;
public:
ExclusiveZone( SynchronizationObject *syncObject )
: m_syncObject( syncObject )
{
m_syncObject->lock();
}
~ExclusiveZone()
{
m_syncObject->unlock ();
}
};
virtual void setSynchronizationObject( SynchronizationObject *syncObject );
protected:
SynchronizationObject *m_syncObject;
private:
/// Prevents the use of the copy constructor.
SynchronizedObject( const SynchronizedObject &copy );
/// Prevents the use of the copy operator.
void operator =( const SynchronizedObject &copy );
};
CPPUNIT_NS_END
#endif // CPPUNIT_SYNCHRONIZEDOBJECT_H
+117
View File
@@ -0,0 +1,117 @@
#ifndef CPPUNIT_TEST_H
#define CPPUNIT_TEST_H
#include <cppunit/Portability.h>
#include <string>
CPPUNIT_NS_BEGIN
class TestResult;
class TestPath;
/*! \brief Base class for all test objects.
* \ingroup BrowsingCollectedTestResult
*
* All test objects should be a subclass of Test. Some test objects,
* TestCase for example, represent one individual test. Other test
* objects, such as TestSuite, are comprised of several tests.
*
* When a Test is run, the result is collected by a TestResult object.
*
* \see TestCase
* \see TestSuite
*/
class CPPUNIT_API Test
{
public:
virtual ~Test() {};
/*! \brief Run the test, collecting results.
*/
virtual void run( TestResult *result ) =0;
/*! \brief Return the number of test cases invoked by run().
*
* The base unit of testing is the class TestCase. This
* method returns the number of TestCase objects invoked by
* the run() method.
*/
virtual int countTestCases () const =0;
/*! \brief Returns the number of direct child of the test.
*/
virtual int getChildTestCount() const =0;
/*! \brief Returns the child test of the specified index.
*
* This method test if the index is valid, then call doGetChildTestAt() if
* the index is valid. Otherwise std::out_of_range exception is thrown.
*
* You should override doGetChildTestAt() method.
*
* \param index Zero based index of the child test to return.
* \return Pointer on the test. Never \c NULL.
* \exception std::out_of_range is \a index is < 0 or >= getChildTestCount().
*/
virtual Test *getChildTestAt( int index ) const;
/*! \brief Returns the test name.
*
* Each test has a name. This name may be used to find the
* test in a suite or registry of tests.
*/
virtual std::string getName () const =0;
/*! \brief Finds the test with the specified name and its parents test.
* \param testName Name of the test to find.
* \param testPath If the test is found, then all the tests traversed to access
* \a test are added to \a testPath, including \c this and \a test.
* \return \c true if a test with the specified name is found, \c false otherwise.
*/
virtual bool findTestPath( const std::string &testName,
TestPath &testPath ) const;
/*! \brief Finds the specified test and its parents test.
* \param test Test to find.
* \param testPath If the test is found, then all the tests traversed to access
* \a test are added to \a testPath, including \c this and \a test.
* \return \c true if the specified test is found, \c false otherwise.
*/
virtual bool findTestPath( const Test *test,
TestPath &testPath ) const;
/*! \brief Finds the test with the specified name in the hierarchy.
* \param testName Name of the test to find.
* \return Pointer on the first test found that is named \a testName. Never \c NULL.
* \exception std::invalid_argument if no test named \a testName is found.
*/
virtual Test *findTest( const std::string &testName ) const;
/*! \brief Resolved the specified test path with this test acting as 'root'.
* \param testPath Test path string to resolve.
* \return Resolved TestPath.
* \exception std::invalid_argument if \a testPath could not be resolved.
* \see TestPath.
*/
virtual TestPath resolveTestPath( const std::string &testPath ) const;
protected:
/*! Throws an exception if the specified index is invalid.
* \param index Zero base index of a child test.
* \exception std::out_of_range is \a index is < 0 or >= getChildTestCount().
*/
virtual void checkIsValidIndex( int index ) const;
/*! \brief Returns the child test of the specified valid index.
* \param index Zero based valid index of the child test to return.
* \return Pointer on the test. Never \c NULL.
*/
virtual Test *doGetChildTestAt( int index ) const =0;
};
CPPUNIT_NS_END
#endif // CPPUNIT_TEST_H
+428
View File
@@ -0,0 +1,428 @@
#ifndef CPPUNIT_TESTASSERT_H
#define CPPUNIT_TESTASSERT_H
#include <cppunit/Portability.h>
#include <cppunit/Exception.h>
#include <cppunit/Asserter.h>
#include <cppunit/portability/Stream.h>
#include <stdio.h>
#include <float.h> // For struct assertion_traits<double>
CPPUNIT_NS_BEGIN
/*! \brief Traits used by CPPUNIT_ASSERT_EQUAL().
*
* Here is an example of specialising these traits:
*
* \code
* template<>
* struct assertion_traits<std::string> // specialization for the std::string type
* {
* static bool equal( const std::string& x, const std::string& y )
* {
* return x == y;
* }
*
* static std::string toString( const std::string& x )
* {
* std::string text = '"' + x + '"'; // adds quote around the string to see whitespace
* OStringStream ost;
* ost << text;
* return ost.str();
* }
* };
* \endcode
*/
template <class T>
struct assertion_traits
{
static bool equal( const T& x, const T& y )
{
return x == y;
}
static std::string toString( const T& x )
{
OStringStream ost;
ost << x;
return ost.str();
}
};
/*! \brief Traits used by CPPUNIT_ASSERT_DOUBLES_EQUAL().
*
* This specialisation from @c struct @c assertion_traits<> ensures that
* doubles are converted in full, instead of being rounded to the default
* 6 digits of precision. Use the system defined ISO C99 macro DBL_DIG
* within float.h is available to define the maximum precision, otherwise
* use the hard-coded maximum precision of 15.
*/
template <>
struct assertion_traits<double>
{
static bool equal( double x, double y )
{
return x == y;
}
static std::string toString( double x )
{
#ifdef DBL_DIG
const int precision = DBL_DIG;
#else
const int precision = 15;
#endif // #ifdef DBL_DIG
char buffer[128];
#ifdef __STDC_SECURE_LIB__ // Use secure version with visual studio 2005 to avoid warning.
sprintf_s(buffer, sizeof(buffer), "%.*g", precision, x);
#else
sprintf(buffer, "%.*g", precision, x);
#endif
return buffer;
}
};
/*! \brief (Implementation) Asserts that two objects of the same type are equals.
* Use CPPUNIT_ASSERT_EQUAL instead of this function.
* \sa assertion_traits, Asserter::failNotEqual().
*/
template <class T>
void assertEquals( const T& expected,
const T& actual,
SourceLine sourceLine,
const std::string &message )
{
if ( !assertion_traits<T>::equal(expected,actual) ) // lazy toString conversion...
{
Asserter::failNotEqual( assertion_traits<T>::toString(expected),
assertion_traits<T>::toString(actual),
sourceLine,
message );
}
}
/*! \brief (Implementation) Asserts that two double are equals given a tolerance.
* Use CPPUNIT_ASSERT_DOUBLES_EQUAL instead of this function.
* \sa Asserter::failNotEqual().
* \sa CPPUNIT_ASSERT_DOUBLES_EQUAL for detailed semantic of the assertion.
*/
void CPPUNIT_API assertDoubleEquals( double expected,
double actual,
double delta,
SourceLine sourceLine,
const std::string &message );
/* A set of macros which allow us to get the line number
* and file name at the point of an error.
* Just goes to show that preprocessors do have some
* redeeming qualities.
*/
#if CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION
/** Assertions that a condition is \c true.
* \ingroup Assertions
*/
#define CPPUNIT_ASSERT(condition) \
( CPPUNIT_NS::Asserter::failIf( !(condition), \
CPPUNIT_NS::Message( "assertion failed", \
"Expression: " #condition), \
CPPUNIT_SOURCELINE() ) )
#else
#define CPPUNIT_ASSERT(condition) \
( CPPUNIT_NS::Asserter::failIf( !(condition), \
CPPUNIT_NS::Message( "assertion failed" ), \
CPPUNIT_SOURCELINE() ) )
#endif
/** Assertion with a user specified message.
* \ingroup Assertions
* \param message Message reported in diagnostic if \a condition evaluates
* to \c false.
* \param condition If this condition evaluates to \c false then the
* test failed.
*/
#define CPPUNIT_ASSERT_MESSAGE(message,condition) \
( CPPUNIT_NS::Asserter::failIf( !(condition), \
CPPUNIT_NS::Message( "assertion failed", \
"Expression: " \
#condition, \
message ), \
CPPUNIT_SOURCELINE() ) )
/** Fails with the specified message.
* \ingroup Assertions
* \param message Message reported in diagnostic.
*/
#define CPPUNIT_FAIL( message ) \
( CPPUNIT_NS::Asserter::fail( CPPUNIT_NS::Message( "forced failure", \
message ), \
CPPUNIT_SOURCELINE() ) )
#ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED
/// Generalized macro for primitive value comparisons
#define CPPUNIT_ASSERT_EQUAL(expected,actual) \
( CPPUNIT_NS::assertEquals( (expected), \
(actual), \
__LINE__, __FILE__ ) )
#else
/** Asserts that two values are equals.
* \ingroup Assertions
*
* Equality and string representation can be defined with
* an appropriate CppUnit::assertion_traits class.
*
* A diagnostic is printed if actual and expected values disagree.
*
* Requirement for \a expected and \a actual parameters:
* - They are exactly of the same type
* - They are serializable into a std::strstream using operator <<.
* - They can be compared using operator ==.
*
* The last two requirements (serialization and comparison) can be
* removed by specializing the CppUnit::assertion_traits.
*/
#define CPPUNIT_ASSERT_EQUAL(expected,actual) \
( CPPUNIT_NS::assertEquals( (expected), \
(actual), \
CPPUNIT_SOURCELINE(), \
"" ) )
/** Asserts that two values are equals, provides additional message on failure.
* \ingroup Assertions
*
* Equality and string representation can be defined with
* an appropriate assertion_traits class.
*
* A diagnostic is printed if actual and expected values disagree.
* The message is printed in addition to the expected and actual value
* to provide additional information.
*
* Requirement for \a expected and \a actual parameters:
* - They are exactly of the same type
* - They are serializable into a std::strstream using operator <<.
* - They can be compared using operator ==.
*
* The last two requirements (serialization and comparison) can be
* removed by specializing the CppUnit::assertion_traits.
*/
#define CPPUNIT_ASSERT_EQUAL_MESSAGE(message,expected,actual) \
( CPPUNIT_NS::assertEquals( (expected), \
(actual), \
CPPUNIT_SOURCELINE(), \
(message) ) )
#endif
/*! \brief Macro for primitive double value comparisons.
* \ingroup Assertions
*
* The assertion pass if both expected and actual are finite and
* \c fabs( \c expected - \c actual ) <= \c delta.
* If either \c expected or actual are infinite (+/- inf), the
* assertion pass if \c expected == \c actual.
* If either \c expected or \c actual is a NaN (not a number), then
* the assertion fails.
*/
#define CPPUNIT_ASSERT_DOUBLES_EQUAL(expected,actual,delta) \
( CPPUNIT_NS::assertDoubleEquals( (expected), \
(actual), \
(delta), \
CPPUNIT_SOURCELINE(), \
"" ) )
/*! \brief Macro for primitive double value comparisons, setting a
* user-supplied message in case of failure.
* \ingroup Assertions
* \sa CPPUNIT_ASSERT_DOUBLES_EQUAL for detailed semantic of the assertion.
*/
#define CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(message,expected,actual,delta) \
( CPPUNIT_NS::assertDoubleEquals( (expected), \
(actual), \
(delta), \
CPPUNIT_SOURCELINE(), \
(message) ) )
/** Asserts that the given expression throws an exception of the specified type.
* \ingroup Assertions
* Example of usage:
* \code
* std::vector<int> v;
* CPPUNIT_ASSERT_THROW( v.at( 50 ), std::out_of_range );
* \endcode
*/
# define CPPUNIT_ASSERT_THROW( expression, ExceptionType ) \
CPPUNIT_ASSERT_THROW_MESSAGE( CPPUNIT_NS::AdditionalMessage(), \
expression, \
ExceptionType )
// implementation detail
#if CPPUNIT_USE_TYPEINFO_NAME
#define CPPUNIT_EXTRACT_EXCEPTION_TYPE_( exception, no_rtti_message ) \
CPPUNIT_NS::TypeInfoHelper::getClassName( typeid(exception) )
#else
#define CPPUNIT_EXTRACT_EXCEPTION_TYPE_( exception, no_rtti_message ) \
std::string( no_rtti_message )
#endif // CPPUNIT_USE_TYPEINFO_NAME
// implementation detail
#define CPPUNIT_GET_PARAMETER_STRING( parameter ) #parameter
/** Asserts that the given expression throws an exception of the specified type,
* setting a user supplied message in case of failure.
* \ingroup Assertions
* Example of usage:
* \code
* std::vector<int> v;
* CPPUNIT_ASSERT_THROW_MESSAGE( "- std::vector<int> v;", v.at( 50 ), std::out_of_range );
* \endcode
*/
# define CPPUNIT_ASSERT_THROW_MESSAGE( message, expression, ExceptionType ) \
do { \
bool cpputCorrectExceptionThrown_ = false; \
CPPUNIT_NS::Message cpputMsg_( "expected exception not thrown" ); \
cpputMsg_.addDetail( message ); \
cpputMsg_.addDetail( "Expected: " \
CPPUNIT_GET_PARAMETER_STRING( ExceptionType ) ); \
\
try { \
expression; \
} catch ( const ExceptionType & ) { \
cpputCorrectExceptionThrown_ = true; \
} catch ( const std::exception &e) { \
cpputMsg_.addDetail( "Actual : " + \
CPPUNIT_EXTRACT_EXCEPTION_TYPE_( e, \
"std::exception or derived") ); \
cpputMsg_.addDetail( std::string("What() : ") + e.what() ); \
} catch ( ... ) { \
cpputMsg_.addDetail( "Actual : unknown."); \
} \
\
if ( cpputCorrectExceptionThrown_ ) \
break; \
\
CPPUNIT_NS::Asserter::fail( cpputMsg_, \
CPPUNIT_SOURCELINE() ); \
} while ( false )
/** Asserts that the given expression does not throw any exceptions.
* \ingroup Assertions
* Example of usage:
* \code
* std::vector<int> v;
* v.push_back( 10 );
* CPPUNIT_ASSERT_NO_THROW( v.at( 0 ) );
* \endcode
*/
# define CPPUNIT_ASSERT_NO_THROW( expression ) \
CPPUNIT_ASSERT_NO_THROW_MESSAGE( CPPUNIT_NS::AdditionalMessage(), \
expression )
/** Asserts that the given expression does not throw any exceptions,
* setting a user supplied message in case of failure.
* \ingroup Assertions
* Example of usage:
* \code
* std::vector<int> v;
* v.push_back( 10 );
* CPPUNIT_ASSERT_NO_THROW( "std::vector<int> v;", v.at( 0 ) );
* \endcode
*/
# define CPPUNIT_ASSERT_NO_THROW_MESSAGE( message, expression ) \
do { \
CPPUNIT_NS::Message cpputMsg_( "unexpected exception caught" ); \
cpputMsg_.addDetail( message ); \
\
try { \
expression; \
} catch ( const std::exception &e ) { \
cpputMsg_.addDetail( "Caught: " + \
CPPUNIT_EXTRACT_EXCEPTION_TYPE_( e, \
"std::exception or derived" ) ); \
cpputMsg_.addDetail( std::string("What(): ") + e.what() ); \
CPPUNIT_NS::Asserter::fail( cpputMsg_, \
CPPUNIT_SOURCELINE() ); \
} catch ( ... ) { \
cpputMsg_.addDetail( "Caught: unknown." ); \
CPPUNIT_NS::Asserter::fail( cpputMsg_, \
CPPUNIT_SOURCELINE() ); \
} \
} while ( false )
/** Asserts that an assertion fail.
* \ingroup Assertions
* Use to test assertions.
* Example of usage:
* \code
* CPPUNIT_ASSERT_ASSERTION_FAIL( CPPUNIT_ASSERT( 1 == 2 ) );
* \endcode
*/
# define CPPUNIT_ASSERT_ASSERTION_FAIL( assertion ) \
CPPUNIT_ASSERT_THROW( assertion, CPPUNIT_NS::Exception )
/** Asserts that an assertion fail, with a user-supplied message in
* case of error.
* \ingroup Assertions
* Use to test assertions.
* Example of usage:
* \code
* CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE( "1 == 2", CPPUNIT_ASSERT( 1 == 2 ) );
* \endcode
*/
# define CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE( message, assertion ) \
CPPUNIT_ASSERT_THROW_MESSAGE( message, assertion, CPPUNIT_NS::Exception )
/** Asserts that an assertion pass.
* \ingroup Assertions
* Use to test assertions.
* Example of usage:
* \code
* CPPUNIT_ASSERT_ASSERTION_PASS( CPPUNIT_ASSERT( 1 == 1 ) );
* \endcode
*/
# define CPPUNIT_ASSERT_ASSERTION_PASS( assertion ) \
CPPUNIT_ASSERT_NO_THROW( assertion )
/** Asserts that an assertion pass, with a user-supplied message in
* case of failure.
* \ingroup Assertions
* Use to test assertions.
* Example of usage:
* \code
* CPPUNIT_ASSERT_ASSERTION_PASS_MESSAGE( "1 != 1", CPPUNIT_ASSERT( 1 == 1 ) );
* \endcode
*/
# define CPPUNIT_ASSERT_ASSERTION_PASS_MESSAGE( message, assertion ) \
CPPUNIT_ASSERT_NO_THROW_MESSAGE( message, assertion )
// Backwards compatibility
#if CPPUNIT_ENABLE_NAKED_ASSERT
#undef assert
#define assert(c) CPPUNIT_ASSERT(c)
#define assertEqual(e,a) CPPUNIT_ASSERT_EQUAL(e,a)
#define assertDoublesEqual(e,a,d) CPPUNIT_ASSERT_DOUBLES_EQUAL(e,a,d)
#define assertLongsEqual(e,a) CPPUNIT_ASSERT_EQUAL(e,a)
#endif
CPPUNIT_NS_END
#endif // CPPUNIT_TESTASSERT_H
+204
View File
@@ -0,0 +1,204 @@
#ifndef CPPUNIT_TESTCALLER_H // -*- C++ -*-
#define CPPUNIT_TESTCALLER_H
#include <cppunit/Exception.h>
#include <cppunit/TestCase.h>
#if CPPUNIT_USE_TYPEINFO_NAME
# include <cppunit/extensions/TypeInfoHelper.h>
#endif
CPPUNIT_NS_BEGIN
#if 0
/*! \brief Marker class indicating that no exception is expected by TestCaller.
* This class is an implementation detail. You should never use this class directly.
*/
class CPPUNIT_API NoExceptionExpected
{
private:
//! Prevent class instantiation.
NoExceptionExpected();
};
/*! \brief (Implementation) Traits used by TestCaller to expect an exception.
*
* This class is an implementation detail. You should never use this class directly.
*/
template<class ExceptionType>
struct ExpectedExceptionTraits
{
static void expectedException()
{
#if CPPUNIT_USE_TYPEINFO_NAME
throw Exception( Message(
"expected exception not thrown",
"Expected exception type: " +
TypeInfoHelper::getClassName( typeid( ExceptionType ) ) ) );
#else
throw Exception( "expected exception not thrown" );
#endif
}
};
/*! \brief (Implementation) Traits specialization used by TestCaller to
* expect no exception.
*
* This class is an implementation detail. You should never use this class directly.
*/
template<>
struct ExpectedExceptionTraits<NoExceptionExpected>
{
static void expectedException()
{
}
};
#endif
//*** FIXME: rework this when class Fixture is implemented. ***//
/*! \brief Generate a test case from a fixture method.
* \ingroup WritingTestFixture
*
* A test caller provides access to a test case method
* on a test fixture class. Test callers are useful when
* you want to run an individual test or add it to a
* suite.
* Test Callers invoke only one Test (i.e. test method) on one
* Fixture of a TestFixture.
*
* Here is an example:
* \code
* class MathTest : public CppUnit::TestFixture {
* ...
* public:
* void setUp();
* void tearDown();
*
* void testAdd();
* void testSubtract();
* };
*
* CppUnit::Test *MathTest::suite() {
* CppUnit::TestSuite *suite = new CppUnit::TestSuite;
*
* suite->addTest( new CppUnit::TestCaller<MathTest>( "testAdd", testAdd ) );
* return suite;
* }
* \endcode
*
* You can use a TestCaller to bind any test method on a TestFixture
* class, as long as it accepts void and returns void.
*
* \see TestCase
*/
template <class Fixture>
class TestCaller : public TestCase
{
typedef void (Fixture::*TestMethod)();
public:
/*!
* Constructor for TestCaller. This constructor builds a new Fixture
* instance owned by the TestCaller.
* \param name name of this TestCaller
* \param test the method this TestCaller calls in runTest()
*/
TestCaller( std::string name, TestMethod test ) :
TestCase( name ),
m_ownFixture( true ),
m_fixture( new Fixture() ),
m_test( test )
{
}
/*!
* Constructor for TestCaller.
* This constructor does not create a new Fixture instance but accepts
* an existing one as parameter. The TestCaller will not own the
* Fixture object.
* \param name name of this TestCaller
* \param test the method this TestCaller calls in runTest()
* \param fixture the Fixture to invoke the test method on.
*/
TestCaller(std::string name, TestMethod test, Fixture& fixture) :
TestCase( name ),
m_ownFixture( false ),
m_fixture( &fixture ),
m_test( test )
{
}
/*!
* Constructor for TestCaller.
* This constructor does not create a new Fixture instance but accepts
* an existing one as parameter. The TestCaller will own the
* Fixture object and delete it in its destructor.
* \param name name of this TestCaller
* \param test the method this TestCaller calls in runTest()
* \param fixture the Fixture to invoke the test method on.
*/
TestCaller(std::string name, TestMethod test, Fixture* fixture) :
TestCase( name ),
m_ownFixture( true ),
m_fixture( fixture ),
m_test( test )
{
}
~TestCaller()
{
if (m_ownFixture)
delete m_fixture;
}
void runTest()
{
// try {
(m_fixture->*m_test)();
// }
// catch ( ExpectedException & ) {
// return;
// }
// ExpectedExceptionTraits<ExpectedException>::expectedException();
}
void setUp()
{
m_fixture->setUp ();
}
void tearDown()
{
m_fixture->tearDown ();
}
std::string toString() const
{
return "TestCaller " + getName();
}
private:
TestCaller( const TestCaller &other );
TestCaller &operator =( const TestCaller &other );
private:
bool m_ownFixture;
Fixture *m_fixture;
TestMethod m_test;
};
CPPUNIT_NS_END
#endif // CPPUNIT_TESTCALLER_H
+55
View File
@@ -0,0 +1,55 @@
#ifndef CPPUNIT_TESTCASE_H
#define CPPUNIT_TESTCASE_H
#include <cppunit/Portability.h>
#include <cppunit/TestLeaf.h>
#include <cppunit/TestAssert.h>
#include <cppunit/TestFixture.h>
#include <string>
CPPUNIT_NS_BEGIN
class TestResult;
/*! \brief A single test object.
*
* This class is used to implement a simple test case: define a subclass
* that overrides the runTest method.
*
* You don't usually need to use that class, but TestFixture and TestCaller instead.
*
* You are expected to subclass TestCase is you need to write a class similiar
* to TestCaller.
*/
class CPPUNIT_API TestCase : public TestLeaf,
public TestFixture
{
public:
TestCase( const std::string &name );
TestCase();
~TestCase();
virtual void run(TestResult *result);
std::string getName() const;
//! FIXME: this should probably be pure virtual.
virtual void runTest();
private:
TestCase( const TestCase &other );
TestCase &operator=( const TestCase &other );
private:
const std::string m_name;
};
CPPUNIT_NS_END
#endif // CPPUNIT_TESTCASE_H
+45
View File
@@ -0,0 +1,45 @@
#ifndef CPPUNIT_TESTCOMPSITE_H // -*- C++ -*-
#define CPPUNIT_TESTCOMPSITE_H
#include <cppunit/Test.h>
#include <string>
CPPUNIT_NS_BEGIN
/*! \brief A Composite of Tests.
*
* Base class for all test composites. Subclass this class if you need to implement
* a custom TestSuite.
*
* \see Test, TestSuite.
*/
class CPPUNIT_API TestComposite : public Test
{
public:
TestComposite( const std::string &name = "" );
~TestComposite();
void run( TestResult *result );
int countTestCases() const;
std::string getName() const;
private:
TestComposite( const TestComposite &other );
TestComposite &operator =( const TestComposite &other );
virtual void doStartSuite( TestResult *controller );
virtual void doRunChildTests( TestResult *controller );
virtual void doEndSuite( TestResult *controller );
private:
const std::string m_name;
};
CPPUNIT_NS_END
#endif // CPPUNIT_TESTCOMPSITE_H
+58
View File
@@ -0,0 +1,58 @@
#ifndef CPPUNIT_TESTFAILURE_H // -*- C++ -*-
#define CPPUNIT_TESTFAILURE_H
#include <cppunit/Portability.h>
#include <string>
CPPUNIT_NS_BEGIN
class Exception;
class SourceLine;
class Test;
/*! \brief Record of a failed Test execution.
* \ingroup BrowsingCollectedTestResult
*
* A TestFailure collects a failed test together with
* the caught exception.
*
* TestFailure assumes lifetime control for any exception
* passed to it.
*/
class CPPUNIT_API TestFailure
{
public:
TestFailure( Test *failedTest,
Exception *thrownException,
bool isError );
virtual ~TestFailure ();
virtual Test *failedTest() const;
virtual Exception *thrownException() const;
virtual SourceLine sourceLine() const;
virtual bool isError() const;
virtual std::string failedTestName() const;
virtual TestFailure *clone() const;
protected:
Test *m_failedTest;
Exception *m_thrownException;
bool m_isError;
private:
TestFailure( const TestFailure &other );
TestFailure &operator =( const TestFailure& other );
};
CPPUNIT_NS_END
#endif // CPPUNIT_TESTFAILURE_H
+99
View File
@@ -0,0 +1,99 @@
#ifndef CPPUNIT_TESTFIXTURE_H // -*- C++ -*-
#define CPPUNIT_TESTFIXTURE_H
#include <cppunit/Portability.h>
CPPUNIT_NS_BEGIN
/*! \brief Wraps a test case with setUp and tearDown methods.
* \ingroup WritingTestFixture
*
* A TestFixture is used to provide a common environment for a set
* of test cases.
*
* To define a test fixture, do the following:
* - implement a subclass of TestCase
* - the fixture is defined by instance variables
* - initialize the fixture state by overriding setUp
* (i.e. construct the instance variables of the fixture)
* - clean-up after a test by overriding tearDown.
*
* Each test runs in its own fixture so there
* can be no side effects among test runs.
* Here is an example:
*
* \code
* class MathTest : public CppUnit::TestFixture {
* protected:
* int m_value1, m_value2;
*
* public:
* MathTest() {}
*
* void setUp () {
* m_value1 = 2;
* m_value2 = 3;
* }
* }
* \endcode
*
* For each test implement a method which interacts
* with the fixture. Verify the expected results with assertions specified
* by calling CPPUNIT_ASSERT on the expression you want to test:
*
* \code
* public:
* void testAdd () {
* int result = m_value1 + m_value2;
* CPPUNIT_ASSERT( result == 5 );
* }
* \endcode
*
* Once the methods are defined you can run them. To do this, use
* a TestCaller.
*
* \code
* CppUnit::Test *test = new CppUnit::TestCaller<MathTest>( "testAdd",
* &MathTest::testAdd );
* test->run();
* \endcode
*
*
* The tests to be run can be collected into a TestSuite.
*
* \code
* public:
* static CppUnit::TestSuite *MathTest::suite () {
* CppUnit::TestSuite *suiteOfTests = new CppUnit::TestSuite;
* suiteOfTests->addTest(new CppUnit::TestCaller<MathTest>(
* "testAdd", &MathTest::testAdd));
* suiteOfTests->addTest(new CppUnit::TestCaller<MathTest>(
* "testDivideByZero", &MathTest::testDivideByZero));
* return suiteOfTests;
* }
* \endcode
*
* A set of macros have been created for convenience. They are located in HelperMacros.h.
*
* \see TestResult, TestSuite, TestCaller,
* \see CPPUNIT_TEST_SUB_SUITE, CPPUNIT_TEST, CPPUNIT_TEST_SUITE_END,
* \see CPPUNIT_TEST_SUITE_REGISTRATION, CPPUNIT_TEST_EXCEPTION, CPPUNIT_TEST_FAIL.
*/
class CPPUNIT_API TestFixture
{
public:
virtual ~TestFixture() {};
//! \brief Set up context before running a test.
virtual void setUp() {};
//! Clean up after the test run.
virtual void tearDown() {};
};
CPPUNIT_NS_END
#endif
+44
View File
@@ -0,0 +1,44 @@
#ifndef CPPUNIT_TESTLEAF_H
#define CPPUNIT_TESTLEAF_H
#include <cppunit/Test.h>
CPPUNIT_NS_BEGIN
/*! \brief A single test object.
*
* Base class for single test case: a test that doesn't have any children.
*
*/
class CPPUNIT_API TestLeaf: public Test
{
public:
/*! Returns 1 as the default number of test cases invoked by run().
*
* You may override this method when many test cases are invoked (RepeatedTest
* for example).
*
* \return 1.
* \see Test::countTestCases().
*/
int countTestCases() const;
/*! Returns the number of child of this test case: 0.
*
* You should never override this method: a TestLeaf as no children by definition.
*
* \return 0.
*/
int getChildTestCount() const;
/*! Always throws std::out_of_range.
* \see Test::doGetChildTestAt().
*/
Test *doGetChildTestAt( int index ) const;
};
CPPUNIT_NS_END
#endif // CPPUNIT_TESTLEAF_H
+148
View File
@@ -0,0 +1,148 @@
#ifndef CPPUNIT_TESTLISTENER_H // -*- C++ -*-
#define CPPUNIT_TESTLISTENER_H
#include <cppunit/Portability.h>
CPPUNIT_NS_BEGIN
class Exception;
class Test;
class TestFailure;
class TestResult;
/*! \brief Listener for test progress and result.
* \ingroup TrackingTestExecution
*
* Implementing the Observer pattern a TestListener may be registered
* to a TestResult to obtain information on the testing progress. Use
* specialized sub classes of TestListener for text output
* (TextTestProgressListener). Do not use the Listener for the test
* result output, use a subclass of Outputter instead.
*
* The test framework distinguishes between failures and errors.
* A failure is anticipated and checked for with assertions. Errors are
* unanticipated problems signified by exceptions that are not generated
* by the framework.
*
* Here is an example to track test time:
*
*
* \code
* #include <cppunit/TestListener.h>
* #include <cppunit/Test.h>
* #include <time.h> // for clock()
*
* class TimingListener : public CppUnit::TestListener
* {
* public:
* void startTest( CppUnit::Test *test )
* {
* _chronometer.start();
* }
*
* void endTest( CppUnit::Test *test )
* {
* _chronometer.end();
* addTest( test, _chronometer.elapsedTime() );
* }
*
* // ... (interface to add/read test timing result)
*
* private:
* Clock _chronometer;
* };
* \endcode
*
* And another example that track failure/success at test suite level and captures
* the TestPath of each suite:
* \code
* class SuiteTracker : public CppUnit::TestListener
* {
* public:
* void startSuite( CppUnit::Test *suite )
* {
* m_currentPath.add( suite );
* }
*
* void addFailure( const TestFailure &failure )
* {
* m_suiteFailure.top() = false;
* }
*
* void endSuite( CppUnit::Test *suite )
* {
* m_suiteStatus.insert( std::make_pair( suite, m_suiteFailure.top() ) );
* m_suitePaths.insert( std::make_pair( suite, m_currentPath ) );
*
* m_currentPath.up();
* m_suiteFailure.pop();
* }
*
* private:
* std::stack<bool> m_suiteFailure;
* CppUnit::TestPath m_currentPath;
* std::map<CppUnit::Test *, bool> m_suiteStatus;
* std::map<CppUnit::Test *, CppUnit::TestPath> m_suitePaths;
* };
* \endcode
*
* \see TestResult
*/
class CPPUNIT_API TestListener
{
public:
virtual ~TestListener() {}
/// Called when just before a TestCase is run.
virtual void startTest( Test * /*test*/ ) {}
/*! \brief Called when a failure occurs while running a test.
* \see TestFailure.
* \warning \a failure is a temporary object that is destroyed after the
* method call. Use TestFailure::clone() to create a duplicate.
*/
virtual void addFailure( const TestFailure & /*failure*/ ) {}
/// Called just after a TestCase was run (even if a failure occured).
virtual void endTest( Test * /*test*/ ) {}
/*! \brief Called by a TestComposite just before running its child tests.
*/
virtual void startSuite( Test * /*suite*/ ) {}
/*! \brief Called by a TestComposite after running its child tests.
*/
virtual void endSuite( Test * /*suite*/ ) {}
/*! \brief Called by a TestRunner before running the test.
*
* You can use this to do some global initialisation. A listener
* could also use to output a 'prolog' to the test run.
*
* \param test Test that is going to be run.
* \param eventManager Event manager used for the test run.
*/
virtual void startTestRun( Test * /*test*/,
TestResult * /*eventManager*/ ) {}
/*! \brief Called by a TestRunner after running the test.
*
* TextTestProgressListener use this to emit a line break. You can also use this
* to do some global uninitialisation.
*
* \param test Test that was run.
* \param eventManager Event manager used for the test run.
*/
virtual void endTestRun( Test * /*test*/,
TestResult * /*eventManager*/ ) {}
};
CPPUNIT_NS_END
#endif // CPPUNIT_TESTLISTENER_H
+211
View File
@@ -0,0 +1,211 @@
#ifndef CPPUNIT_TESTPATH_H
#define CPPUNIT_TESTPATH_H
#include <cppunit/Portability.h>
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( push )
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
#endif
#include <cppunit/portability/CppUnitDeque.h>
#include <string>
CPPUNIT_NS_BEGIN
class Test;
#if CPPUNIT_NEED_DLL_DECL
// template class CPPUNIT_API std::deque<Test *>;
#endif
/*! \brief A List of Test representing a path to access a Test.
* \ingroup ExecutingTest
*
* The path can be converted to a string and resolved from a string with toString()
* and TestPath( Test *root, const std::string &pathAsString ).
*
* Pointed tests are not owned by the class.
*
* \see Test::resolvedTestPath()
*/
class CPPUNIT_API TestPath
{
public:
/*! \brief Constructs an invalid path.
*
* The path is invalid until a test is added with add().
*/
TestPath();
/*! \brief Constructs a valid path.
*
* \param root Test to add.
*/
TestPath( Test *root );
/*! \brief Constructs a path using a slice of another path.
* \param otherPath Path the test are copied from.
* \param indexFirst Zero based index of the first test to copy. Adjusted to be in valid
* range. \a count is adjusted with \a indexFirst.
* \param count Number of tests to copy. If < 0 then all test starting from index
* \a indexFirst are copied.
*/
TestPath( const TestPath &otherPath,
int indexFirst,
int count = -1 );
/*! \brief Resolves a path from a string returned by toString().
*
* If \a pathAsString is an absolute path (begins with '/'), then the first test name
* of the path must be the name of \a searchRoot. Otherwise, \a pathAsString is a
* relative path, and the first test found using Test::findTest() matching the first
* test name is used as root. An empty string resolve to a path containing
* \a searchRoot.
*
* The resolved path is always valid.
*
* \param searchRoot Test used to resolve the path.
* \param pathAsString String that contains the path as a string created by toString().
* \exception std::invalid_argument if one of the test names can not be resolved.
* \see toString().
*/
TestPath( Test *searchRoot,
const std::string &pathAsString );
/*! \brief Copy constructor.
* \param other Object to copy.
*/
TestPath( const TestPath &other );
virtual ~TestPath();
/*! \brief Tests if the path contains at least one test.
* \return \c true if the path contains at least one test, otherwise returns \c false.
*/
virtual bool isValid() const;
/*! \brief Adds a test to the path.
* \param test Pointer on the test to add. Must not be \c NULL.
*/
virtual void add( Test *test );
/*! \brief Adds all the tests of the specified path.
* \param path Path that contains the test to add.
*/
virtual void add( const TestPath &path );
/*! \brief Inserts a test at the specified index.
* \param test Pointer on the test to insert. Must not be \c NULL.
* \param index Zero based index indicating where the test is inserted.
* \exception std::out_of_range is \a index < 0 or \a index > getTestCount().
*/
virtual void insert( Test *test, int index );
/*! \brief Inserts all the tests at the specified path at a given index.
* \param path Path that contains the test to insert.
* \param index Zero based index indicating where the tests are inserted.
* \exception std::out_of_range is \a index < 0 or \a index > getTestCount(), and
* \a path is valid.
*/
virtual void insert( const TestPath &path, int index );
/*! \brief Removes all the test from the path.
*
* The path becomes invalid after this call.
*/
virtual void removeTests();
/*! \brief Removes the test at the specified index of the path.
* \param index Zero based index of the test to remove.
* \exception std::out_of_range is \a index < 0 or \a index >= getTestCount().
*/
virtual void removeTest( int index );
/*! \brief Removes the last test.
* \exception std::out_of_range is the path is invalid.
* \see isValid().
*/
virtual void up();
/*! \brief Returns the number of tests in the path.
* \return Number of tests in the path.
*/
virtual int getTestCount() const;
/*! \brief Returns the test of the specified index.
* \param index Zero based index of the test to return.
* \return Pointer on the test at index \a index. Never \c NULL.
* \exception std::out_of_range is \a index < 0 or \a index >= getTestCount().
*/
virtual Test *getTestAt( int index ) const;
/*! \brief Get the last test of the path.
* \return Pointer on the last test (test at the bottom of the hierarchy). Never \c NULL.
* \exception std::out_of_range if the path is not valid ( isValid() returns \c false ).
*/
virtual Test *getChildTest() const;
/*! \brief Returns the path as a string.
*
* For example, if a path is composed of three tests named "All Tests", "Math" and
* "Math::testAdd", toString() will return:
*
* "All Tests/Math/Math::testAdd".
*
* \return A string composed of the test names separated with a '/'. It is a relative
* path.
*/
virtual std::string toString() const;
/*! \brief Assignment operator.
* \param other Object to copy.
* \return This object.
*/
TestPath &operator =( const TestPath &other );
protected:
/*! \brief Checks that the specified test index is within valid range.
* \param index Zero based index to check.
* \exception std::out_of_range is \a index < 0 or \a index >= getTestCount().
*/
void checkIndexValid( int index ) const;
/// A list of test names.
typedef CppUnitDeque<std::string> PathTestNames;
/*! \brief Splits a path string into its test name components.
* \param pathAsString Path string created with toString().
* \param testNames Test name components are added to that container.
* \return \c true if the path is relative (does not begin with '/'), \c false
* if it is absolute (begin with '/').
*/
bool splitPathString( const std::string &pathAsString,
PathTestNames &testNames );
/*! \brief Finds the actual root of a path string and get the path string name components.
* \param searchRoot Test used as root if the path string is absolute, or to search
* the root test if the path string is relative.
* \param pathAsString Path string. May be absolute or relative.
* \param testNames Test name components are added to that container.
* \return Pointer on the resolved root test. Never \c NULL.
* \exception std::invalid_argument if either the root name can not be resolved or if
* pathAsString contains no name components.
*/
Test *findActualRoot( Test *searchRoot,
const std::string &pathAsString,
PathTestNames &testNames );
protected:
typedef CppUnitDeque<Test *> Tests;
Tests m_tests;
};
CPPUNIT_NS_END
#endif // CPPUNIT_TESTPATH_H
+156
View File
@@ -0,0 +1,156 @@
#ifndef CPPUNIT_TESTRESULT_H
#define CPPUNIT_TESTRESULT_H
#include <cppunit/Portability.h>
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( push )
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
#endif
#include <cppunit/SynchronizedObject.h>
#include <cppunit/portability/CppUnitDeque.h>
#include <string>
CPPUNIT_NS_BEGIN
class Exception;
class Functor;
class Protector;
class ProtectorChain;
class Test;
class TestFailure;
class TestListener;
#if CPPUNIT_NEED_DLL_DECL
// template class CPPUNIT_API std::deque<TestListener *>;
#endif
/*! \brief Manages TestListener.
* \ingroup TrackingTestExecution
*
* A single instance of this class is used when running the test. It is usually
* created by the test runner (TestRunner).
*
* This class shouldn't have to be inherited from. Use a TestListener
* or one of its subclasses to be informed of the ongoing tests.
* Use a Outputter to receive a test summary once it has finished
*
* TestResult supplies a template method 'setSynchronizationObject()'
* so that subclasses can provide mutual exclusion in the face of multiple
* threads. This can be useful when tests execute in one thread and
* they fill a subclass of TestResult which effects change in another
* thread. To have mutual exclusion, override setSynchronizationObject()
* and make sure that you create an instance of ExclusiveZone at the
* beginning of each method.
*
* \see Test, TestListener, TestResultCollector, Outputter.
*/
class CPPUNIT_API TestResult : protected SynchronizedObject
{
public:
/// Construct a TestResult
TestResult( SynchronizationObject *syncObject = 0 );
/// Destroys a test result
virtual ~TestResult();
virtual void addListener( TestListener *listener );
virtual void removeListener( TestListener *listener );
/// Resets the stop flag.
virtual void reset();
/// Stop testing
virtual void stop();
/// Returns whether testing should be stopped
virtual bool shouldStop() const;
/// Informs TestListener that a test will be started.
virtual void startTest( Test *test );
/*! \brief Adds an error to the list of errors.
* The passed in exception
* caused the error
*/
virtual void addError( Test *test, Exception *e );
/*! \brief Adds a failure to the list of failures. The passed in exception
* caused the failure.
*/
virtual void addFailure( Test *test, Exception *e );
/// Informs TestListener that a test was completed.
virtual void endTest( Test *test );
/// Informs TestListener that a test suite will be started.
virtual void startSuite( Test *test );
/// Informs TestListener that a test suite was completed.
virtual void endSuite( Test *test );
/*! \brief Run the specified test.
*
* Calls startTestRun(), test->run(this), and finally endTestRun().
*/
virtual void runTest( Test *test );
/*! \brief Protects a call to the specified functor.
*
* See Protector to understand how protector works. A default protector is
* always present. It captures CppUnit::Exception, std::exception and
* any other exceptions, retrieving as much as possible information about
* the exception as possible.
*
* Additional Protector can be added to the chain to support other exception
* types using pushProtector() and popProtector().
*
* \param functor Functor to call (typically a call to setUp(), runTest() or
* tearDown().
* \param test Test the functor is associated to (used for failure reporting).
* \param shortDescription Short description override for the failure message.
*/
virtual bool protect( const Functor &functor,
Test *test,
const std::string &shortDescription = std::string("") );
/// Adds the specified protector to the protector chain.
virtual void pushProtector( Protector *protector );
/// Removes the last protector from the protector chain.
virtual void popProtector();
protected:
/*! \brief Called to add a failure to the list of failures.
*/
void addFailure( const TestFailure &failure );
virtual void startTestRun( Test *test );
virtual void endTestRun( Test *test );
protected:
typedef CppUnitDeque<TestListener *> TestListeners;
TestListeners m_listeners;
ProtectorChain *m_protectorChain;
bool m_stop;
private:
TestResult( const TestResult &other );
TestResult &operator =( const TestResult &other );
};
CPPUNIT_NS_END
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( pop )
#endif
#endif // CPPUNIT_TESTRESULT_H
+87
View File
@@ -0,0 +1,87 @@
#ifndef CPPUNIT_TESTRESULTCOLLECTOR_H
#define CPPUNIT_TESTRESULTCOLLECTOR_H
#include <cppunit/Portability.h>
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( push )
#pragma warning( disable: 4251 4660 ) // X needs to have dll-interface to be used by clients of class Z
#endif
#include <cppunit/TestSuccessListener.h>
#include <cppunit/portability/CppUnitDeque.h>
CPPUNIT_NS_BEGIN
#if CPPUNIT_NEED_DLL_DECL
// template class CPPUNIT_API std::deque<TestFailure *>;
// template class CPPUNIT_API std::deque<Test *>;
#endif
/*! \brief Collects test result.
* \ingroup WritingTestResult
* \ingroup BrowsingCollectedTestResult
*
* A TestResultCollector is a TestListener which collects the results of executing
* a test case. It is an instance of the Collecting Parameter pattern.
*
* The test framework distinguishes between failures and errors.
* A failure is anticipated and checked for with assertions. Errors are
* unanticipated problems signified by exceptions that are not generated
* by the framework.
* \see TestListener, TestFailure.
*/
class CPPUNIT_API TestResultCollector : public TestSuccessListener
{
public:
typedef CppUnitDeque<TestFailure *> TestFailures;
typedef CppUnitDeque<Test *> Tests;
/*! Constructs a TestResultCollector object.
*/
TestResultCollector( SynchronizationObject *syncObject = 0 );
/// Destructor.
virtual ~TestResultCollector();
void startTest( Test *test );
void addFailure( const TestFailure &failure );
virtual void reset();
virtual int runTests() const;
virtual int testErrors() const;
virtual int testFailures() const;
virtual int testFailuresTotal() const;
virtual const TestFailures& failures() const;
virtual const Tests &tests() const;
protected:
void freeFailures();
Tests m_tests;
TestFailures m_failures;
int m_testErrors;
private:
/// Prevents the use of the copy constructor.
TestResultCollector( const TestResultCollector &copy );
/// Prevents the use of the copy operator.
void operator =( const TestResultCollector &copy );
};
CPPUNIT_NS_END
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( pop )
#endif
#endif // CPPUNIT_TESTRESULTCOLLECTOR_H
+135
View File
@@ -0,0 +1,135 @@
#ifndef CPPUNIT_TESTRUNNER_H
#define CPPUNIT_TESTRUNNER_H
#include <cppunit/TestSuite.h>
#include <string>
CPPUNIT_NS_BEGIN
class Test;
class TestResult;
/*! \brief Generic test runner.
* \ingroup ExecutingTest
*
* The TestRunner assumes ownership of all added tests: you can not add test
* or suite that are local variable since they can't be deleted.
*
* Example of usage:
* \code
* #include <cppunit/extensions/TestFactoryRegistry.h>
* #include <cppunit/CompilerOutputter.h>
* #include <cppunit/TestResult.h>
* #include <cppunit/TestResultCollector.h>
* #include <cppunit/TestRunner.h>
* #include <cppunit/TextTestProgressListener.h>
*
*
* int
* main( int argc, char* argv[] )
* {
* std::string testPath = (argc > 1) ? std::string(argv[1]) : "";
*
* // Create the event manager and test controller
* CppUnit::TestResult controller;
*
* // Add a listener that colllects test result
* CppUnit::TestResultCollector result;
* controller.addListener( &result );
*
* // Add a listener that print dots as test run.
* CppUnit::TextTestProgressListener progress;
* controller.addListener( &progress );
*
* // Add the top suite to the test runner
* CppUnit::TestRunner runner;
* runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() );
* try
* {
* std::cout << "Running " << testPath;
* runner.run( controller, testPath );
*
* std::cerr << std::endl;
*
* // Print test in a compiler compatible format.
* CppUnit::CompilerOutputter outputter( &result, std::cerr );
* outputter.write();
* }
* catch ( std::invalid_argument &e ) // Test path not resolved
* {
* std::cerr << std::endl
* << "ERROR: " << e.what()
* << std::endl;
* return 0;
* }
*
* return result.wasSuccessful() ? 0 : 1;
* }
* \endcode
*/
class CPPUNIT_API TestRunner
{
public:
/*! \brief Constructs a TestRunner object.
*/
TestRunner( );
/// Destructor.
virtual ~TestRunner();
/*! \brief Adds the specified test.
* \param test Test to add. The TestRunner takes ownership of the test.
*/
virtual void addTest( Test *test );
/*! \brief Runs a test using the specified controller.
* \param controller Event manager and controller used for testing
* \param testPath Test path string. See Test::resolveTestPath() for detail.
* \exception std::invalid_argument if no test matching \a testPath is found.
* see TestPath::TestPath( Test*, const std::string &)
* for detail.
*/
virtual void run( TestResult &controller,
const std::string &testPath = "" );
protected:
/*! \brief (INTERNAL) Mutating test suite.
*/
class CPPUNIT_API WrappingSuite : public TestSuite
{
public:
WrappingSuite( const std::string &name = "All Tests" );
int getChildTestCount() const;
std::string getName() const;
void run( TestResult *result );
protected:
Test *doGetChildTestAt( int index ) const;
bool hasOnlyOneTest() const;
Test *getUniqueChildTest() const;
};
protected:
WrappingSuite *m_suite;
private:
/// Prevents the use of the copy constructor.
TestRunner( const TestRunner &copy );
/// Prevents the use of the copy operator.
void operator =( const TestRunner &copy );
private:
};
CPPUNIT_NS_END
#endif // CPPUNIT_TESTRUNNER_H
+39
View File
@@ -0,0 +1,39 @@
#ifndef CPPUNIT_TESTSUCCESSLISTENER_H
#define CPPUNIT_TESTSUCCESSLISTENER_H
#include <cppunit/SynchronizedObject.h>
#include <cppunit/TestListener.h>
CPPUNIT_NS_BEGIN
/*! \brief TestListener that checks if any test case failed.
* \ingroup TrackingTestExecution
*/
class CPPUNIT_API TestSuccessListener : public TestListener,
public SynchronizedObject
{
public:
/*! Constructs a TestSuccessListener object.
*/
TestSuccessListener( SynchronizationObject *syncObject = 0 );
/// Destructor.
virtual ~TestSuccessListener();
virtual void reset();
void addFailure( const TestFailure &failure );
/// Returns whether the entire test was successful or not.
virtual bool wasSuccessful() const;
private:
bool m_success;
};
CPPUNIT_NS_END
#endif // CPPUNIT_TESTSUCCESSLISTENER_H
+80
View File
@@ -0,0 +1,80 @@
#ifndef CPPUNIT_TESTSUITE_H // -*- C++ -*-
#define CPPUNIT_TESTSUITE_H
#include <cppunit/Portability.h>
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( push )
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
#endif
#include <cppunit/TestComposite.h>
#include <cppunit/portability/CppUnitVector.h>
CPPUNIT_NS_BEGIN
#if CPPUNIT_NEED_DLL_DECL
// template class CPPUNIT_API std::vector<Test *>;
#endif
/*! \brief A Composite of Tests.
* \ingroup CreatingTestSuite
*
* It runs a collection of test cases. Here is an example.
* \code
* CppUnit::TestSuite *suite= new CppUnit::TestSuite();
* suite->addTest(new CppUnit::TestCaller<MathTest> (
* "testAdd", testAdd));
* suite->addTest(new CppUnit::TestCaller<MathTest> (
* "testDivideByZero", testDivideByZero));
* \endcode
* Note that \link TestSuite TestSuites \endlink assume lifetime
* control for any tests added to them.
*
* TestSuites do not register themselves in the TestRegistry.
* \see Test
* \see TestCaller
*/
class CPPUNIT_API TestSuite : public TestComposite
{
public:
/*! Constructs a test suite with the specified name.
*/
TestSuite( std::string name = "" );
~TestSuite();
/*! Adds the specified test to the suite.
* \param test Test to add. Must not be \c NULL.
*/
void addTest( Test *test );
/*! Returns the list of the tests (DEPRECATED).
* \deprecated Use getChildTestCount() & getChildTestAt() of the
* TestComposite interface instead.
* \return Reference on a vector that contains the tests of the suite.
*/
const CppUnitVector<Test *> &getTests() const;
/*! Destroys all the tests of the suite.
*/
virtual void deleteContents();
int getChildTestCount() const;
Test *doGetChildTestAt( int index ) const;
private:
CppUnitVector<Test *> m_tests;
};
CPPUNIT_NS_END
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( pop )
#endif
#endif // CPPUNIT_TESTSUITE_H
+59
View File
@@ -0,0 +1,59 @@
#ifndef CPPUNIT_TEXTOUTPUTTER_H
#define CPPUNIT_TEXTOUTPUTTER_H
#include <cppunit/Portability.h>
#include <cppunit/Outputter.h>
#include <cppunit/portability/Stream.h>
CPPUNIT_NS_BEGIN
class Exception;
class SourceLine;
class TestResultCollector;
class TestFailure;
/*! \brief Prints a TestResultCollector to a text stream.
* \ingroup WritingTestResult
*/
class CPPUNIT_API TextOutputter : public Outputter
{
public:
TextOutputter( TestResultCollector *result,
OStream &stream );
/// Destructor.
virtual ~TextOutputter();
void write();
virtual void printFailures();
virtual void printHeader();
virtual void printFailure( TestFailure *failure,
int failureNumber );
virtual void printFailureListMark( int failureNumber );
virtual void printFailureTestName( TestFailure *failure );
virtual void printFailureType( TestFailure *failure );
virtual void printFailureLocation( SourceLine sourceLine );
virtual void printFailureDetail( Exception *thrownException );
virtual void printFailureWarning();
virtual void printStatistics();
protected:
TestResultCollector *m_result;
OStream &m_stream;
private:
/// Prevents the use of the copy constructor.
TextOutputter( const TextOutputter &copy );
/// Prevents the use of the copy operator.
void operator =( const TextOutputter &copy );
};
CPPUNIT_NS_END
#endif // CPPUNIT_TEXTOUTPUTTER_H
+44
View File
@@ -0,0 +1,44 @@
#ifndef CPPUNIT_TEXTTESTPROGRESSLISTENER_H
#define CPPUNIT_TEXTTESTPROGRESSLISTENER_H
#include <cppunit/TestListener.h>
CPPUNIT_NS_BEGIN
/*!
* \brief TestListener that show the status of each TestCase test result.
* \ingroup TrackingTestExecution
*/
class CPPUNIT_API TextTestProgressListener : public TestListener
{
public:
/*! Constructs a TextTestProgressListener object.
*/
TextTestProgressListener();
/// Destructor.
virtual ~TextTestProgressListener();
void startTest( Test *test );
void addFailure( const TestFailure &failure );
void endTestRun( Test *test,
TestResult *eventManager );
private:
/// Prevents the use of the copy constructor.
TextTestProgressListener( const TextTestProgressListener &copy );
/// Prevents the use of the copy operator.
void operator =( const TextTestProgressListener &copy );
private:
};
CPPUNIT_NS_END
#endif // CPPUNIT_TEXTTESTPROGRESSLISTENER_H
+39
View File
@@ -0,0 +1,39 @@
#ifndef CPPUNIT_TEXTTESTRESULT_H
#define CPPUNIT_TEXTTESTRESULT_H
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/portability/Stream.h>
CPPUNIT_NS_BEGIN
class SourceLine;
class Exception;
class Test;
/*! \brief Holds printable test result (DEPRECATED).
* \ingroup TrackingTestExecution
*
* deprecated Use class TextTestProgressListener and TextOutputter instead.
*/
class CPPUNIT_API TextTestResult : public TestResult,
public TestResultCollector
{
public:
TextTestResult();
virtual void addFailure( const TestFailure &failure );
virtual void startTest( Test *test );
virtual void print( OStream &stream );
};
/** insertion operator for easy output */
CPPUNIT_API OStream &operator <<( OStream &stream,
TextTestResult &result );
CPPUNIT_NS_END
#endif // CPPUNIT_TEXTTESTRESULT_H
+6
View File
@@ -0,0 +1,6 @@
#ifndef CPPUNIT_TEXTTESTRUNNER_H
#define CPPUNIT_TEXTTESTRUNNER_H
#include <cppunit/ui/text/TextTestRunner.h>
#endif // CPPUNIT_TEXTTESTRUNNER_H
+167
View File
@@ -0,0 +1,167 @@
#ifndef CPPUNIT_XMLTESTRESULTOUTPUTTER_H
#define CPPUNIT_XMLTESTRESULTOUTPUTTER_H
#include <cppunit/Portability.h>
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( push )
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
#endif
#include <cppunit/Outputter.h>
#include <cppunit/portability/CppUnitDeque.h>
#include <cppunit/portability/CppUnitMap.h>
#include <cppunit/portability/Stream.h>
CPPUNIT_NS_BEGIN
class Test;
class TestFailure;
class TestResultCollector;
class XmlDocument;
class XmlElement;
class XmlOutputterHook;
/*! \brief Outputs a TestResultCollector in XML format.
* \ingroup WritingTestResult
*
* Save the test result as a XML stream.
*
* Additional datas can be added to the XML document using XmlOutputterHook.
* Hook are not owned by the XmlOutputter. They should be valid until
* destruction of the XmlOutputter. They can be removed with removeHook().
*
* \see XmlDocument, XmlElement, XmlOutputterHook.
*/
class CPPUNIT_API XmlOutputter : public Outputter
{
public:
/*! \brief Constructs a XmlOutputter object.
* \param result Result of the test run.
* \param stream Stream used to output the XML output.
* \param encoding Encoding used in the XML file (default is Latin-1).
*/
XmlOutputter( TestResultCollector *result,
OStream &stream,
std::string encoding = std::string("ISO-8859-1") );
/// Destructor.
virtual ~XmlOutputter();
/*! \brief Adds the specified hook to the outputter.
* \param hook Hook to add. Must not be \c NULL.
*/
virtual void addHook( XmlOutputterHook *hook );
/*! \brief Removes the specified hook from the outputter.
* \param hook Hook to remove.
*/
virtual void removeHook( XmlOutputterHook *hook );
/*! \brief Writes the specified result as an XML document to the stream.
*
* Refer to examples/cppunittest/XmlOutputterTest.cpp for example
* of use and XML document structure.
*/
virtual void write();
/*! \brief Sets the XSL style sheet used.
*
* \param styleSheet Name of the style sheet used. If empty, then no style sheet
* is used (default).
*/
virtual void setStyleSheet( const std::string &styleSheet );
/*! \brief set the output document as standalone or not.
*
* For the output document, specify wether it's a standalone XML
* document, or not.
*
* \param standalone if true, the output will be specified as standalone.
* if false, it will be not.
*/
virtual void setStandalone( bool standalone );
typedef CppUnitMap<Test *,TestFailure*, std::less<Test*> > FailedTests;
/*! \brief Sets the root element and adds its children.
*
* Set the root element of the XML Document and add its child elements.
*
* For all hooks, call beginDocument() just after creating the root element (it
* is empty at this time), and endDocument() once all the datas have been added
* to the root element.
*/
virtual void setRootNode();
virtual void addFailedTests( FailedTests &failedTests,
XmlElement *rootNode );
virtual void addSuccessfulTests( FailedTests &failedTests,
XmlElement *rootNode );
/*! \brief Adds the statics element to the root node.
*
* Creates a new element containing statistics data and adds it to the root element.
* Then, for all hooks, call statisticsAdded().
* \param rootNode Root element.
*/
virtual void addStatistics( XmlElement *rootNode );
/*! \brief Adds a failed test to the failed tests node.
* Creates a new element containing datas about the failed test, and adds it to
* the failed tests element.
* Then, for all hooks, call failTestAdded().
*/
virtual void addFailedTest( Test *test,
TestFailure *failure,
int testNumber,
XmlElement *testsNode );
virtual void addFailureLocation( TestFailure *failure,
XmlElement *testElement );
/*! \brief Adds a successful test to the successful tests node.
* Creates a new element containing datas about the successful test, and adds it to
* the successful tests element.
* Then, for all hooks, call successfulTestAdded().
*/
virtual void addSuccessfulTest( Test *test,
int testNumber,
XmlElement *testsNode );
protected:
virtual void fillFailedTestsMap( FailedTests &failedTests );
protected:
typedef CppUnitDeque<XmlOutputterHook *> Hooks;
TestResultCollector *m_result;
OStream &m_stream;
std::string m_encoding;
std::string m_styleSheet;
XmlDocument *m_xml;
Hooks m_hooks;
private:
/// Prevents the use of the copy constructor.
XmlOutputter( const XmlOutputter &copy );
/// Prevents the use of the copy operator.
void operator =( const XmlOutputter &copy );
private:
};
CPPUNIT_NS_END
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( pop )
#endif
#endif // CPPUNIT_XMLTESTRESULTOUTPUTTER_H
+163
View File
@@ -0,0 +1,163 @@
#ifndef CPPUNIT_XMLOUTPUTTERHOOK_H
#define CPPUNIT_XMLOUTPUTTERHOOK_H
#include <cppunit/Portability.h>
CPPUNIT_NS_BEGIN
class Test;
class TestFailure;
class XmlDocument;
class XmlElement;
/*! \brief Hook to customize Xml output.
*
* XmlOutputterHook can be passed to XmlOutputter to customize the XmlDocument.
*
* Common customizations are:
* - adding some datas to successfull or failed test with
* failTestAdded() and successfulTestAdded(),
* - adding some statistics with statisticsAdded(),
* - adding other datas with beginDocument() or endDocument().
*
* See examples/ClockerPlugIn which makes use of most the hook.
*
* Another simple example of an outputter hook is shown below. It may be
* used to add some meta information to your result files. In the example,
* the author name as well as the project name and test creation date is
* added to the head of the xml file.
*
* In order to make this information stored within the xml file, the virtual
* member function beginDocument() is overriden where a new
* XmlElement object is created.
*
* This element is simply added to the root node of the document which
* makes the information automatically being stored when the xml file
* is written.
*
* \code
* #include <cppunit/XmlOutputterHook.h>
* #include <cppunit/XmlElement.h>
* #include <cppunit/tools/StringTools.h>
*
* ...
*
* class MyXmlOutputterHook : public CppUnit::XmlOutputterHook
* {
* public:
* MyXmlOutputterHook(const std::string projectName,
* const std::string author)
* {
* m_projectName = projectName;
* m_author = author;
* };
*
* virtual ~MyXmlOutputterHook()
* {
* };
*
* void beginDocument(CppUnit::XmlDocument* document)
* {
* if (!document)
* return;
*
* // dump current time
* std::string szDate = CppUnit::StringTools::toString( (int)time(0) );
* CppUnit::XmlElement* metaEl = new CppUnit::XmlElement("SuiteInfo",
* "");
*
* metaEl->addElement( new CppUnit::XmlElement("Author", m_author) );
* metaEl->addElement( new CppUnit::XmlElement("Project", m_projectName) );
* metaEl->addElement( new CppUnit::XmlElement("Date", szDate ) );
*
* document->rootElement().addElement(metaEl);
* };
* private:
* std::string m_projectName;
* std::string m_author;
* };
* \endcode
*
* Within your application's main code, you need to snap the hook
* object into your xml outputter object like shown below:
*
* \code
* CppUnit::TextUi::TestRunner runner;
* std::ofstream outputFile("testResults.xml");
*
* CppUnit::XmlOutputter* outputter = new CppUnit::XmlOutputter( &runner.result(),
* outputFile );
* MyXmlOutputterHook hook("myProject", "meAuthor");
* outputter->addHook(&hook);
* runner.setOutputter(outputter);
* runner.addTest( VectorFixture::suite() );
* runner.run();
* outputFile.close();
* \endcode
*
* This results into the following output:
*
* \code
* <TestRun>
* <suiteInfo>
* <author>meAuthor</author>
* <project>myProject</project>
* <date>1028143912</date>
* </suiteInfo>
* <FailedTests>
* ...
* \endcode
*
* \see XmlOutputter, CppUnitTestPlugIn.
*/
class CPPUNIT_API XmlOutputterHook
{
public:
/*! Called before any elements is added to the root element.
* \param document XML Document being created.
*/
virtual void beginDocument( XmlDocument *document );
/*! Called after adding all elements to the root element.
* \param document XML Document being created.
*/
virtual void endDocument( XmlDocument *document );
/*! Called after adding a fail test element.
* \param document XML Document being created.
* \param testElement \<FailedTest\> element.
* \param test Test that failed.
* \param failure Test failure data.
*/
virtual void failTestAdded( XmlDocument *document,
XmlElement *testElement,
Test *test,
TestFailure *failure );
/*! Called after adding a successful test element.
* \param document XML Document being created.
* \param testElement \<Test\> element.
* \param test Test that was successful.
*/
virtual void successfulTestAdded( XmlDocument *document,
XmlElement *testElement,
Test *test );
/*! Called after adding the statistic element.
* \param document XML Document being created.
* \param statisticsElement \<Statistics\> element.
*/
virtual void statisticsAdded( XmlDocument *document,
XmlElement *statisticsElement );
virtual ~XmlOutputterHook() {}
};
CPPUNIT_NS_END
#endif // CPPUNIT_XMLOUTPUTTERHOOK_H
+160
View File
@@ -0,0 +1,160 @@
#ifndef _INCLUDE_CPPUNIT_CONFIG_AUTO_H
#define _INCLUDE_CPPUNIT_CONFIG_AUTO_H 1
/* include/cppunit/config-auto.h. Generated automatically at end of configure. */
/* config/config.h. Generated from config.h.in by configure. */
/* config/config.h.in. Generated from configure.in by autoheader. */
/* define if library uses std::string::compare(string,pos,n) */
/* #undef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST */
/* define if the library defines strstream */
#ifndef CPPUNIT_HAVE_CLASS_STRSTREAM
#define CPPUNIT_HAVE_CLASS_STRSTREAM 1
#endif
/* Define to 1 if you have the <cmath> header file. */
#ifndef CPPUNIT_HAVE_CMATH
#define CPPUNIT_HAVE_CMATH 1
#endif
/* Define if you have the GNU dld library. */
/* #undef CPPUNIT_HAVE_DLD */
/* Define to 1 if you have the `dlerror' function. */
/* #undef CPPUNIT_HAVE_DLERROR */
/* Define to 1 if you have the <dlfcn.h> header file. */
/* #undef CPPUNIT_HAVE_DLFCN_H */
/* Define to 1 if you have the `finite' function. */
#ifndef CPPUNIT_HAVE_FINITE
#define CPPUNIT_HAVE_FINITE 1
#endif
/* define if the compiler supports GCC C++ ABI name demangling */
/* #undef CPPUNIT_HAVE_GCC_ABI_DEMANGLE */
/* Define to 1 if you have the <inttypes.h> header file. */
#ifndef CPPUNIT_HAVE_INTTYPES_H
#define CPPUNIT_HAVE_INTTYPES_H 1
#endif
/* define if compiler has isfinite */
#ifndef CPPUNIT_HAVE_ISFINITE
#define CPPUNIT_HAVE_ISFINITE 1
#endif
/* Define if you have the libdl library or equivalent. */
/* #undef CPPUNIT_HAVE_LIBDL */
/* Define to 1 if you have the <memory.h> header file. */
#ifndef CPPUNIT_HAVE_MEMORY_H
#define CPPUNIT_HAVE_MEMORY_H 1
#endif
/* define to 1 if the compiler implements namespaces */
#ifndef CPPUNIT_HAVE_NAMESPACES
#define CPPUNIT_HAVE_NAMESPACES 1
#endif
/* define if the compiler supports Run-Time Type Identification */
#ifndef CPPUNIT_HAVE_RTTI
#define CPPUNIT_HAVE_RTTI 1
#endif
/* Define if you have the shl_load function. */
/* #undef CPPUNIT_HAVE_SHL_LOAD */
/* define if the compiler has stringstream */
#ifndef CPPUNIT_HAVE_SSTREAM
#define CPPUNIT_HAVE_SSTREAM 1
#endif
/* Define to 1 if you have the <stdint.h> header file. */
#ifndef CPPUNIT_HAVE_STDINT_H
#define CPPUNIT_HAVE_STDINT_H 1
#endif
/* Define to 1 if you have the <stdlib.h> header file. */
#ifndef CPPUNIT_HAVE_STDLIB_H
#define CPPUNIT_HAVE_STDLIB_H 1
#endif
/* Define to 1 if you have the <strings.h> header file. */
#ifndef CPPUNIT_HAVE_STRINGS_H
#define CPPUNIT_HAVE_STRINGS_H 1
#endif
/* Define to 1 if you have the <string.h> header file. */
#ifndef CPPUNIT_HAVE_STRING_H
#define CPPUNIT_HAVE_STRING_H 1
#endif
/* Define to 1 if you have the <strstream> header file. */
#ifndef CPPUNIT_HAVE_STRSTREAM
#define CPPUNIT_HAVE_STRSTREAM 1
#endif
/* Define to 1 if you have the <sys/stat.h> header file. */
#ifndef CPPUNIT_HAVE_SYS_STAT_H
#define CPPUNIT_HAVE_SYS_STAT_H 1
#endif
/* Define to 1 if you have the <sys/types.h> header file. */
#ifndef CPPUNIT_HAVE_SYS_TYPES_H
#define CPPUNIT_HAVE_SYS_TYPES_H 1
#endif
/* Define to 1 if you have the <unistd.h> header file. */
#ifndef CPPUNIT_HAVE_UNISTD_H
#define CPPUNIT_HAVE_UNISTD_H 1
#endif
/* Name of package */
#ifndef CPPUNIT_PACKAGE
#define CPPUNIT_PACKAGE "cppunit"
#endif
/* Define to the address where bug reports for this package should be sent. */
#ifndef CPPUNIT_PACKAGE_BUGREPORT
#define CPPUNIT_PACKAGE_BUGREPORT ""
#endif
/* Define to the full name of this package. */
#ifndef CPPUNIT_PACKAGE_NAME
#define CPPUNIT_PACKAGE_NAME ""
#endif
/* Define to the full name and version of this package. */
#ifndef CPPUNIT_PACKAGE_STRING
#define CPPUNIT_PACKAGE_STRING ""
#endif
/* Define to the one symbol short name of this package. */
#ifndef CPPUNIT_PACKAGE_TARNAME
#define CPPUNIT_PACKAGE_TARNAME ""
#endif
/* Define to the version of this package. */
#ifndef CPPUNIT_PACKAGE_VERSION
#define CPPUNIT_PACKAGE_VERSION ""
#endif
/* Define to 1 if you have the ANSI C header files. */
#ifndef CPPUNIT_STDC_HEADERS
#define CPPUNIT_STDC_HEADERS 1
#endif
/* Define to 1 to use type_info::name() for class names */
#ifndef CPPUNIT_USE_TYPEINFO_NAME
#define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI
#endif
/* Version number of package */
#ifndef CPPUNIT_VERSION
#define CPPUNIT_VERSION "1.12.1"
#endif
/* _INCLUDE_CPPUNIT_CONFIG_AUTO_H */
#endif
+33
View File
@@ -0,0 +1,33 @@
#ifndef CPPUNIT_CONFIG_CPPUNITAPI
#define CPPUNIT_CONFIG_CPPUNITAPI
#undef CPPUNIT_API
#ifdef WIN32
// define CPPUNIT_DLL_BUILD when building CppUnit dll.
#ifdef CPPUNIT_BUILD_DLL
#define CPPUNIT_API __declspec(dllexport)
#endif
// define CPPUNIT_DLL when linking to CppUnit dll.
#ifdef CPPUNIT_DLL
#define CPPUNIT_API __declspec(dllimport)
#endif
#ifdef CPPUNIT_API
#undef CPPUNIT_NEED_DLL_DECL
#define CPPUNIT_NEED_DLL_DECL 1
#endif
#endif
#ifndef CPPUNIT_API
#define CPPUNIT_API
#undef CPPUNIT_NEED_DLL_DECL
#define CPPUNIT_NEED_DLL_DECL 0
#endif
#endif // CPPUNIT_CONFIG_CPPUNITAPI
+76
View File
@@ -0,0 +1,76 @@
#ifndef CPPUNIT_CONFIG_SELECTDLLLOADER_H
#define CPPUNIT_CONFIG_SELECTDLLLOADER_H
/*! \file
* Selects DynamicLibraryManager implementation.
*
* Don't include this file directly. Include Portability.h instead.
*/
/*!
* \def CPPUNIT_NO_TESTPLUGIN
* \brief If defined, then plug-in related classes and functions will not be compiled.
*
* \internal
* CPPUNIT_HAVE_WIN32_DLL_LOADER
* If defined, Win32 implementation of DynamicLibraryManager will be used.
*
* CPPUNIT_HAVE_BEOS_DLL_LOADER
* If defined, BeOs implementation of DynamicLibraryManager will be used.
*
* CPPUNIT_HAVE_UNIX_DLL_LOADER
* If defined, Unix implementation (dlfcn.h) of DynamicLibraryManager will be used.
*/
/*!
* \def CPPUNIT_PLUGIN_EXPORT
* \ingroup WritingTestPlugIn
* \brief A macro to export a function from a dynamic library
*
* This macro export the C function following it from a dynamic library.
* Exporting the function makes it accessible to the DynamicLibraryManager.
*
* Example of usage:
* \code
* #include <cppunit/include/plugin/TestPlugIn.h>
*
* CPPUNIT_PLUGIN_EXPORT CppUnitTestPlugIn *CPPUNIT_PLUGIN_EXPORTED_NAME(void)
* {
* ...
* return &myPlugInInterface;
* }
* \endcode
*/
#if !defined(CPPUNIT_NO_TESTPLUGIN)
// Is WIN32 platform ?
#if defined(WIN32)
#define CPPUNIT_HAVE_WIN32_DLL_LOADER 1
#undef CPPUNIT_PLUGIN_EXPORT
#define CPPUNIT_PLUGIN_EXPORT extern "C" __declspec(dllexport)
// Is BeOS platform ?
#elif defined(__BEOS__)
#define CPPUNIT_HAVE_BEOS_DLL_LOADER 1
// Is Unix platform and have shl_load() (hp-ux)
#elif defined(CPPUNIT_HAVE_SHL_LOAD)
#define CPPUNIT_HAVE_UNIX_SHL_LOADER 1
// Is Unix platform and have include <dlfcn.h>
#elif defined(CPPUNIT_HAVE_LIBDL)
#define CPPUNIT_HAVE_UNIX_DLL_LOADER 1
// Otherwise, disable support for DllLoader
#else
#define CPPUNIT_NO_TESTPLUGIN 1
#endif
#if !defined(CPPUNIT_PLUGIN_EXPORT)
#define CPPUNIT_PLUGIN_EXPORT extern "C"
#endif // !defined(CPPUNIT_PLUGIN_EXPORT)
#endif // !defined(CPPUNIT_NO_TESTPLUGIN)
#endif // CPPUNIT_CONFIG_SELECTDLLLOADER_H
+14
View File
@@ -0,0 +1,14 @@
#ifndef CPPUNIT_CONFIG_H_INCLUDED
#define CPPUNIT_CONFIG_H_INCLUDED
#include <cppunit/Portability.h>
#ifdef _MSC_VER
#pragma warning(disable: 4018 4284 4146)
#if _MSC_VER >= 1400
#pragma warning(disable: 4996) // sprintf is deprecated
#endif
#endif
#endif // CPPUNIT_CONFIG_H_INCLUDED
+47
View File
@@ -0,0 +1,47 @@
#ifndef _INCLUDE_CPPUNIT_CONFIG_BCB5_H
#define _INCLUDE_CPPUNIT_CONFIG_BCB5_H 1
#define HAVE_CMATH 1
/* include/cppunit/config-bcb5.h. Manually adapted from
include/cppunit/config-auto.h */
/* define to 1 if the compiler implements namespaces */
#ifndef CPPUNIT_HAVE_NAMESPACES
#define CPPUNIT_HAVE_NAMESPACES 1
#endif
/* define if library uses std::string::compare(string,pos,n) */
#ifndef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
#define CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST 0
#endif
/* Define if you have the <dlfcn.h> header file. */
#ifdef CPPUNIT_HAVE_DLFCN_H
#undef CPPUNIT_HAVE_DLFCN_H
#endif
/* define to 1 if the compiler implements namespaces */
#ifndef CPPUNIT_HAVE_NAMESPACES
#define CPPUNIT_HAVE_NAMESPACES 1
#endif
/* define if the compiler supports Run-Time Type Identification */
#ifndef CPPUNIT_HAVE_RTTI
#define CPPUNIT_HAVE_RTTI 1
#endif
/* Define to 1 to use type_info::name() for class names */
#ifndef CPPUNIT_USE_TYPEINFO_NAME
#define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI
#endif
#define CPPUNIT_HAVE_SSTREAM 1
/* Name of package */
#ifndef CPPUNIT_PACKAGE
#define CPPUNIT_PACKAGE "cppunit"
#endif
/* _INCLUDE_CPPUNIT_CONFIG_BCB5_H */
#endif
+78
View File
@@ -0,0 +1,78 @@
#ifndef _INCLUDE_CPPUNIT_CONFIG_EVC4_H
#define _INCLUDE_CPPUNIT_CONFIG_EVC4_H 1
#if _MSC_VER > 1000 // VC++
#pragma warning( disable : 4786 ) // disable warning debug symbol > 255...
#endif // _MSC_VER > 1000
#define HAVE_CMATH 1
/* include/cppunit/config-msvc6.h. Manually adapted from
include/cppunit/config-auto.h */
/* define to 1 if the compiler implements namespaces */
#ifndef CPPUNIT_HAVE_NAMESPACES
#define CPPUNIT_HAVE_NAMESPACES 1
#endif
/* define if library uses std::string::compare(string,pos,n) */
#ifdef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
#undef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
#endif
/* Define if you have the <dlfcn.h> header file. */
#ifdef CPPUNIT_HAVE_DLFCN_H
#undef CPPUNIT_HAVE_DLFCN_H
#endif
/* define to 1 if the compiler implements namespaces */
#ifndef CPPUNIT_HAVE_NAMESPACES
#define CPPUNIT_HAVE_NAMESPACES 1
#endif
/* define if the compiler supports Run-Time Type Identification */
#ifndef CPPUNIT_HAVE_RTTI
#define CPPUNIT_HAVE_RTTI 0
#endif
/* Define to 1 to use type_info::name() for class names */
#ifndef CPPUNIT_USE_TYPEINFO_NAME
#define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI
#endif
#define CPPUNIT_NO_STREAM 1
#define CPPUNIT_NO_ASSERT 1
#define CPPUNIT_HAVE_SSTREAM 0
/* Name of package */
#ifndef CPPUNIT_PACKAGE
#define CPPUNIT_PACKAGE "cppunit"
#endif
// Compiler error location format for CompilerOutputter
// See class CompilerOutputter for format.
#undef CPPUNIT_COMPILER_LOCATION_FORMAT
#if _MSC_VER >= 1300 // VS 7.0
# define CPPUNIT_COMPILER_LOCATION_FORMAT "%p(%l) : error : "
#else
# define CPPUNIT_COMPILER_LOCATION_FORMAT "%p(%l):"
#endif
/* define to 1 if the compiler has _finite() */
#ifndef CPPUNIT_HAVE__FINITE
#define CPPUNIT_HAVE__FINITE 1
#endif
// Uncomment to turn on STL wrapping => use this to test compilation.
// This will make CppUnit subclass std::vector & co to provide default
// parameter.
/*#define CPPUNIT_STD_NEED_ALLOCATOR 1
#define CPPUNIT_STD_ALLOCATOR std::allocator<T>
//#define CPPUNIT_NO_NAMESPACE 1
*/
/* _INCLUDE_CPPUNIT_CONFIG_EVC4_H */
#endif
+58
View File
@@ -0,0 +1,58 @@
#ifndef _INCLUDE_CPPUNIT_CONFIG_MAC_H
#define _INCLUDE_CPPUNIT_CONFIG_MAC_H 1
/* MacOS X should be installed using the configure script.
This file is for other macs.
It is not integrated into <cppunit/Portability.h> because we don't
know a suitable preprocessor symbol that will distinguish MacOS X
from other MacOS versions. Email us if you know the answer.
*/
/* define if library uses std::string::compare(string,pos,n) */
#ifdef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
#undef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
#endif
/* define if the library defines strstream */
#ifndef CPPUNIT_HAVE_CLASS_STRSTREAM
#define CPPUNIT_HAVE_CLASS_STRSTREAM 1
#endif
/* Define if you have the <cmath> header file. */
#ifdef CPPUNIT_HAVE_CMATH
#undef CPPUNIT_HAVE_CMATH
#endif
/* Define if you have the <dlfcn.h> header file. */
#ifdef CPPUNIT_HAVE_DLFCN_H
#undef CPPUNIT_HAVE_DLFCN_H
#endif
/* define to 1 if the compiler implements namespaces */
#ifndef CPPUNIT_HAVE_NAMESPACES
#define CPPUNIT_HAVE_NAMESPACES 1
#endif
/* define if the compiler supports Run-Time Type Identification */
#ifndef CPPUNIT_HAVE_RTTI
#define CPPUNIT_HAVE_RTTI 1
#endif
/* define if the compiler has stringstream */
#ifndef CPPUNIT_HAVE_SSTREAM
#define CPPUNIT_HAVE_SSTREAM 1
#endif
/* Define if you have the <strstream> header file. */
#ifndef CPPUNIT_HAVE_STRSTREAM
#define CPPUNIT_HAVE_STRSTREAM 1
#endif
/* Define to 1 to use type_info::name() for class names */
#ifndef CPPUNIT_USE_TYPEINFO_NAME
#define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI
#endif
/* _INCLUDE_CPPUNIT_CONFIG_MAC_H */
#endif
+83
View File
@@ -0,0 +1,83 @@
#ifndef _INCLUDE_CPPUNIT_CONFIG_MSVC6_H
#define _INCLUDE_CPPUNIT_CONFIG_MSVC6_H 1
#if _MSC_VER > 1000 // VC++
#pragma warning( disable : 4786 ) // disable warning debug symbol > 255...
#endif // _MSC_VER > 1000
#define HAVE_CMATH 1
/* include/cppunit/config-msvc6.h. Manually adapted from
include/cppunit/config-auto.h */
/* define to 1 if the compiler implements namespaces */
#ifndef CPPUNIT_HAVE_NAMESPACES
#define CPPUNIT_HAVE_NAMESPACES 1
#endif
/* define if library uses std::string::compare(string,pos,n) */
#ifdef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
#undef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
#endif
/* Define if you have the <dlfcn.h> header file. */
#ifdef CPPUNIT_HAVE_DLFCN_H
#undef CPPUNIT_HAVE_DLFCN_H
#endif
/* define to 1 if the compiler implements namespaces */
#ifndef CPPUNIT_HAVE_NAMESPACES
#define CPPUNIT_HAVE_NAMESPACES 1
#endif
/* define if the compiler supports Run-Time Type Identification */
#ifndef CPPUNIT_HAVE_RTTI
# ifdef _CPPRTTI // Defined by the compiler option /GR
# define CPPUNIT_HAVE_RTTI 1
# else
# define CPPUNIT_HAVE_RTTI 0
# endif
#endif
/* Define to 1 to use type_info::name() for class names */
#ifndef CPPUNIT_USE_TYPEINFO_NAME
#define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI
#endif
#define CPPUNIT_HAVE_SSTREAM 1
/* Name of package */
#ifndef CPPUNIT_PACKAGE
#define CPPUNIT_PACKAGE "cppunit"
#endif
// Compiler error location format for CompilerOutputter
// See class CompilerOutputter for format.
#undef CPPUNIT_COMPILER_LOCATION_FORMAT
#if _MSC_VER >= 1300 // VS 7.0
# define CPPUNIT_COMPILER_LOCATION_FORMAT "%p(%l) : error : "
#else
# define CPPUNIT_COMPILER_LOCATION_FORMAT "%p(%l):"
#endif
// Define to 1 if the compiler support C++ style cast.
#define CPPUNIT_HAVE_CPP_CAST 1
/* define to 1 if the compiler has _finite() */
#ifndef CPPUNIT_HAVE__FINITE
#define CPPUNIT_HAVE__FINITE 1
#endif
// Uncomment to turn on STL wrapping => use this to test compilation.
// This will make CppUnit subclass std::vector & co to provide default
// parameter.
/*#define CPPUNIT_STD_NEED_ALLOCATOR 1
#define CPPUNIT_STD_ALLOCATOR std::allocator<T>
//#define CPPUNIT_NO_NAMESPACE 1
*/
/* _INCLUDE_CPPUNIT_CONFIG_MSVC6_H */
#endif
+83
View File
@@ -0,0 +1,83 @@
#ifndef CPPUNIT_EXTENSIONS_AUTOREGISTERSUITE_H
#define CPPUNIT_EXTENSIONS_AUTOREGISTERSUITE_H
#include <cppunit/extensions/TestSuiteFactory.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <string>
CPPUNIT_NS_BEGIN
/*! \brief (Implementation) Automatically register the test suite of the specified type.
*
* You should not use this class directly. Instead, use the following macros:
* - CPPUNIT_TEST_SUITE_REGISTRATION()
* - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION()
*
* This object will register the test returned by TestCaseType::suite()
* when constructed to the test registry.
*
* This object is intented to be used as a static variable.
*
*
* \param TestCaseType Type of the test case which suite is registered.
* \see CPPUNIT_TEST_SUITE_REGISTRATION, CPPUNIT_TEST_SUITE_NAMED_REGISTRATION
* \see CppUnit::TestFactoryRegistry.
*/
template<class TestCaseType>
class AutoRegisterSuite
{
public:
/** Auto-register the suite factory in the global registry.
*/
AutoRegisterSuite()
: m_registry( &TestFactoryRegistry::getRegistry() )
{
m_registry->registerFactory( &m_factory );
}
/** Auto-register the suite factory in the specified registry.
* \param name Name of the registry.
*/
AutoRegisterSuite( const std::string &name )
: m_registry( &TestFactoryRegistry::getRegistry( name ) )
{
m_registry->registerFactory( &m_factory );
}
~AutoRegisterSuite()
{
if ( TestFactoryRegistry::isValid() )
m_registry->unregisterFactory( &m_factory );
}
private:
TestFactoryRegistry *m_registry;
TestSuiteFactory<TestCaseType> m_factory;
};
/*! \brief (Implementation) Automatically adds a registry into another registry.
*
* Don't use this class. Use the macros CPPUNIT_REGISTRY_ADD() and
* CPPUNIT_REGISTRY_ADD_TO_DEFAULT() instead.
*/
class AutoRegisterRegistry
{
public:
AutoRegisterRegistry( const std::string &which,
const std::string &to )
{
TestFactoryRegistry::getRegistry( to ).addRegistry( which );
}
AutoRegisterRegistry( const std::string &which )
{
TestFactoryRegistry::getRegistry().addRegistry( which );
}
};
CPPUNIT_NS_END
#endif // CPPUNIT_EXTENSIONS_AUTOREGISTERSUITE_H
@@ -0,0 +1,104 @@
#ifndef CPPUNIT_EXTENSIONS_EXCEPTIONTESTCASEDECORATOR_H
#define CPPUNIT_EXTENSIONS_EXCEPTIONTESTCASEDECORATOR_H
#include <cppunit/Portability.h>
#include <cppunit/Exception.h>
#include <cppunit/extensions/TestCaseDecorator.h>
CPPUNIT_NS_BEGIN
/*! \brief Expected exception test case decorator.
*
* A decorator used to assert that a specific test case should throw an
* exception of a given type.
*
* You should use this class only if you need to check the exception object
* state (that a specific cause is set for example). If you don't need to
* do that, you might consider using CPPUNIT_TEST_EXCEPTION() instead.
*
* Intended use is to subclass and override checkException(). Example:
*
* \code
*
* class NetworkErrorTestCaseDecorator :
* public ExceptionTestCaseDecorator<NetworkError>
* {
* public:
* NetworkErrorTestCaseDecorator( NetworkError::Cause expectedCause )
* : m_expectedCause( expectedCause )
* {
* }
* private:
* void checkException( ExpectedExceptionType &e )
* {
* CPPUNIT_ASSERT_EQUAL( m_expectedCause, e.getCause() );
* }
*
* NetworkError::Cause m_expectedCause;
* };
* \endcode
*
*/
template<class ExpectedException>
class ExceptionTestCaseDecorator : public TestCaseDecorator
{
public:
typedef ExpectedException ExpectedExceptionType;
/*! \brief Decorates the specified test.
* \param test TestCase to decorate. Assumes ownership of the test.
*/
ExceptionTestCaseDecorator( TestCase *test )
: TestCaseDecorator( test )
{
}
/*! \brief Checks that the expected exception is thrown by the decorated test.
* is thrown.
*
* Calls the decorated test runTest() and checks that an exception of
* type ExpectedException is thrown. Call checkException() passing the
* exception that was caught so that some assertions can be made if
* needed.
*/
void runTest()
{
try
{
TestCaseDecorator::runTest();
}
catch ( ExpectedExceptionType &e )
{
checkException( e );
return;
}
// Moved outside the try{} statement to handle the case where the
// expected exception type is Exception (expecting assertion failure).
#if CPPUNIT_USE_TYPEINFO_NAME
throw Exception( Message(
"expected exception not thrown",
"Expected exception type: " +
TypeInfoHelper::getClassName(
typeid( ExpectedExceptionType ) ) ) );
#else
throw Exception( Message("expected exception not thrown") );
#endif
}
private:
/*! \brief Called when the exception is caught.
*
* Should be overriden to check the exception.
*/
virtual void checkException( ExpectedExceptionType &e )
{
}
};
CPPUNIT_NS_END
#endif // CPPUNIT_EXTENSIONS_EXCEPTIONTESTCASEDECORATOR_H
+541
View File
@@ -0,0 +1,541 @@
// //////////////////////////////////////////////////////////////////////////
// Header file HelperMacros.h
// (c)Copyright 2000, Baptiste Lepilleur.
// Created: 2001/04/15
// //////////////////////////////////////////////////////////////////////////
#ifndef CPPUNIT_EXTENSIONS_HELPERMACROS_H
#define CPPUNIT_EXTENSIONS_HELPERMACROS_H
#include <cppunit/TestCaller.h>
#include <cppunit/TestSuite.h>
#include <cppunit/extensions/AutoRegisterSuite.h>
#include <cppunit/extensions/ExceptionTestCaseDecorator.h>
#include <cppunit/extensions/TestFixtureFactory.h>
#include <cppunit/extensions/TestNamer.h>
#include <cppunit/extensions/TestSuiteBuilderContext.h>
#include <memory>
/*! \addtogroup WritingTestFixture Writing test fixture
*/
/** @{
*/
/** \file
* Macros intended to ease the definition of test suites.
*
* The macros
* CPPUNIT_TEST_SUITE(), CPPUNIT_TEST(), and CPPUNIT_TEST_SUITE_END()
* are designed to facilitate easy creation of a test suite.
* For example,
*
* \code
* #include <cppunit/extensions/HelperMacros.h>
* class MyTest : public CppUnit::TestFixture {
* CPPUNIT_TEST_SUITE( MyTest );
* CPPUNIT_TEST( testEquality );
* CPPUNIT_TEST( testSetName );
* CPPUNIT_TEST_SUITE_END();
* public:
* void testEquality();
* void testSetName();
* };
* \endcode
*
* The effect of these macros is to define two methods in the
* class MyTest. The first method is an auxiliary function
* named registerTests that you will not need to call directly.
* The second function
* \code static CppUnit::TestSuite *suite()\endcode
* returns a pointer to the suite of tests defined by the CPPUNIT_TEST()
* macros.
*
* Rather than invoking suite() directly,
* the macro CPPUNIT_TEST_SUITE_REGISTRATION() is
* used to create a static variable that automatically
* registers its test suite in a global registry.
* The registry yields a Test instance containing all the
* registered suites.
* \code
* CPPUNIT_TEST_SUITE_REGISTRATION( MyTest );
* CppUnit::Test* tp =
* CppUnit::TestFactoryRegistry::getRegistry().makeTest();
* \endcode
*
* The test suite macros can even be used with templated test classes.
* For example:
*
* \code
* template<typename CharType>
* class StringTest : public CppUnit::TestFixture {
* CPPUNIT_TEST_SUITE( StringTest );
* CPPUNIT_TEST( testAppend );
* CPPUNIT_TEST_SUITE_END();
* public:
* ...
* };
* \endcode
*
* You need to add in an implementation file:
*
* \code
* CPPUNIT_TEST_SUITE_REGISTRATION( StringTest<char> );
* CPPUNIT_TEST_SUITE_REGISTRATION( StringTest<wchar_t> );
* \endcode
*/
/*! \brief Begin test suite
*
* This macro starts the declaration of a new test suite.
* Use CPPUNIT_TEST_SUB_SUITE() instead, if you wish to include the
* test suite of the parent class.
*
* \param ATestFixtureType Type of the test case class. This type \b MUST
* be derived from TestFixture.
* \see CPPUNIT_TEST_SUB_SUITE, CPPUNIT_TEST, CPPUNIT_TEST_SUITE_END,
* \see CPPUNIT_TEST_SUITE_REGISTRATION, CPPUNIT_TEST_EXCEPTION, CPPUNIT_TEST_FAIL.
*/
#define CPPUNIT_TEST_SUITE( ATestFixtureType ) \
public: \
typedef ATestFixtureType TestFixtureType; \
\
private: \
static const CPPUNIT_NS::TestNamer &getTestNamer__() \
{ \
static CPPUNIT_TESTNAMER_DECL( testNamer, ATestFixtureType ); \
return testNamer; \
} \
\
public: \
typedef CPPUNIT_NS::TestSuiteBuilderContext<TestFixtureType> \
TestSuiteBuilderContextType; \
\
static void \
addTestsToSuite( CPPUNIT_NS::TestSuiteBuilderContextBase &baseContext ) \
{ \
TestSuiteBuilderContextType context( baseContext )
/*! \brief Begin test suite (includes parent suite)
*
* This macro may only be used in a class whose parent class
* defines a test suite using CPPUNIT_TEST_SUITE() or CPPUNIT_TEST_SUB_SUITE().
*
* This macro begins the declaration of a test suite, in the same
* manner as CPPUNIT_TEST_SUITE(). In addition, the test suite of the
* parent is automatically inserted in the test suite being
* defined.
*
* Here is an example:
*
* \code
* #include <cppunit/extensions/HelperMacros.h>
* class MySubTest : public MyTest {
* CPPUNIT_TEST_SUB_SUITE( MySubTest, MyTest );
* CPPUNIT_TEST( testAdd );
* CPPUNIT_TEST( testSub );
* CPPUNIT_TEST_SUITE_END();
* public:
* void testAdd();
* void testSub();
* };
* \endcode
*
* \param ATestFixtureType Type of the test case class. This type \b MUST
* be derived from TestFixture.
* \param ASuperClass Type of the parent class.
* \see CPPUNIT_TEST_SUITE.
*/
#define CPPUNIT_TEST_SUB_SUITE( ATestFixtureType, ASuperClass ) \
public: \
typedef ASuperClass ParentTestFixtureType; \
private: \
CPPUNIT_TEST_SUITE( ATestFixtureType ); \
ParentTestFixtureType::addTestsToSuite( baseContext )
/*! \brief End declaration of the test suite.
*
* After this macro, member access is set to "private".
*
* \see CPPUNIT_TEST_SUITE.
* \see CPPUNIT_TEST_SUITE_REGISTRATION.
*/
#define CPPUNIT_TEST_SUITE_END() \
} \
\
static CPPUNIT_NS::TestSuite *suite() \
{ \
const CPPUNIT_NS::TestNamer &namer = getTestNamer__(); \
std::auto_ptr<CPPUNIT_NS::TestSuite> suite( \
new CPPUNIT_NS::TestSuite( namer.getFixtureName() )); \
CPPUNIT_NS::ConcretTestFixtureFactory<TestFixtureType> factory; \
CPPUNIT_NS::TestSuiteBuilderContextBase context( *suite.get(), \
namer, \
factory ); \
TestFixtureType::addTestsToSuite( context ); \
return suite.release(); \
} \
private: /* dummy typedef so that the macro can still end with ';'*/ \
typedef int CppUnitDummyTypedefForSemiColonEnding__
/*! \brief End declaration of an abstract test suite.
*
* Use this macro to indicate that the %TestFixture is abstract. No
* static suite() method will be declared.
*
* After this macro, member access is set to "private".
*
* Here is an example of usage:
*
* The abstract test fixture:
* \code
* #include <cppunit/extensions/HelperMacros.h>
* class AbstractDocument;
* class AbstractDocumentTest : public CppUnit::TestFixture {
* CPPUNIT_TEST_SUITE( AbstractDocumentTest );
* CPPUNIT_TEST( testInsertText );
* CPPUNIT_TEST_SUITE_END_ABSTRACT();
* public:
* void testInsertText();
*
* void setUp()
* {
* m_document = makeDocument();
* }
*
* void tearDown()
* {
* delete m_document;
* }
* protected:
* virtual AbstractDocument *makeDocument() =0;
*
* AbstractDocument *m_document;
* };\endcode
*
* The concret test fixture:
* \code
* class RichTextDocumentTest : public AbstractDocumentTest {
* CPPUNIT_TEST_SUB_SUITE( RichTextDocumentTest, AbstractDocumentTest );
* CPPUNIT_TEST( testInsertFormatedText );
* CPPUNIT_TEST_SUITE_END();
* public:
* void testInsertFormatedText();
* protected:
* AbstractDocument *makeDocument()
* {
* return new RichTextDocument();
* }
* };\endcode
*
* \see CPPUNIT_TEST_SUB_SUITE.
* \see CPPUNIT_TEST_SUITE_REGISTRATION.
*/
#define CPPUNIT_TEST_SUITE_END_ABSTRACT() \
} \
private: /* dummy typedef so that the macro can still end with ';'*/ \
typedef int CppUnitDummyTypedefForSemiColonEnding__
/*! \brief Add a test to the suite (for custom test macro).
*
* The specified test will be added to the test suite being declared. This macro
* is intended for \e advanced usage, to extend %CppUnit by creating new macro such
* as CPPUNIT_TEST_EXCEPTION()...
*
* Between macro CPPUNIT_TEST_SUITE() and CPPUNIT_TEST_SUITE_END(), you can assume
* that the following variables can be used:
* \code
* typedef TestSuiteBuilder<TestFixtureType> TestSuiteBuilderType;
* TestSuiteBuilderType &context;
* \endcode
*
* \c context can be used to name test case, create new test fixture instance,
* or add test case to the test fixture suite.
*
* Below is an example that show how to use this macro to create new macro to add
* test to the fixture suite. The macro below show how you would add a new type
* of test case which fails if the execution last more than a given time limit.
* It relies on an imaginary TimeOutTestCaller class which has an interface similar
* to TestCaller.
*
* \code
* #define CPPUNITEX_TEST_TIMELIMIT( testMethod, timeLimit ) \
* CPPUNIT_TEST_SUITE_ADD_TEST( (new TimeOutTestCaller<TestFixtureType>( \
* namer.getTestNameFor( #testMethod ), \
* &TestFixtureType::testMethod, \
* factory.makeFixture(), \
* timeLimit ) ) )
*
* class PerformanceTest : CppUnit::TestFixture
* {
* public:
* CPPUNIT_TEST_SUITE( PerformanceTest );
* CPPUNITEX_TEST_TIMELIMIT( testSortReverseOrder, 5.0 );
* CPPUNIT_TEST_SUITE_END();
*
* void testSortReverseOrder();
* };
* \endcode
*
* \param test Test to add to the suite. Must be a subclass of Test. The test name
* should have been obtained using TestNamer::getTestNameFor().
*/
#define CPPUNIT_TEST_SUITE_ADD_TEST( test ) \
context.addTest( test )
/*! \brief Add a method to the suite.
* \param testMethod Name of the method of the test case to add to the
* suite. The signature of the method must be of
* type: void testMethod();
* \see CPPUNIT_TEST_SUITE.
*/
#define CPPUNIT_TEST( testMethod ) \
CPPUNIT_TEST_SUITE_ADD_TEST( \
( new CPPUNIT_NS::TestCaller<TestFixtureType>( \
context.getTestNameFor( #testMethod), \
&TestFixtureType::testMethod, \
context.makeFixture() ) ) )
/*! \brief Add a test which fail if the specified exception is not caught.
*
* Example:
* \code
* #include <cppunit/extensions/HelperMacros.h>
* #include <vector>
* class MyTest : public CppUnit::TestFixture {
* CPPUNIT_TEST_SUITE( MyTest );
* CPPUNIT_TEST_EXCEPTION( testVectorAtThrow, std::invalid_argument );
* CPPUNIT_TEST_SUITE_END();
* public:
* void testVectorAtThrow()
* {
* std::vector<int> v;
* v.at( 1 ); // must throw exception std::invalid_argument
* }
* };
* \endcode
*
* \param testMethod Name of the method of the test case to add to the suite.
* \param ExceptionType Type of the exception that must be thrown by the test
* method.
* \deprecated Use the assertion macro CPPUNIT_ASSERT_THROW instead.
*/
#define CPPUNIT_TEST_EXCEPTION( testMethod, ExceptionType ) \
CPPUNIT_TEST_SUITE_ADD_TEST( \
(new CPPUNIT_NS::ExceptionTestCaseDecorator< ExceptionType >( \
new CPPUNIT_NS::TestCaller< TestFixtureType >( \
context.getTestNameFor( #testMethod ), \
&TestFixtureType::testMethod, \
context.makeFixture() ) ) ) )
/*! \brief Adds a test case which is excepted to fail.
*
* The added test case expect an assertion to fail. You usually used that type
* of test case when testing custom assertion macros.
*
* \code
* CPPUNIT_TEST_FAIL( testAssertFalseFail );
*
* void testAssertFalseFail()
* {
* CPPUNIT_ASSERT( false );
* }
* \endcode
* \see CreatingNewAssertions.
* \deprecated Use the assertion macro CPPUNIT_ASSERT_ASSERTION_FAIL instead.
*/
#define CPPUNIT_TEST_FAIL( testMethod ) \
CPPUNIT_TEST_EXCEPTION( testMethod, CPPUNIT_NS::Exception )
/*! \brief Adds some custom test cases.
*
* Use this to add one or more test cases to the fixture suite. The specified
* method is called with a context parameter that can be used to name,
* instantiate fixture, and add instantiated test case to the fixture suite.
* The specified method must have the following signature:
* \code
* static void aMethodName( TestSuiteBuilderContextType &context );
* \endcode
*
* \c TestSuiteBuilderContextType is typedef to
* TestSuiteBuilderContext<TestFixtureType> declared by CPPUNIT_TEST_SUITE().
*
* Here is an example that add two custom tests:
*
* \code
* #include <cppunit/extensions/HelperMacros.h>
*
* class MyTest : public CppUnit::TestFixture {
* CPPUNIT_TEST_SUITE( MyTest );
* CPPUNIT_TEST_SUITE_ADD_CUSTOM_TESTS( addTimeOutTests );
* CPPUNIT_TEST_SUITE_END();
* public:
* static void addTimeOutTests( TestSuiteBuilderContextType &context )
* {
* context.addTest( new TimeOutTestCaller( context.getTestNameFor( "test1" ) ),
* &MyTest::test1,
* context.makeFixture(),
* 5.0 );
* context.addTest( new TimeOutTestCaller( context.getTestNameFor( "test2" ) ),
* &MyTest::test2,
* context.makeFixture(),
* 5.0 );
* }
*
* void test1()
* {
* // Do some test that may never end...
* }
*
* void test2()
* {
* // Do some test that may never end...
* }
* };
* \endcode
* @param testAdderMethod Name of the method called to add the test cases.
*/
#define CPPUNIT_TEST_SUITE_ADD_CUSTOM_TESTS( testAdderMethod ) \
testAdderMethod( context )
/*! \brief Adds a property to the test suite builder context.
* \param APropertyKey Key of the property to add.
* \param APropertyValue Value for the added property.
* Example:
* \code
* CPPUNIT_TEST_SUITE_PROPERTY("XmlFileName", "paraTest.xml"); \endcode
*/
#define CPPUNIT_TEST_SUITE_PROPERTY( APropertyKey, APropertyValue ) \
context.addProperty( std::string(APropertyKey), \
std::string(APropertyValue) )
/** @}
*/
/*! Adds the specified fixture suite to the unnamed registry.
* \ingroup CreatingTestSuite
*
* This macro declares a static variable whose construction
* causes a test suite factory to be inserted in a global registry
* of such factories. The registry is available by calling
* the static function CppUnit::TestFactoryRegistry::getRegistry().
*
* \param ATestFixtureType Type of the test case class.
* \warning This macro should be used only once per line of code (the line
* number is used to name a hidden static variable).
* \see CPPUNIT_TEST_SUITE_NAMED_REGISTRATION
* \see CPPUNIT_REGISTRY_ADD_TO_DEFAULT
* \see CPPUNIT_REGISTRY_ADD
* \see CPPUNIT_TEST_SUITE, CppUnit::AutoRegisterSuite,
* CppUnit::TestFactoryRegistry.
*/
#define CPPUNIT_TEST_SUITE_REGISTRATION( ATestFixtureType ) \
static CPPUNIT_NS::AutoRegisterSuite< ATestFixtureType > \
CPPUNIT_MAKE_UNIQUE_NAME(autoRegisterRegistry__ )
/** Adds the specified fixture suite to the specified registry suite.
* \ingroup CreatingTestSuite
*
* This macro declares a static variable whose construction
* causes a test suite factory to be inserted in the global registry
* suite of the specified name. The registry is available by calling
* the static function CppUnit::TestFactoryRegistry::getRegistry().
*
* For the suite name, use a string returned by a static function rather
* than a hardcoded string. That way, you can know what are the name of
* named registry and you don't risk mistyping the registry name.
*
* \code
* // MySuites.h
* namespace MySuites {
* std::string math() {
* return "Math";
* }
* }
*
* // ComplexNumberTest.cpp
* #include "MySuites.h"
*
* CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ComplexNumberTest, MySuites::math() );
* \endcode
*
* \param ATestFixtureType Type of the test case class.
* \param suiteName Name of the global registry suite the test suite is
* registered into.
* \warning This macro should be used only once per line of code (the line
* number is used to name a hidden static variable).
* \see CPPUNIT_TEST_SUITE_REGISTRATION
* \see CPPUNIT_REGISTRY_ADD_TO_DEFAULT
* \see CPPUNIT_REGISTRY_ADD
* \see CPPUNIT_TEST_SUITE, CppUnit::AutoRegisterSuite,
* CppUnit::TestFactoryRegistry..
*/
#define CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ATestFixtureType, suiteName ) \
static CPPUNIT_NS::AutoRegisterSuite< ATestFixtureType > \
CPPUNIT_MAKE_UNIQUE_NAME(autoRegisterRegistry__ )(suiteName)
/*! Adds that the specified registry suite to another registry suite.
* \ingroup CreatingTestSuite
*
* Use this macros to automatically create test registry suite hierarchy. For example,
* if you want to create the following hierarchy:
* - Math
* - IntegerMath
* - FloatMath
* - FastFloat
* - StandardFloat
*
* You can do this automatically with:
* \code
* CPPUNIT_REGISTRY_ADD( "FastFloat", "FloatMath" );
* CPPUNIT_REGISTRY_ADD( "IntegerMath", "Math" );
* CPPUNIT_REGISTRY_ADD( "FloatMath", "Math" );
* CPPUNIT_REGISTRY_ADD( "StandardFloat", "FloatMath" );
* \endcode
*
* There is no specific order of declaration. Think of it as declaring links.
*
* You register the test in each suite using CPPUNIT_TEST_SUITE_NAMED_REGISTRATION.
*
* \param which Name of the registry suite to add to the registry suite named \a to.
* \param to Name of the registry suite \a which is added to.
* \see CPPUNIT_REGISTRY_ADD_TO_DEFAULT, CPPUNIT_TEST_SUITE_NAMED_REGISTRATION.
*/
#define CPPUNIT_REGISTRY_ADD( which, to ) \
static CPPUNIT_NS::AutoRegisterRegistry \
CPPUNIT_MAKE_UNIQUE_NAME( autoRegisterRegistry__ )( which, to )
/*! Adds that the specified registry suite to the default registry suite.
* \ingroup CreatingTestSuite
*
* This macro is just like CPPUNIT_REGISTRY_ADD except the specified registry
* suite is added to the default suite (root suite).
*
* \param which Name of the registry suite to add to the default registry suite.
* \see CPPUNIT_REGISTRY_ADD.
*/
#define CPPUNIT_REGISTRY_ADD_TO_DEFAULT( which ) \
static CPPUNIT_NS::AutoRegisterRegistry \
CPPUNIT_MAKE_UNIQUE_NAME( autoRegisterRegistry__ )( which )
// Backwards compatibility
// (Not tested!)
#if CPPUNIT_ENABLE_CU_TEST_MACROS
#define CU_TEST_SUITE(tc) CPPUNIT_TEST_SUITE(tc)
#define CU_TEST_SUB_SUITE(tc,sc) CPPUNIT_TEST_SUB_SUITE(tc,sc)
#define CU_TEST(tm) CPPUNIT_TEST(tm)
#define CU_TEST_SUITE_END() CPPUNIT_TEST_SUITE_END()
#define CU_TEST_SUITE_REGISTRATION(tc) CPPUNIT_TEST_SUITE_REGISTRATION(tc)
#endif
#endif // CPPUNIT_EXTENSIONS_HELPERMACROS_H
+95
View File
@@ -0,0 +1,95 @@
#ifndef CPPUNIT_EXTENSIONS_ORTHODOX_H
#define CPPUNIT_EXTENSIONS_ORTHODOX_H
#include <cppunit/TestCase.h>
CPPUNIT_NS_BEGIN
/*
* Orthodox performs a simple set of tests on an arbitary
* class to make sure that it supports at least the
* following operations:
*
* default construction - constructor
* equality/inequality - operator== && operator!=
* assignment - operator=
* negation - operator!
* safe passage - copy construction
*
* If operations for each of these are not declared
* the template will not instantiate. If it does
* instantiate, tests are performed to make sure
* that the operations have correct semantics.
*
* Adding an orthodox test to a suite is very
* easy:
*
* public: Test *suite () {
* TestSuite *suiteOfTests = new TestSuite;
* suiteOfTests->addTest (new ComplexNumberTest ("testAdd");
* suiteOfTests->addTest (new TestCaller<Orthodox<Complex> > ());
* return suiteOfTests;
* }
*
* Templated test cases be very useful when you are want to
* make sure that a group of classes have the same form.
*
* see TestSuite
*/
template <class ClassUnderTest> class Orthodox : public TestCase
{
public:
Orthodox () : TestCase ("Orthodox") {}
protected:
ClassUnderTest call (ClassUnderTest object);
void runTest ();
};
// Run an orthodoxy test
template <class ClassUnderTest> void Orthodox<ClassUnderTest>::runTest ()
{
// make sure we have a default constructor
ClassUnderTest a, b, c;
// make sure we have an equality operator
CPPUNIT_ASSERT (a == b);
// check the inverse
b.operator= (a.operator! ());
CPPUNIT_ASSERT (a != b);
// double inversion
b = !!a;
CPPUNIT_ASSERT (a == b);
// invert again
b = !a;
// check calls
c = a;
CPPUNIT_ASSERT (c == call (a));
c = b;
CPPUNIT_ASSERT (c == call (b));
}
// Exercise a call
template <class ClassUnderTest>
ClassUnderTest Orthodox<ClassUnderTest>::call (ClassUnderTest object)
{
return object;
}
CPPUNIT_NS_END
#endif
+43
View File
@@ -0,0 +1,43 @@
#ifndef CPPUNIT_EXTENSIONS_REPEATEDTEST_H
#define CPPUNIT_EXTENSIONS_REPEATEDTEST_H
#include <cppunit/Portability.h>
#include <cppunit/extensions/TestDecorator.h>
CPPUNIT_NS_BEGIN
class Test;
class TestResult;
/*! \brief Decorator that runs a test repeatedly.
*
* Does not assume ownership of the test it decorates
*/
class CPPUNIT_API RepeatedTest : public TestDecorator
{
public:
RepeatedTest( Test *test,
int timesRepeat ) :
TestDecorator( test ),
m_timesRepeat(timesRepeat)
{
}
void run( TestResult *result );
int countTestCases() const;
private:
RepeatedTest( const RepeatedTest & );
void operator=( const RepeatedTest & );
const int m_timesRepeat;
};
CPPUNIT_NS_END
#endif // CPPUNIT_EXTENSIONS_REPEATEDTEST_H
+40
View File
@@ -0,0 +1,40 @@
#ifndef CPPUNIT_EXTENSIONS_TESTCASEDECORATOR_H
#define CPPUNIT_EXTENSIONS_TESTCASEDECORATOR_H
#include <cppunit/Portability.h>
#include <cppunit/TestCase.h>
CPPUNIT_NS_BEGIN
/*! \brief Decorator for Test cases.
*
* TestCaseDecorator provides an alternate means to extend functionality
* of a test class without subclassing the test. Instead, one can
* subclass the decorater and use it to wrap the test class.
*
* Does not assume ownership of the test it decorates
*/
class CPPUNIT_API TestCaseDecorator : public TestCase
{
public:
TestCaseDecorator( TestCase *test );
~TestCaseDecorator();
std::string getName() const;
void setUp();
void tearDown();
void runTest();
protected:
TestCase *m_test;
};
CPPUNIT_NS_END
#endif
+49
View File
@@ -0,0 +1,49 @@
#ifndef CPPUNIT_EXTENSIONS_TESTDECORATOR_H
#define CPPUNIT_EXTENSIONS_TESTDECORATOR_H
#include <cppunit/Portability.h>
#include <cppunit/Test.h>
CPPUNIT_NS_BEGIN
class TestResult;
/*! \brief Decorator for Tests.
*
* TestDecorator provides an alternate means to extend functionality
* of a test class without subclassing the test. Instead, one can
* subclass the decorater and use it to wrap the test class.
*
* Does not assume ownership of the test it decorates
*/
class CPPUNIT_API TestDecorator : public Test
{
public:
TestDecorator( Test *test );
~TestDecorator();
int countTestCases() const;
std::string getName() const;
void run( TestResult *result );
int getChildTestCount() const;
protected:
Test *doGetChildTestAt( int index ) const;
Test *m_test;
private:
TestDecorator( const TestDecorator &);
void operator =( const TestDecorator & );
};
CPPUNIT_NS_END
#endif
+27
View File
@@ -0,0 +1,27 @@
#ifndef CPPUNIT_EXTENSIONS_TESTFACTORY_H
#define CPPUNIT_EXTENSIONS_TESTFACTORY_H
#include <cppunit/Portability.h>
CPPUNIT_NS_BEGIN
class Test;
/*! \brief Abstract Test factory.
*/
class CPPUNIT_API TestFactory
{
public:
virtual ~TestFactory() {}
/*! Makes a new test.
* \return A new Test.
*/
virtual Test* makeTest() = 0;
};
CPPUNIT_NS_END
#endif // CPPUNIT_EXTENSIONS_TESTFACTORY_H
@@ -0,0 +1,182 @@
#ifndef CPPUNIT_EXTENSIONS_TESTFACTORYREGISTRY_H
#define CPPUNIT_EXTENSIONS_TESTFACTORYREGISTRY_H
#include <cppunit/Portability.h>
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( push )
#pragma warning( disable: 4251) // X needs to have dll-interface to be used by clients of class Z
#endif
#include <cppunit/portability/CppUnitSet.h>
#include <cppunit/extensions/TestFactory.h>
#include <string>
CPPUNIT_NS_BEGIN
class TestSuite;
#if CPPUNIT_NEED_DLL_DECL
// template class CPPUNIT_API std::set<TestFactory *>;
#endif
/*! \brief Registry for TestFactory.
* \ingroup CreatingTestSuite
*
* Notes that the registry \b DON'T assumes lifetime control for any registered tests
* anymore.
*
* The <em>default</em> registry is the registry returned by getRegistry() with the
* default name parameter value.
*
* To register tests, use the macros:
* - CPPUNIT_TEST_SUITE_REGISTRATION(): to add tests in the default registry.
* - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(): to add tests in a named registry.
*
* Example 1: retreiving a suite that contains all the test registered with
* CPPUNIT_TEST_SUITE_REGISTRATION().
* \code
* CppUnit::TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry();
* CppUnit::TestSuite *suite = registry.makeTest();
* \endcode
*
* Example 2: retreiving a suite that contains all the test registered with
* \link CPPUNIT_TEST_SUITE_NAMED_REGISTRATION() CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ..., "Math" )\endlink.
* \code
* CppUnit::TestFactoryRegistry &mathRegistry = CppUnit::TestFactoryRegistry::getRegistry( "Math" );
* CppUnit::TestSuite *mathSuite = mathRegistry.makeTest();
* \endcode
*
* Example 3: creating a test suite hierarchy composed of unnamed registration and
* named registration:
* - All Tests
* - tests registered with CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ..., "Graph" )
* - tests registered with CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ..., "Math" )
* - tests registered with CPPUNIT_TEST_SUITE_REGISTRATION
*
* \code
* CppUnit::TestSuite *rootSuite = new CppUnit::TestSuite( "All tests" );
* rootSuite->addTest( CppUnit::TestFactoryRegistry::getRegistry( "Graph" ).makeTest() );
* rootSuite->addTest( CppUnit::TestFactoryRegistry::getRegistry( "Math" ).makeTest() );
* CppUnit::TestFactoryRegistry::getRegistry().addTestToSuite( rootSuite );
* \endcode
*
* The same result can be obtained with:
* \code
* CppUnit::TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry();
* registry.addRegistry( "Graph" );
* registry.addRegistry( "Math" );
* CppUnit::TestSuite *suite = registry.makeTest();
* \endcode
*
* Since a TestFactoryRegistry is a TestFactory, the named registries can be
* registered in the unnamed registry, creating the hierarchy links.
*
* \see TestSuiteFactory, AutoRegisterSuite
* \see CPPUNIT_TEST_SUITE_REGISTRATION, CPPUNIT_TEST_SUITE_NAMED_REGISTRATION
*/
class CPPUNIT_API TestFactoryRegistry : public TestFactory
{
public:
/** Constructs the registry with the specified name.
* \param name Name of the registry. It is the name of TestSuite returned by
* makeTest().
*/
TestFactoryRegistry( std::string name );
/// Destructor.
virtual ~TestFactoryRegistry();
/** Returns a new TestSuite that contains the registered test.
* \return A new TestSuite which contains all the test added using
* registerFactory(TestFactory *).
*/
virtual Test *makeTest();
/** Returns a named registry.
*
* If the \a name is left to its default value, then the registry that is returned is
* the one used by CPPUNIT_TEST_SUITE_REGISTRATION(): the 'top' level registry.
*
* \param name Name of the registry to return.
* \return Registry. If the registry does not exist, it is created with the
* specified name.
*/
static TestFactoryRegistry &getRegistry( const std::string &name = "All Tests" );
/** Adds the registered tests to the specified suite.
* \param suite Suite the tests are added to.
*/
void addTestToSuite( TestSuite *suite );
/** Adds the specified TestFactory to the registry.
*
* \param factory Factory to register.
*/
void registerFactory( TestFactory *factory );
/*! Removes the specified TestFactory from the registry.
*
* The specified factory is not destroyed.
* \param factory Factory to remove from the registry.
* \todo Address case when trying to remove a TestRegistryFactory.
*/
void unregisterFactory( TestFactory *factory );
/*! Adds a registry to the registry.
*
* Convenience method to help create test hierarchy. See TestFactoryRegistry detail
* for examples of use. Calling this method is equivalent to:
* \code
* this->registerFactory( TestFactoryRegistry::getRegistry( name ) );
* \endcode
*
* \param name Name of the registry to add.
*/
void addRegistry( const std::string &name );
/*! Tests if the registry is valid.
*
* This method should be used when unregistering test factory on static variable
* destruction to ensure that the registry has not been already destroyed (in
* that case there is no need to unregister the test factory).
*
* You should not concern yourself with this method unless you are writing a class
* like AutoRegisterSuite.
*
* \return \c true if the specified registry has not been destroyed,
* otherwise returns \c false.
* \see AutoRegisterSuite.
*/
static bool isValid();
/** Adds the specified TestFactory with a specific name (DEPRECATED).
* \param name Name associated to the factory.
* \param factory Factory to register.
* \deprecated Use registerFactory( TestFactory *) instead.
*/
void registerFactory( const std::string &name,
TestFactory *factory );
private:
TestFactoryRegistry( const TestFactoryRegistry &copy );
void operator =( const TestFactoryRegistry &copy );
private:
typedef CppUnitSet<TestFactory *, std::less<TestFactory*> > Factories;
Factories m_factories;
std::string m_name;
};
CPPUNIT_NS_END
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( pop )
#endif
#endif // CPPUNIT_EXTENSIONS_TESTFACTORYREGISTRY_H
@@ -0,0 +1,50 @@
#ifndef CPPUNIT_EXTENSIONS_TESTFIXTUREFACTORY_H
#define CPPUNIT_EXTENSIONS_TESTFIXTUREFACTORY_H
#include <cppunit/Portability.h>
CPPUNIT_NS_BEGIN
class TestFixture;
/*! \brief Abstract TestFixture factory (Implementation).
*
* Implementation detail. Use by HelperMacros to handle TestFixture hierarchy.
*/
class TestFixtureFactory
{
public:
//! Creates a new TestFixture instance.
virtual TestFixture *makeFixture() =0;
virtual ~TestFixtureFactory() {}
};
/*! \brief Concret TestFixture factory (Implementation).
*
* Implementation detail. Use by HelperMacros to handle TestFixture hierarchy.
*/
template<class TestFixtureType>
class ConcretTestFixtureFactory : public CPPUNIT_NS::TestFixtureFactory
{
/*! \brief Returns a new TestFixture instance.
* \return A new fixture instance. The fixture instance is returned by
* the TestFixtureFactory passed on construction. The actual type
* is that of the fixture on which the static method suite()
* was called.
*/
TestFixture *makeFixture()
{
return new TestFixtureType();
}
};
CPPUNIT_NS_END
#endif // CPPUNIT_EXTENSIONS_TESTFIXTUREFACTORY_H
+89
View File
@@ -0,0 +1,89 @@
#ifndef CPPUNIT_EXTENSIONS_TESTNAMER_H
#define CPPUNIT_EXTENSIONS_TESTNAMER_H
#include <cppunit/Portability.h>
#include <string>
#if CPPUNIT_HAVE_RTTI
# include <typeinfo>
#endif
/*! \def CPPUNIT_TESTNAMER_DECL( variableName, FixtureType )
* \brief Declares a TestNamer.
*
* Declares a TestNamer for the specified type, using RTTI if enabled, otherwise
* using macro string expansion.
*
* RTTI is used if CPPUNIT_USE_TYPEINFO_NAME is defined and not null.
*
* \code
* void someMethod()
* {
* CPPUNIT_TESTNAMER_DECL( namer, AFixtureType );
* std::string fixtureName = namer.getFixtureName();
* ...
* \endcode
*
* \relates TestNamer
* \see TestNamer
*/
#if CPPUNIT_USE_TYPEINFO_NAME
# define CPPUNIT_TESTNAMER_DECL( variableName, FixtureType ) \
CPPUNIT_NS::TestNamer variableName( typeid(FixtureType) )
#else
# define CPPUNIT_TESTNAMER_DECL( variableName, FixtureType ) \
CPPUNIT_NS::TestNamer variableName( std::string(#FixtureType) )
#endif
CPPUNIT_NS_BEGIN
/*! \brief Names a test or a fixture suite.
*
* TestNamer is usually instantiated using CPPUNIT_TESTNAMER_DECL.
*
*/
class CPPUNIT_API TestNamer
{
public:
#if CPPUNIT_HAVE_RTTI
/*! \brief Constructs a namer using the fixture's type-info.
* \param typeInfo Type-info of the fixture type. Use to name the fixture suite.
*/
TestNamer( const std::type_info &typeInfo );
#endif
/*! \brief Constructs a namer using the specified fixture name.
* \param fixtureName Name of the fixture suite. Usually extracted using a macro.
*/
TestNamer( const std::string &fixtureName );
virtual ~TestNamer();
/*! \brief Returns the name of the fixture.
* \return Name of the fixture.
*/
virtual std::string getFixtureName() const;
/*! \brief Returns the name of the test for the specified method.
* \param testMethodName Name of the method that implements a test.
* \return A string that is the concatenation of the test fixture name
* (returned by getFixtureName()) and\a testMethodName,
* separated using '::'. This provides a fairly unique name for a given
* test.
*/
virtual std::string getTestNameFor( const std::string &testMethodName ) const;
protected:
std::string m_fixtureName;
};
CPPUNIT_NS_END
#endif // CPPUNIT_EXTENSIONS_TESTNAMER_H
+34
View File
@@ -0,0 +1,34 @@
#ifndef CPPUNIT_EXTENSIONS_TESTSETUP_H
#define CPPUNIT_EXTENSIONS_TESTSETUP_H
#include <cppunit/extensions/TestDecorator.h>
CPPUNIT_NS_BEGIN
class Test;
class TestResult;
/*! \brief Decorates a test by providing a specific setUp() and tearDown().
*/
class CPPUNIT_API TestSetUp : public TestDecorator
{
public:
TestSetUp( Test *test );
void run( TestResult *result );
protected:
virtual void setUp();
virtual void tearDown();
private:
TestSetUp( const TestSetUp & );
void operator =( const TestSetUp & );
};
CPPUNIT_NS_END
#endif // CPPUNIT_EXTENSIONS_TESTSETUP_H
@@ -0,0 +1,131 @@
#ifndef CPPUNIT_HELPER_TESTSUITEBUILDERCONTEXT_H
#define CPPUNIT_HELPER_TESTSUITEBUILDERCONTEXT_H
#include <cppunit/Portability.h>
#include <cppunit/portability/CppUnitMap.h>
#include <string>
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( push )
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
#endif
CPPUNIT_NS_BEGIN
class TestSuite;
class TestFixture;
class TestFixtureFactory;
class TestNamer;
/*! \brief Context used when creating test suite in HelperMacros.
*
* Base class for all context used when creating test suite. The
* actual context type during test suite creation is TestSuiteBuilderContext.
*
* \sa CPPUNIT_TEST_SUITE, CPPUNIT_TEST_SUITE_ADD_TEST,
* CPPUNIT_TEST_SUITE_ADD_CUSTOM_TESTS.
*/
class CPPUNIT_API TestSuiteBuilderContextBase
{
public:
/*! \brief Constructs a new context.
*
* You should not use this. The context is created in
* CPPUNIT_TEST_SUITE().
*/
TestSuiteBuilderContextBase( TestSuite &suite,
const TestNamer &namer,
TestFixtureFactory &factory );
virtual ~TestSuiteBuilderContextBase();
/*! \brief Adds a test to the fixture suite.
*
* \param test Test to add to the fixture suite. Must not be \c NULL.
*/
void addTest( Test *test );
/*! \brief Returns the fixture name.
* \return Fixture name. It is the name used to name the fixture
* suite.
*/
std::string getFixtureName() const;
/*! \brief Returns the name of the test for the specified method.
*
* \param testMethodName Name of the method that implements a test.
* \return A string that is the concatenation of the test fixture name
* (returned by getFixtureName()) and\a testMethodName,
* separated using '::'. This provides a fairly unique name for a given
* test.
*/
std::string getTestNameFor( const std::string &testMethodName ) const;
/*! \brief Adds property pair.
* \param key PropertyKey string to add.
* \param value PropertyValue string to add.
*/
void addProperty( const std::string &key,
const std::string &value );
/*! \brief Returns property value assigned to param key.
* \param key PropertyKey string.
*/
const std::string getStringProperty( const std::string &key ) const;
protected:
TestFixture *makeTestFixture() const;
// Notes: we use a vector here instead of a map to work-around the
// shared std::map in dll bug in VC6.
// See http://www.dinkumware.com/vc_fixes.html for detail.
typedef std::pair<std::string,std::string> Property;
typedef CppUnitVector<Property> Properties;
TestSuite &m_suite;
const TestNamer &m_namer;
TestFixtureFactory &m_factory;
private:
Properties m_properties;
};
/*! \brief Type-sage context used when creating test suite in HelperMacros.
*
* \sa TestSuiteBuilderContextBase.
*/
template<class Fixture>
class TestSuiteBuilderContext : public TestSuiteBuilderContextBase
{
public:
typedef Fixture FixtureType;
TestSuiteBuilderContext( TestSuiteBuilderContextBase &contextBase )
: TestSuiteBuilderContextBase( contextBase )
{
}
/*! \brief Returns a new TestFixture instance.
* \return A new fixture instance. The fixture instance is returned by
* the TestFixtureFactory passed on construction. The actual type
* is that of the fixture on which the static method suite()
* was called.
*/
FixtureType *makeFixture() const
{
return CPPUNIT_STATIC_CAST( FixtureType *,
TestSuiteBuilderContextBase::makeTestFixture() );
}
};
CPPUNIT_NS_END
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( pop )
#endif
#endif // CPPUNIT_HELPER_TESTSUITEBUILDERCONTEXT_H
+27
View File
@@ -0,0 +1,27 @@
#ifndef CPPUNIT_EXTENSIONS_TESTSUITEFACTORY_H
#define CPPUNIT_EXTENSIONS_TESTSUITEFACTORY_H
#include <cppunit/extensions/TestFactory.h>
CPPUNIT_NS_BEGIN
class Test;
/*! \brief TestFactory for TestFixture that implements a static suite() method.
* \see AutoRegisterSuite.
*/
template<class TestCaseType>
class TestSuiteFactory : public TestFactory
{
public:
virtual Test *makeTest()
{
return TestCaseType::suite();
}
};
CPPUNIT_NS_END
#endif // CPPUNIT_EXTENSIONS_TESTSUITEFACTORY_H
+33
View File
@@ -0,0 +1,33 @@
#ifndef CPPUNIT_TYPEINFOHELPER_H
#define CPPUNIT_TYPEINFOHELPER_H
#include <cppunit/Portability.h>
#if CPPUNIT_HAVE_RTTI
#include <typeinfo>
#include <string>
CPPUNIT_NS_BEGIN
/**! \brief Helper to use type_info.
*/
class CPPUNIT_API TypeInfoHelper
{
public:
/*! \brief Get the class name of the specified type_info.
* \param info Info which the class name is extracted from.
* \return The string returned by type_info::name() without
* the "class" prefix. If the name is not prefixed
* by "class", it is returned as this.
*/
static std::string getClassName( const std::type_info &info );
};
CPPUNIT_NS_END
#endif // CPPUNIT_HAVE_RTTI
#endif // CPPUNIT_TYPEINFOHELPER_H
+121
View File
@@ -0,0 +1,121 @@
#ifndef CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGER_H
#define CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGER_H
#include <cppunit/Portability.h>
#include <string>
#if !defined(CPPUNIT_NO_TESTPLUGIN)
CPPUNIT_NS_BEGIN
/*! \brief Manages dynamic libraries.
*
* The Dynamic Library Manager provides a platform independent way to work with
* dynamic library. It load a specific dynamic library, and can returns specific
* symbol exported by the dynamic library.
*
* If an error occurs, a DynamicLibraryManagerException is thrown.
*
* \internal Implementation of the OS independent methods is in
* DynamicLibraryManager.cpp.
*
* \internal Porting to a new platform:
* - Adds platform detection in config/SelectDllLoader.h. Should define a specific
* macro for that platform of the form: CPPUNIT_HAVE_XYZ_DLL_LOADER, where
* XYZ is the platform.
* - Makes a copy of UnixDynamicLibraryManager.cpp and named it after the platform.
* - Updated the 'guard' in your file (CPPUNIT_HAVE_XYZ_DLL_LOADER) so that it is
* only processed if the matching platform has been detected.
* - Change the implementation of methods doLoadLibrary(), doReleaseLibrary(),
* doFindSymbol() in your copy. Those methods usually maps directly to OS calls.
* - Adds the file to the project.
*/
class DynamicLibraryManager
{
public:
typedef void *Symbol;
typedef void *LibraryHandle;
/*! \brief Loads the specified library.
* \param libraryFileName Name of the library to load.
* \exception DynamicLibraryManagerException if a failure occurs while loading
* the library (fail to found or load the library).
*/
DynamicLibraryManager( const std::string &libraryFileName );
/// Releases the loaded library..
~DynamicLibraryManager();
/*! \brief Returns a pointer on the specified symbol exported by the library.
* \param symbol Name of the symbol exported by the library.
* \return Pointer on the symbol. Should be casted to the actual type. Never \c NULL.
* \exception DynamicLibraryManagerException if the symbol is not found.
*/
Symbol findSymbol( const std::string &symbol );
private:
/*! Loads the specified library.
* \param libraryName Name of the library to load.
* \exception DynamicLibraryManagerException if a failure occurs while loading
* the library (fail to found or load the library).
*/
void loadLibrary( const std::string &libraryName );
/*! Releases the loaded library.
*
* \warning Must NOT throw any exceptions (called from destructor).
*/
void releaseLibrary();
/*! Loads the specified library.
*
* May throw any exceptions (indicates failure).
* \param libraryName Name of the library to load.
* \return Handle of the loaded library. \c NULL indicates failure.
*/
LibraryHandle doLoadLibrary( const std::string &libraryName );
/*! Releases the loaded library.
*
* The handle of the library to free is in \c m_libraryHandle. It is never
* \c NULL.
* \warning Must NOT throw any exceptions (called from destructor).
*/
void doReleaseLibrary();
/*! Returns a pointer on the specified symbol exported by the library.
*
* May throw any exceptions (indicates failure).
* \param symbol Name of the symbol exported by the library.
* \return Pointer on the symbol. \c NULL indicates failure.
*/
Symbol doFindSymbol( const std::string &symbol );
/*! Returns detailed information about doLoadLibrary() failure.
*
* Called just after a failed call to doLoadLibrary() to get extra
* error information.
*
* \return Detailed information about the failure of the call to
* doLoadLibrary() that just failed.
*/
std::string getLastErrorDetail() const;
/// Prevents the use of the copy constructor.
DynamicLibraryManager( const DynamicLibraryManager &copy );
/// Prevents the use of the copy operator.
void operator =( const DynamicLibraryManager &copy );
private:
LibraryHandle m_libraryHandle;
std::string m_libraryName;
};
CPPUNIT_NS_END
#endif // !defined(CPPUNIT_NO_TESTPLUGIN)
#endif // CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGER_H
@@ -0,0 +1,53 @@
#ifndef CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGEREXCEPTION_H
#define CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGEREXCEPTION_H
#include <cppunit/Portability.h>
#if !defined(CPPUNIT_NO_TESTPLUGIN)
#include <stdexcept>
#include <string>
CPPUNIT_NS_BEGIN
/*! \brief Exception thrown by DynamicLibraryManager when a failure occurs.
*
* Use getCause() to know what function caused the failure.
*
*/
class DynamicLibraryManagerException : public std::runtime_error
{
public:
enum Cause
{
/// Failed to load the dynamic library
loadingFailed =0,
/// Symbol not found in the dynamic library
symbolNotFound
};
/// Failed to load the dynamic library or Symbol not found in the dynamic library.
DynamicLibraryManagerException( const std::string &libraryName,
const std::string &errorDetail,
Cause cause );
~DynamicLibraryManagerException() throw()
{
}
Cause getCause() const;
const char *what() const throw();
private:
std::string m_message;
Cause m_cause;
};
CPPUNIT_NS_END
#endif // !defined(CPPUNIT_NO_TESTPLUGIN)
#endif // CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGEREXCEPTION_H
+113
View File
@@ -0,0 +1,113 @@
#ifndef CPPUNIT_PLUGIN_PLUGINMANAGER_H
#define CPPUNIT_PLUGIN_PLUGINMANAGER_H
#include <cppunit/Portability.h>
#if !defined(CPPUNIT_NO_TESTPLUGIN)
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( push )
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
#endif
#include <cppunit/plugin/PlugInParameters.h>
struct CppUnitTestPlugIn;
CPPUNIT_NS_BEGIN
class DynamicLibraryManager;
class TestResult;
class XmlOutputter;
/*! \brief Manges TestPlugIn.
*/
class CPPUNIT_API PlugInManager
{
public:
/*! Constructs a PlugInManager object.
*/
PlugInManager();
/// Destructor.
virtual ~PlugInManager();
/*! \brief Loads the specified plug-in.
*
* After being loaded, the CppUnitTestPlugIn::initialize() is called.
*
* \param libraryFileName Name of the file that contains the TestPlugIn.
* \param parameters List of string passed to the plug-in.
* \return Pointer on the DynamicLibraryManager associated to the library.
* Valid until the library is unloaded. Never \c NULL.
* \exception DynamicLibraryManagerException is thrown if an error occurs during loading.
*/
void load( const std::string &libraryFileName,
const PlugInParameters &parameters = PlugInParameters() );
/*! \brief Unloads the specified plug-in.
* \param libraryFileName Name of the file that contains the TestPlugIn passed
* to a previous call to load().
*/
void unload( const std::string &libraryFileName );
/*! \brief Gives a chance to each loaded plug-in to register TestListener.
*
* For each plug-in, call CppUnitTestPlugIn::addListener().
*/
void addListener( TestResult *eventManager );
/*! \brief Gives a chance to each loaded plug-in to unregister TestListener.
* For each plug-in, call CppUnitTestPlugIn::removeListener().
*/
void removeListener( TestResult *eventManager );
/*! \brief Provides a way for the plug-in to register some XmlOutputterHook.
*/
void addXmlOutputterHooks( XmlOutputter *outputter );
/*! \brief Called when the XmlOutputter is destroyed.
*
* Can be used to free some resources allocated by addXmlOutputterHooks().
*/
void removeXmlOutputterHooks();
protected:
/*! \brief (INTERNAL) Information about a specific plug-in.
*/
struct PlugInInfo
{
std::string m_fileName;
DynamicLibraryManager *m_manager;
CppUnitTestPlugIn *m_interface;
};
/*! Unloads the specified plug-in.
* \param plugIn Information about the plug-in.
*/
void unload( PlugInInfo &plugIn );
private:
/// Prevents the use of the copy constructor.
PlugInManager( const PlugInManager &copy );
/// Prevents the use of the copy operator.
void operator =( const PlugInManager &copy );
private:
typedef CppUnitDeque<PlugInInfo> PlugIns;
PlugIns m_plugIns;
};
CPPUNIT_NS_END
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( pop )
#endif
#endif // !defined(CPPUNIT_NO_TESTPLUGIN)
#endif // CPPUNIT_PLUGIN_PLUGINMANAGER_H
+36
View File
@@ -0,0 +1,36 @@
#ifndef CPPUNIT_PLUGIN_PARAMETERS
#define CPPUNIT_PLUGIN_PARAMETERS
#include <cppunit/Portability.h>
#if !defined(CPPUNIT_NO_TESTPLUGIN)
#include <cppunit/portability/CppUnitDeque.h>
#include <string>
CPPUNIT_NS_BEGIN
/*! \brief Test plug-ins parameters.
*/
class CPPUNIT_API PlugInParameters
{
public:
/// Constructs plug-in parameters from the specified command-line.
PlugInParameters( const std::string &commandLine = "" );
virtual ~PlugInParameters();
/// Returns the command line that was passed on construction.
std::string getCommandLine() const;
private:
std::string m_commandLine;
};
CPPUNIT_NS_END
#endif // !defined(CPPUNIT_NO_TESTPLUGIN)
#endif // CPPUNIT_PLUGIN_PARAMETERS
+200
View File
@@ -0,0 +1,200 @@
#ifndef CPPUNIT_PLUGIN_TESTPLUGIN
#define CPPUNIT_PLUGIN_TESTPLUGIN
#include <cppunit/Portability.h>
#if !defined(CPPUNIT_NO_TESTPLUGIN)
#include <cppunit/plugin/PlugInParameters.h>
CPPUNIT_NS_BEGIN
class Test;
class TestFactoryRegistry;
class TestResult;
class XmlOutputter;
CPPUNIT_NS_END
/*! \file
*/
/*! \brief Test plug-in interface.
* \ingroup WritingTestPlugIn
*
* This class define the interface implemented by test plug-in. A pointer to that
* interface is returned by the function exported by the test plug-in.
*
* Plug-in are loaded/unloaded by PlugInManager. When a plug-in is loaded,
* initialize() is called. Before unloading the plug-in, the PlugInManager
* call uninitialize().
*
* addListener() and removeListener() are called respectively before and after
* the test run.
*
* addXmlOutputterHooks() and removeXmlOutputterHooks() are called respectively
* before and after writing the XML output using a XmlOutputter.
*
* \see CPPUNIT_PLUGIN_IMPLEMENT, CPPUNIT_PLUGIN_EXPORTED_FUNCTION_IMPL
* \see CppUnit::TestPlugInDefaultImpl, CppUnit::XmlOutputter.
*/
struct CppUnitTestPlugIn
{
/*! \brief Called just after loading the dynamic library.
*
* Override this method to add additional suite to the registry, though this
* is preferably done using the macros (CPPUNIT_TEST_SUITE_REGISTRATION...).
* If you are creating a custom listener to extends the plug-in runner,
* you can use this to configure the listener using the \a parameters.
*
* You could also use the parameters to specify some global parameter, such
* as test datas location, database name...
*
* N.B.: Parameters interface is not define yet, and the plug-in runner does
* not yet support plug-in parameter.
*/
virtual void initialize( CPPUNIT_NS::TestFactoryRegistry *registry,
const CPPUNIT_NS::PlugInParameters &parameters ) =0;
/*! \brief Gives a chance to the plug-in to register TestListener.
*
* Override this method to add a TestListener for the test run. This is useful
* if you are writing a custom TestListener, but also if you need to
* setUp some global resource: listen to TestListener::startTestRun(),
* and TestListener::endTestRun().
*/
virtual void addListener( CPPUNIT_NS::TestResult *eventManager ) =0;
/*! \brief Gives a chance to the plug-in to remove its registered TestListener.
*
* Override this method to remove a TestListener that has been added.
*/
virtual void removeListener( CPPUNIT_NS::TestResult *eventManager ) =0;
/*! \brief Provides a way for the plug-in to register some XmlOutputterHook.
*/
virtual void addXmlOutputterHooks( CPPUNIT_NS::XmlOutputter *outputter ) =0;
/*! \brief Called when the XmlOutputter is destroyed.
*
* Can be used to free some resources allocated by addXmlOutputterHooks().
*/
virtual void removeXmlOutputterHooks() = 0;
/*! \brief Called just before unloading the dynamic library.
*
* Override this method to unregister test factory added in initialize().
* This is necessary to keep the TestFactoryRegistry 'clean'. When
* the plug-in is unloaded from memory, the TestFactoryRegistry will hold
* reference on test that are no longer available if they are not
* unregistered.
*/
virtual void uninitialize( CPPUNIT_NS::TestFactoryRegistry *registry ) =0;
virtual ~CppUnitTestPlugIn() {}
};
/*! \brief Name of the function exported by a test plug-in.
* \ingroup WritingTestPlugIn
*
* The signature of the exported function is:
* \code
* CppUnitTestPlugIn *CPPUNIT_PLUGIN_EXPORTED_NAME(void);
* \endcode
*/
#define CPPUNIT_PLUGIN_EXPORTED_NAME cppunitTestPlugIn
/*! \brief Type of the function exported by a plug-in.
* \ingroup WritingTestPlugIn
*/
typedef CppUnitTestPlugIn *(*TestPlugInSignature)();
/*! \brief Implements the function exported by the test plug-in
* \ingroup WritingTestPlugIn
*/
#define CPPUNIT_PLUGIN_EXPORTED_FUNCTION_IMPL( TestPlugInInterfaceType ) \
CPPUNIT_PLUGIN_EXPORT CppUnitTestPlugIn *CPPUNIT_PLUGIN_EXPORTED_NAME(void) \
{ \
static TestPlugInInterfaceType plugIn; \
return &plugIn; \
} \
typedef char __CppUnitPlugInExportFunctionDummyTypeDef // dummy typedef so it can end with ';'
// Note: This include should remain after definition of CppUnitTestPlugIn
#include <cppunit/plugin/TestPlugInDefaultImpl.h>
/*! \def CPPUNIT_PLUGIN_IMPLEMENT_MAIN()
* \brief Implements the 'main' function for the plug-in.
*
* This macros implements the main() function for dynamic library.
* For example, WIN32 requires a DllMain function, while some Unix
* requires a main() function. This macros takes care of the implementation.
*/
// Win32
#if defined(CPPUNIT_HAVE_WIN32_DLL_LOADER)
#if !defined(APIENTRY)
#define WIN32_LEAN_AND_MEAN
#define NOGDI
#define NOUSER
#define NOKERNEL
#define NOSOUND
#define NOMINMAX
#define BLENDFUNCTION void // for mingw & gcc
#include <windows.h>
#endif
#define CPPUNIT_PLUGIN_IMPLEMENT_MAIN() \
BOOL APIENTRY DllMain( HANDLE hModule, \
DWORD ul_reason_for_call, \
LPVOID lpReserved ) \
{ \
return TRUE; \
} \
typedef char __CppUnitPlugInImplementMainDummyTypeDef
// Unix
#elif defined(CPPUNIT_HAVE_UNIX_DLL_LOADER) || defined(CPPUNIT_HAVE_UNIX_SHL_LOADER)
#define CPPUNIT_PLUGIN_IMPLEMENT_MAIN() \
int main( int argc, char *argv[] ) \
{ \
return 0; \
} \
typedef char __CppUnitPlugInImplementMainDummyTypeDef
// Other
#else // other platforms don't require anything specifics
#endif
/*! \brief Implements and exports the test plug-in interface.
* \ingroup WritingTestPlugIn
*
* This macro exports the test plug-in function using the subclass,
* and implements the 'main' function for the plug-in using
* CPPUNIT_PLUGIN_IMPLEMENT_MAIN().
*
* When using this macro, CppUnit must be linked as a DLL (shared library).
* Otherwise, tests registered to the TestFactoryRegistry in the DLL will
* not be visible to the DllPlugInTester.
*
* \see CppUnitTestPlugIn
* \see CPPUNIT_PLUGIN_EXPORTED_FUNCTION_IMPL(), CPPUNIT_PLUGIN_IMPLEMENT_MAIN().
*/
#define CPPUNIT_PLUGIN_IMPLEMENT() \
CPPUNIT_PLUGIN_EXPORTED_FUNCTION_IMPL( CPPUNIT_NS::TestPlugInDefaultImpl ); \
CPPUNIT_PLUGIN_IMPLEMENT_MAIN()
#endif // !defined(CPPUNIT_NO_TESTPLUGIN)
#endif // CPPUNIT_PLUGIN_TESTPLUGIN
+52
View File
@@ -0,0 +1,52 @@
#ifndef CPPUNIT_PLUGIN_TESTPLUGINADAPTER
#define CPPUNIT_PLUGIN_TESTPLUGINADAPTER
#include <cppunit/Portability.h>
#if !defined(CPPUNIT_NO_TESTPLUGIN)
#include <cppunit/plugin/TestPlugIn.h>
CPPUNIT_NS_BEGIN
class TestSuite;
/*! \brief Default implementation of test plug-in interface.
* \ingroup WritingTestPlugIn
*
* Override getSuiteName() to specify the suite name. Default is "All Tests".
*
* CppUnitTestPlugIn::getTestSuite() returns a suite that contains
* all the test registered to the default test factory registry
* ( TestFactoryRegistry::getRegistry() ).
*
*/
class CPPUNIT_API TestPlugInDefaultImpl : public CppUnitTestPlugIn
{
public:
TestPlugInDefaultImpl();
virtual ~TestPlugInDefaultImpl();
void initialize( TestFactoryRegistry *registry,
const PlugInParameters &parameters );
void addListener( TestResult *eventManager );
void removeListener( TestResult *eventManager );
void addXmlOutputterHooks( XmlOutputter *outputter );
void removeXmlOutputterHooks();
void uninitialize( TestFactoryRegistry *registry );
};
CPPUNIT_NS_END
#endif // !defined(CPPUNIT_NO_TESTPLUGIN)
#endif // CPPUNIT_PLUGIN_TESTPLUGINADAPTER
+25
View File
@@ -0,0 +1,25 @@
#ifndef CPPUNIT_PORTABILITY_CPPUNITDEQUE_H
#define CPPUNIT_PORTABILITY_CPPUNITDEQUE_H
// The technic used is similar to the wrapper of STLPort.
#include <cppunit/Portability.h>
#include <deque>
#if CPPUNIT_STD_NEED_ALLOCATOR
template<class T>
class CppUnitDeque : public std::deque<T,CPPUNIT_STD_ALLOCATOR>
{
public:
};
#else // CPPUNIT_STD_NEED_ALLOCATOR
#define CppUnitDeque std::deque
#endif
#endif // CPPUNIT_PORTABILITY_CPPUNITDEQUE_H
+29
View File
@@ -0,0 +1,29 @@
#ifndef CPPUNIT_PORTABILITY_CPPUNITMAP_H
#define CPPUNIT_PORTABILITY_CPPUNITMAP_H
// The technic used is similar to the wrapper of STLPort.
#include <cppunit/Portability.h>
#include <functional>
#include <map>
#if CPPUNIT_STD_NEED_ALLOCATOR
template<class Key, class T>
class CppUnitMap : public std::map<Key
,T
,std::less<Key>
,CPPUNIT_STD_ALLOCATOR>
{
public:
};
#else // CPPUNIT_STD_NEED_ALLOCATOR
#define CppUnitMap std::map
#endif
#endif // CPPUNIT_PORTABILITY_CPPUNITMAP_H
+28
View File
@@ -0,0 +1,28 @@
#ifndef CPPUNIT_PORTABILITY_CPPUNITSET_H
#define CPPUNIT_PORTABILITY_CPPUNITSET_H
// The technic used is similar to the wrapper of STLPort.
#include <cppunit/Portability.h>
#include <functional>
#include <set>
#if CPPUNIT_STD_NEED_ALLOCATOR
template<class T>
class CppUnitSet : public std::set<T
,std::less<T>
,CPPUNIT_STD_ALLOCATOR>
{
public:
};
#else // CPPUNIT_STD_NEED_ALLOCATOR
#define CppUnitSet std::set
#endif
#endif // CPPUNIT_PORTABILITY_CPPUNITSET_H
+26
View File
@@ -0,0 +1,26 @@
#ifndef CPPUNIT_PORTABILITY_CPPUNITSTACK_H
#define CPPUNIT_PORTABILITY_CPPUNITSTACK_H
// The technic used is similar to the wrapper of STLPort.
#include <cppunit/Portability.h>
#include <deque>
#include <stack>
#if CPPUNIT_STD_NEED_ALLOCATOR
template<class T>
class CppUnitStack : public std::stack<T
,std::deque<T,CPPUNIT_STD_ALLOCATOR> >
{
public:
};
#else // CPPUNIT_STD_NEED_ALLOCATOR
#define CppUnitStack std::stack
#endif
#endif // CPPUNIT_PORTABILITY_CPPUNITSTACK_H
+25
View File
@@ -0,0 +1,25 @@
#ifndef CPPUNIT_PORTABILITY_CPPUNITVECTOR_H
#define CPPUNIT_PORTABILITY_CPPUNITVECTOR_H
// The technic used is similar to the wrapper of STLPort.
#include <cppunit/Portability.h>
#include <vector>
#if CPPUNIT_STD_NEED_ALLOCATOR
template<class T>
class CppUnitVector : public std::vector<T,CPPUNIT_STD_ALLOCATOR>
{
public:
};
#else // CPPUNIT_STD_NEED_ALLOCATOR
#define CppUnitVector std::vector
#endif
#endif // CPPUNIT_PORTABILITY_CPPUNITVECTOR_H
+54
View File
@@ -0,0 +1,54 @@
#ifndef CPPUNIT_PORTABILITY_FLOATINGPOINT_H_INCLUDED
#define CPPUNIT_PORTABILITY_FLOATINGPOINT_H_INCLUDED
#include <cppunit/Portability.h>
#include <math.h>
CPPUNIT_NS_BEGIN
/// \brief Tests if a floating-point is a NaN.
// According to IEEE-754 floating point standard,
// (see e.g. page 8 of
// http://www.cs.berkeley.edu/~wkahan/ieee754status/ieee754.ps)
// all comparisons with NaN are false except "x != x", which is true.
//
// At least Microsoft Visual Studio 6 is known not to implement this test correctly.
// It emits the following code to test equality:
// fcomp qword ptr [nan]
// fnstsw ax // copie fp (floating-point) status register to ax
// test ah,40h // test bit 14 of ax (0x4000) => C3 of fp status register
// According to the following documentation on the x86 floating point status register,
// the C2 bit should be tested to test for NaN value.
// http://webster.cs.ucr.edu/AoA/Windows/HTML/RealArithmetic.html#1000117
// In Microsoft Visual Studio 2003 & 2005, the test is implemented with:
// test ah,44h // Visual Studio 2005 test both C2 & C3...
//
// To work around this, a NaN is assumed to be detected if no strict ordering is found.
inline bool floatingPointIsUnordered( double x )
{
// x != x will detect a NaN on conformant platform
// (2.0 < x && x < 1.0) will detect a NaN on non conformant platform:
// => no ordering can be found for x.
return (x != x) || (2.0 < x && x < 1.0);
}
/// \brief Tests if a floating-point is finite.
/// @return \c true if x is neither a NaN, nor +inf, nor -inf, \c false otherwise.
inline int floatingPointIsFinite( double x )
{
#if defined(CPPUNIT_HAVE_ISFINITE)
return isfinite( x );
#elif defined(CPPUNIT_HAVE_FINITE)
return finite( x );
#elif defined(CPPUNIT_HAVE__FINITE)
return _finite(x);
#else
double testInf = x * 0.0; // Produce 0.0 if x is finite, a NaN otherwise.
return testInf == 0.0 && !floatingPointIsUnordered(testInf);
#endif
}
CPPUNIT_NS_END
#endif // CPPUNIT_PORTABILITY_FLOATINGPOINT_H_INCLUDED
+347
View File
@@ -0,0 +1,347 @@
#ifndef CPPUNIT_PORTABILITY_STREAM_H_INCLUDED
#define CPPUNIT_PORTABILITY_STREAM_H_INCLUDED
// This module define:
// Type CppUT::Stream (either std::stream or a custom type)
// Type CppUT::OStringStream (eitjer std::ostringstream, older alternate or a custom type)
// Functions stdCOut() & stdCErr() which returns a reference on cout & cerr stream (or our
// custom stream).
#include <cppunit/Portability.h>
#if defined( CPPUNIT_NO_STREAM )
#include <string>
#include <stdio.h>
#include <string.h>
CPPUNIT_NS_BEGIN
class StreamBuffer
{
public:
virtual ~StreamBuffer() {}
virtual void write( const char *text, unsigned int length ) = 0;
virtual void flush() {}
};
class StringStreamBuffer : public StreamBuffer
{
public:
std::string str() const
{
return str_;
}
public: // overridden from StreamBuffer
void write( const char *text, unsigned int length )
{
str_.append( text, length );
}
private:
std::string str_;
};
class FileStreamBuffer : public StreamBuffer
{
public:
FileStreamBuffer( FILE *file )
: file_( file )
{
}
FILE *file() const
{
return file_;
}
public: // overridden from StreamBuffer
void write( const char *text, unsigned int length )
{
if ( file_ )
fwrite( text, sizeof(char), length, file_ );
}
void flush()
{
if ( file_ )
fflush( file_ );
}
private:
FILE *file_;
};
class OStream
{
public:
OStream()
: buffer_( 0 )
{
}
OStream( StreamBuffer *buffer )
: buffer_( buffer )
{
}
virtual ~OStream()
{
flush();
}
OStream &flush()
{
if ( buffer_ )
buffer_->flush();
return *this;
}
void setBuffer( StreamBuffer *buffer )
{
buffer_ = buffer;
}
OStream &write( const char *text, unsigned int length )
{
if ( buffer_ )
buffer_->write( text, length );
return *this;
}
OStream &write( const char *text )
{
return write( text, strlen(text) );
}
OStream &operator <<( bool v )
{
const char *out = v ? "true" : "false";
return write( out );
}
OStream &operator <<( short v )
{
char buffer[64];
sprintf( buffer, "%hd", v );
return write( buffer );
}
OStream &operator <<( unsigned short v )
{
char buffer[64];
sprintf( buffer, "%hu", v );
return write( buffer );
}
OStream &operator <<( int v )
{
char buffer[64];
sprintf( buffer, "%d", v );
return write( buffer );
}
OStream &operator <<( unsigned int v )
{
char buffer[64];
sprintf( buffer, "%u", v );
return write( buffer );
}
OStream &operator <<( long v )
{
char buffer[64];
sprintf( buffer, "%ld", v );
return write( buffer );
}
OStream &operator <<( unsigned long v )
{
char buffer[64];
sprintf( buffer, "%lu", v );
return write( buffer );
}
OStream &operator <<( float v )
{
char buffer[128];
sprintf( buffer, "%.16g", double(v) );
return write( buffer );
}
OStream &operator <<( double v )
{
char buffer[128];
sprintf( buffer, "%.16g", v );
return write( buffer );
}
OStream &operator <<( long double v )
{
char buffer[128];
sprintf( buffer, "%.16g", double(v) );
return write( buffer );
}
OStream &operator <<( const void *v )
{
char buffer[64];
sprintf( buffer, "%p", v );
return write( buffer );
}
OStream &operator <<( const char *v )
{
return write( v ? v : "NULL" );
}
OStream &operator <<( char c )
{
char buffer[16];
sprintf( buffer, "%c", c );
return write( buffer );
}
OStream &operator <<( const std::string &s )
{
return write( s.c_str(), s.length() );
}
private:
StreamBuffer *buffer_;
};
class OStringStream : public OStream
{
public:
OStringStream()
: OStream( &buffer_ )
{
}
std::string str() const
{
return buffer_.str();
}
private:
StringStreamBuffer buffer_;
};
class OFileStream : public OStream
{
public:
OFileStream( FILE *file )
: OStream( &buffer_ )
, buffer_( file )
, ownFile_( false )
{
}
OFileStream( const char *path )
: OStream( &buffer_ )
, buffer_( fopen( path, "wt" ) )
, ownFile_( true )
{
}
virtual ~OFileStream()
{
if ( ownFile_ && buffer_.file() )
fclose( buffer_.file() );
}
private:
FileStreamBuffer buffer_;
bool ownFile_;
};
inline OStream &stdCOut()
{
static OFileStream stream( stdout );
return stream;
}
inline OStream &stdCErr()
{
static OFileStream stream( stderr );
return stream;
}
CPPUNIT_NS_END
#elif CPPUNIT_HAVE_SSTREAM // #if defined( CPPUNIT_NO_STREAM )
# include <sstream>
# include <fstream>
CPPUNIT_NS_BEGIN
typedef std::ostringstream OStringStream; // The standard C++ way
typedef std::ofstream OFileStream;
CPPUNIT_NS_END
#elif CPPUNIT_HAVE_CLASS_STRSTREAM
# include <string>
# if CPPUNIT_HAVE_STRSTREAM
# include <strstream>
# else // CPPUNIT_HAVE_STRSTREAM
# include <strstream.h>
# endif // CPPUNIT_HAVE_CLASS_STRSTREAM
CPPUNIT_NS_BEGIN
class OStringStream : public std::ostrstream
{
public:
std::string str()
{
// (*this) << '\0';
// std::string msg(std::ostrstream::str());
// std::ostrstream::freeze(false);
// return msg;
// Alternative implementation that don't rely on freeze which is not
// available on some platforms:
return std::string( std::ostrstream::str(), pcount() );
}
};
CPPUNIT_NS_END
#else // CPPUNIT_HAVE_CLASS_STRSTREAM
# error Cannot define CppUnit::OStringStream.
#endif // #if defined( CPPUNIT_NO_STREAM )
#if !defined( CPPUNIT_NO_STREAM )
#include <iostream>
CPPUNIT_NS_BEGIN
typedef std::ostream OStream;
inline OStream &stdCOut()
{
return std::cout;
}
inline OStream &stdCErr()
{
return std::cerr;
}
CPPUNIT_NS_END
#endif // #if !defined( CPPUNIT_NO_STREAM )
#endif // CPPUNIT_PORTABILITY_STREAM_H_INCLUDED
+23
View File
@@ -0,0 +1,23 @@
#ifndef CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED
#define CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED
#include <cppunit/Portability.h>
CPPUNIT_NS_BEGIN
template<class SequenceType, class ValueType>
void
removeFromSequence( SequenceType &sequence,
const ValueType &valueToRemove )
{
for ( unsigned int index =0; index < sequence.size(); ++index )
{
if ( sequence[ index ] == valueToRemove )
sequence.erase( sequence.begin() + index );
}
}
CPPUNIT_NS_END
#endif // CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED
+34
View File
@@ -0,0 +1,34 @@
#ifndef CPPUNIT_TOOLS_STRINGTOOLS_H
#define CPPUNIT_TOOLS_STRINGTOOLS_H
#include <cppunit/Portability.h>
#include <string>
#include <cppunit/portability/CppUnitVector.h>
CPPUNIT_NS_BEGIN
/*! \brief Tool functions to manipulate string.
*/
struct StringTools
{
typedef CppUnitVector<std::string> Strings;
static std::string CPPUNIT_API toString( int value );
static std::string CPPUNIT_API toString( double value );
static Strings CPPUNIT_API split( const std::string &text,
char separator );
static std::string CPPUNIT_API wrap( const std::string &text,
int wrapColumn = CPPUNIT_WRAP_COLUMN );
};
CPPUNIT_NS_END
#endif // CPPUNIT_TOOLS_STRINGTOOLS_H
+86
View File
@@ -0,0 +1,86 @@
#ifndef CPPUNIT_TOOLS_XMLDOCUMENT_H
#define CPPUNIT_TOOLS_XMLDOCUMENT_H
#include <cppunit/Portability.h>
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( push )
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
#endif
#include <string>
CPPUNIT_NS_BEGIN
class XmlElement;
/*! \brief A XML Document.
*
* A XmlDocument represents a XML file. It holds a pointer on the root XmlElement
* of the document. It also holds the encoding and style sheet used.
*
* By default, the XML document is stand-alone and tagged with enconding "ISO-8859-1".
*/
class CPPUNIT_API XmlDocument
{
public:
/*! \brief Constructs a XmlDocument object.
* \param encoding Encoding used in the XML file (default is Latin-1, ISO-8859-1 ).
* \param styleSheet Name of the XSL style sheet file used. If empty then no
* style sheet will be specified in the output.
*/
XmlDocument( const std::string &encoding = "",
const std::string &styleSheet = "" );
/// Destructor.
virtual ~XmlDocument();
std::string encoding() const;
void setEncoding( const std::string &encoding = "" );
std::string styleSheet() const;
void setStyleSheet( const std::string &styleSheet = "" );
bool standalone() const;
/*! \brief set the output document as standalone or not.
*
* For the output document, specify wether it's a standalone XML
* document, or not.
*
* \param standalone if true, the output will be specified as standalone.
* if false, it will be not.
*/
void setStandalone( bool standalone );
void setRootElement( XmlElement *rootElement );
XmlElement &rootElement() const;
std::string toString() const;
private:
/// Prevents the use of the copy constructor.
XmlDocument( const XmlDocument &copy );
/// Prevents the use of the copy operator.
void operator =( const XmlDocument &copy );
protected:
std::string m_encoding;
std::string m_styleSheet;
XmlElement *m_rootElement;
bool m_standalone;
};
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( pop )
#endif
CPPUNIT_NS_END
#endif // CPPUNIT_TOOLS_XMLDOCUMENT_H
+149
View File
@@ -0,0 +1,149 @@
#ifndef CPPUNIT_TOOLS_XMLELEMENT_H
#define CPPUNIT_TOOLS_XMLELEMENT_H
#include <cppunit/Portability.h>
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( push )
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
#endif
#include <cppunit/portability/CppUnitDeque.h>
#include <string>
CPPUNIT_NS_BEGIN
class XmlElement;
#if CPPUNIT_NEED_DLL_DECL
// template class CPPUNIT_API std::deque<XmlElement *>;
#endif
/*! \brief A XML Element.
*
* A XML element has:
* - a name, specified on construction,
* - a content, specified on construction (may be empty),
* - zero or more attributes, added with addAttribute(),
* - zero or more child elements, added with addElement().
*/
class CPPUNIT_API XmlElement
{
public:
/*! \brief Constructs an element with the specified name and string content.
* \param elementName Name of the element. Must not be empty.
* \param content Content of the element.
*/
XmlElement( std::string elementName,
std::string content ="" );
/*! \brief Constructs an element with the specified name and numeric content.
* \param elementName Name of the element. Must not be empty.
* \param numericContent Content of the element.
*/
XmlElement( std::string elementName,
int numericContent );
/*! \brief Destructs the element and its child elements.
*/
virtual ~XmlElement();
/*! \brief Returns the name of the element.
* \return Name of the element.
*/
std::string name() const;
/*! \brief Returns the content of the element.
* \return Content of the element.
*/
std::string content() const;
/*! \brief Sets the name of the element.
* \param name New name for the element.
*/
void setName( const std::string &name );
/*! \brief Sets the content of the element.
* \param content New content for the element.
*/
void setContent( const std::string &content );
/*! \overload void setContent( const std::string &content )
*/
void setContent( int numericContent );
/*! \brief Adds an attribute with the specified string value.
* \param attributeName Name of the attribute. Must not be an empty.
* \param value Value of the attribute.
*/
void addAttribute( std::string attributeName,
std::string value );
/*! \brief Adds an attribute with the specified numeric value.
* \param attributeName Name of the attribute. Must not be empty.
* \param numericValue Numeric value of the attribute.
*/
void addAttribute( std::string attributeName,
int numericValue );
/*! \brief Adds a child element to the element.
* \param element Child element to add. Must not be \c NULL.
*/
void addElement( XmlElement *element );
/*! \brief Returns the number of child elements.
* \return Number of child elements (element added with addElement()).
*/
int elementCount() const;
/*! \brief Returns the child element at the specified index.
* \param index Zero based index of the element to return.
* \returns Element at the specified index. Never \c NULL.
* \exception std::invalid_argument if \a index < 0 or index >= elementCount().
*/
XmlElement *elementAt( int index ) const;
/*! \brief Returns the first child element with the specified name.
* \param name Name of the child element to return.
* \return First child element found which is named \a name.
* \exception std::invalid_argument if there is no child element with the specified
* name.
*/
XmlElement *elementFor( const std::string &name ) const;
/*! \brief Returns a XML string that represents the element.
* \param indent String of spaces representing the amount of 'indent'.
* \return XML string that represents the element, its attributes and its
* child elements.
*/
std::string toString( const std::string &indent = "" ) const;
private:
typedef std::pair<std::string,std::string> Attribute;
std::string attributesAsString() const;
std::string escape( std::string value ) const;
private:
std::string m_name;
std::string m_content;
typedef CppUnitDeque<Attribute> Attributes;
Attributes m_attributes;
typedef CppUnitDeque<XmlElement *> Elements;
Elements m_elements;
};
CPPUNIT_NS_END
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( pop )
#endif
#endif // CPPUNIT_TOOLS_XMLELEMENT_H
+76
View File
@@ -0,0 +1,76 @@
#ifndef CPPUNITUI_MFC_MFCTESTRUNNER_H
#define CPPUNITUI_MFC_MFCTESTRUNNER_H
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <cppunit/Portability.h>
#include <cppunit/portability/CppUnitVector.h>
/* Refer to MSDN documentation to know how to write and use MFC extension DLL:
mk:@MSITStore:h:\DevStudio\MSDN\98VSa\1036\vcmfc.chm::/html/_mfcnotes_tn033.htm#_mfcnotes_how_to_write_an_mfc_extension_dll
This can be found in the index with "mfc extension"
The basic:
Using:
- your application must use MFC DLL
- memory allocation is done using the same heap
- you must define the symbol _AFX_DLL
Building:
- you must define the symbol _AFX_DLL and _AFX_EXT
- export class using AFX_EXT_CLASS
*/
CPPUNIT_NS_BEGIN
class Test;
class TestSuite;
/*! \brief MFC test runner.
* \ingroup ExecutingTest
*
* Use this to launch the MFC TestRunner. Usually called from you CWinApp subclass:
*
* \code
* #include <cppunit/ui/mfc/MfcTestRunner.h>
* #include <cppunit/extensions/TestFactoryRegistry.h>
*
* void
* CHostAppApp::RunUnitTests()
* {
* CppUnit::MfcTestRunner runner;
* runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() );
*
* runner.run();
* }
* \endcode
* \see CppUnit::TextTestRunner, CppUnit::TestFactoryRegistry.
*/
class AFX_EXT_CLASS MfcTestRunner
{
public:
MfcTestRunner();
virtual ~MfcTestRunner();
void run();
void addTest( Test *test );
void addTests( const CppUnitVector<Test *> &tests );
protected:
Test *getRootTest();
TestSuite *m_suite;
typedef CppUnitVector<Test *> Tests;
Tests m_tests;
};
CPPUNIT_NS_END
#endif // CPPUNITUI_MFC_MFCTESTRUNNER_H
+21
View File
@@ -0,0 +1,21 @@
#ifndef CPPUNITUI_MFC_TESTRUNNER_H
#define CPPUNITUI_MFC_TESTRUNNER_H
#include <cppunit/ui/mfc/MfcTestRunner.h>
CPPUNIT_NS_BEGIN
#if defined(CPPUNIT_HAVE_NAMESPACES)
namespace MfcUi
{
/*! Mfc TestRunner (DEPRECATED).
* \deprecated Use CppUnit::MfcTestRunner instead.
*/
typedef CPPUNIT_NS::MfcTestRunner TestRunner;
}
#endif // defined(CPPUNIT_HAVE_NAMESPACES)
CPPUNIT_NS_END
#endif // CPPUNITUI_MFC_TESTRUNNER_H
+21
View File
@@ -0,0 +1,21 @@
#ifndef CPPUNIT_QTUI_CONFIG_H
#define CPPUNIT_QTUI_CONFIG_H
/*! Macro to export symbol to DLL with VC++.
*
* - QTTESTRUNNER_DLL_BUILD must be defined when building the DLL.
* - QTTESTRUNNER_DLL must be defined if linking against the DLL.
* - If none of the above are defined then you are building or linking against
* the static library.
*/
#if defined( QTTESTRUNNER_DLL_BUILD )
# define QTTESTRUNNER_API __declspec(dllexport)
#elif defined ( QTTESTRUNNER_DLL )
# define QTTESTRUNNER_API __declspec(dllimport)
#else
# define QTTESTRUNNER_API
#endif
#endif // CPPUNIT_QTUI_CONFIG_H
+85
View File
@@ -0,0 +1,85 @@
// //////////////////////////////////////////////////////////////////////////
// Header file TestRunner.h for class TestRunner
// (c)Copyright 2000, Baptiste Lepilleur.
// Created: 2001/09/19
// //////////////////////////////////////////////////////////////////////////
#ifndef CPPUNIT_QTUI_QTTESTRUNNER_H
#define CPPUNIT_QTUI_QTTESTRUNNER_H
#include <cppunit/portability/CppUnitVector.h>
#include "Config.h"
CPPUNIT_NS_BEGIN
class Test;
class TestSuite;
/*!
* \brief QT test runner.
* \ingroup ExecutingTest
*
* Here is an example of usage:
* \code
* #include <cppunit/extensions/TestFactoryRegistry.h>
* #include <cppunit/ui/qt/TestRunner.h>
*
* [...]
*
* void
* QDepWindow::runTests()
* {
* CppUnit::QtUi::TestRunner runner;
* runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() );
* runner.run( true );
* }
* \endcode
*
*/
class QTTESTRUNNER_API QtTestRunner
{
public:
/*! Constructs a TestRunner object.
*/
QtTestRunner();
/*! Destructor.
*/
virtual ~QtTestRunner();
void run( bool autoRun =false );
void addTest( Test *test );
private:
/// Prevents the use of the copy constructor.
QtTestRunner( const QtTestRunner &copy );
/// Prevents the use of the copy operator.
void operator =( const QtTestRunner &copy );
Test *getRootTest();
private:
typedef CppUnitVector<Test *> Tests;
Tests *_tests;
TestSuite *_suite;
};
#if CPPUNIT_HAVE_NAMESPACES
namespace QtUi
{
/*! Qt TestRunner (DEPRECATED).
* \deprecated Use CppUnit::QtTestRunner instead.
*/
typedef CPPUNIT_NS::QtTestRunner TestRunner;
}
#endif
CPPUNIT_NS_END
#endif // CPPUNIT_QTUI_QTTESTRUNNER_H
+11
View File
@@ -0,0 +1,11 @@
// //////////////////////////////////////////////////////////////////////////
// Header file TestRunner.h for class TestRunner
// (c)Copyright 2000, Baptiste Lepilleur.
// Created: 2001/09/19
// //////////////////////////////////////////////////////////////////////////
#ifndef CPPUNIT_QTUI_TESTRUNNER_H
#define CPPUNIT_QTUI_TESTRUNNER_H
#include <cppunit/ui/qt/QtTestRunner.h>
#endif // CPPUNIT_QTUI_TESTRUNNER_H
+24
View File
@@ -0,0 +1,24 @@
#ifndef CPPUNIT_UI_TEXT_TESTRUNNER_H
#define CPPUNIT_UI_TEXT_TESTRUNNER_H
#include <cppunit/ui/text/TextTestRunner.h>
#if defined(CPPUNIT_HAVE_NAMESPACES)
CPPUNIT_NS_BEGIN
namespace TextUi
{
/*! Text TestRunner (DEPRECATED).
* \deprecated Use TextTestRunner instead.
*/
typedef TextTestRunner TestRunner;
}
CPPUNIT_NS_END
#endif // defined(CPPUNIT_HAVE_NAMESPACES)
#endif // CPPUNIT_UI_TEXT_TESTRUNNER_H
+97
View File
@@ -0,0 +1,97 @@
#ifndef CPPUNIT_UI_TEXT_TEXTTESTRUNNER_H
#define CPPUNIT_UI_TEXT_TEXTTESTRUNNER_H
#include <cppunit/Portability.h>
#include <string>
#include <cppunit/TestRunner.h>
CPPUNIT_NS_BEGIN
class Outputter;
class Test;
class TestSuite;
class TextOutputter;
class TestResult;
class TestResultCollector;
/*!
* \brief A text mode test runner.
* \ingroup WritingTestResult
* \ingroup ExecutingTest
*
* The test runner manage the life cycle of the added tests.
*
* The test runner can run only one of the added tests or all the tests.
*
* TestRunner prints out a trace as the tests are executed followed by a
* summary at the end. The trace and summary print are optional.
*
* Here is an example of use:
*
* \code
* CppUnit::TextTestRunner runner;
* runner.addTest( ExampleTestCase::suite() );
* runner.run( "", true ); // Run all tests and wait
* \endcode
*
* The trace is printed using a TextTestProgressListener. The summary is printed
* using a TextOutputter.
*
* You can specify an alternate Outputter at construction
* or later with setOutputter().
*
* After construction, you can register additional TestListener to eventManager(),
* for a custom progress trace, for example.
*
* \code
* CppUnit::TextTestRunner runner;
* runner.addTest( ExampleTestCase::suite() );
* runner.setOutputter( CppUnit::CompilerOutputter::defaultOutputter(
* &runner.result(),
* std::cerr ) );
* MyCustomProgressTestListener progress;
* runner.eventManager().addListener( &progress );
* runner.run( "", true ); // Run all tests and wait
* \endcode
*
* \see CompilerOutputter, XmlOutputter, TextOutputter.
*/
class CPPUNIT_API TextTestRunner : public CPPUNIT_NS::TestRunner
{
public:
TextTestRunner( Outputter *outputter =NULL );
virtual ~TextTestRunner();
bool run( std::string testPath ="",
bool doWait = false,
bool doPrintResult = true,
bool doPrintProgress = true );
void setOutputter( Outputter *outputter );
TestResultCollector &result() const;
TestResult &eventManager() const;
public: // overridden from TestRunner (to avoid hidden virtual function warning)
virtual void run( TestResult &controller,
const std::string &testPath = "" );
protected:
virtual void wait( bool doWait );
virtual void printResult( bool doPrintResult );
TestResultCollector *m_result;
TestResult *m_eventManager;
Outputter *m_outputter;
};
CPPUNIT_NS_END
#endif // CPPUNIT_UI_TEXT_TEXTTESTRUNNER_H
+190
View File
@@ -0,0 +1,190 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 5.01.0164 */
/* at Sat Apr 13 11:47:16 2002
*/
/* Compiler settings for G:\prg\vc\Lib\cppunit\src\msvc6\DSPlugIn\TestRunnerDSPlugin.idl:
Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext
error checks: allocation ref bounds_check enum stub_data
*/
//@@MIDL_FILE_HEADING( )
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 440
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __TestRunnerDSPluginVC6_h__
#define __TestRunnerDSPluginVC6_h__
#ifdef __cplusplus
extern "C"{
#endif
/* Forward Declarations */
#ifndef __ITestRunnerDSPlugin_FWD_DEFINED__
#define __ITestRunnerDSPlugin_FWD_DEFINED__
typedef interface ITestRunnerDSPlugin ITestRunnerDSPlugin;
#endif /* __ITestRunnerDSPlugin_FWD_DEFINED__ */
#ifndef __DSAddIn_FWD_DEFINED__
#define __DSAddIn_FWD_DEFINED__
#ifdef __cplusplus
typedef class DSAddIn DSAddIn;
#else
typedef struct DSAddIn DSAddIn;
#endif /* __cplusplus */
#endif /* __DSAddIn_FWD_DEFINED__ */
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void __RPC_FAR * );
#ifndef __ITestRunnerDSPlugin_INTERFACE_DEFINED__
#define __ITestRunnerDSPlugin_INTERFACE_DEFINED__
/* interface ITestRunnerDSPlugin */
/* [oleautomation][unique][helpstring][uuid][object] */
EXTERN_C const IID IID_ITestRunnerDSPlugin;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("3ADE0E37-5A56-4a68-BD8D-67E9E7502971")
ITestRunnerDSPlugin : public IUnknown
{
public:
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE goToLineInSourceCode(
/* [in] */ BSTR fileName,
/* [in] */ int lineNumber) = 0;
};
#else /* C style interface */
typedef struct ITestRunnerDSPluginVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
ITestRunnerDSPlugin __RPC_FAR * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
ITestRunnerDSPlugin __RPC_FAR * This);
ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
ITestRunnerDSPlugin __RPC_FAR * This);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *goToLineInSourceCode )(
ITestRunnerDSPlugin __RPC_FAR * This,
/* [in] */ BSTR fileName,
/* [in] */ int lineNumber);
END_INTERFACE
} ITestRunnerDSPluginVtbl;
interface ITestRunnerDSPlugin
{
CONST_VTBL struct ITestRunnerDSPluginVtbl __RPC_FAR *lpVtbl;
};
#ifdef COBJMACROS
#define ITestRunnerDSPlugin_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define ITestRunnerDSPlugin_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define ITestRunnerDSPlugin_Release(This) \
(This)->lpVtbl -> Release(This)
#define ITestRunnerDSPlugin_goToLineInSourceCode(This,fileName,lineNumber) \
(This)->lpVtbl -> goToLineInSourceCode(This,fileName,lineNumber)
#endif /* COBJMACROS */
#endif /* C style interface */
/* [helpstring] */ HRESULT STDMETHODCALLTYPE ITestRunnerDSPlugin_goToLineInSourceCode_Proxy(
ITestRunnerDSPlugin __RPC_FAR * This,
/* [in] */ BSTR fileName,
/* [in] */ int lineNumber);
void __RPC_STUB ITestRunnerDSPlugin_goToLineInSourceCode_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __ITestRunnerDSPlugin_INTERFACE_DEFINED__ */
#ifndef __TestRunnerDSPluginLib_LIBRARY_DEFINED__
#define __TestRunnerDSPluginLib_LIBRARY_DEFINED__
/* library TestRunnerDSPluginLib */
/* [helpstring][version][uuid] */
EXTERN_C const IID LIBID_TestRunnerDSPluginLib;
EXTERN_C const CLSID CLSID_DSAddIn;
#ifdef __cplusplus
class DECLSPEC_UUID("F193CE54-716C-41CB-80B2-FA74CA3EE2AC")
DSAddIn;
#endif
#endif /* __TestRunnerDSPluginLib_LIBRARY_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
unsigned long __RPC_USER BSTR_UserSize( unsigned long __RPC_FAR *, unsigned long , BSTR __RPC_FAR * );
unsigned char __RPC_FAR * __RPC_USER BSTR_UserMarshal( unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, BSTR __RPC_FAR * );
unsigned char __RPC_FAR * __RPC_USER BSTR_UserUnmarshal(unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, BSTR __RPC_FAR * );
void __RPC_USER BSTR_UserFree( unsigned long __RPC_FAR *, BSTR __RPC_FAR * );
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,50 @@
/* this file contains the actual definitions of */
/* the IIDs and CLSIDs */
/* link this file in with the server and any clients */
/* File created by MIDL compiler version 5.01.0164 */
/* at Sat Apr 13 11:47:16 2002
*/
/* Compiler settings for G:\prg\vc\Lib\cppunit\src\msvc6\DSPlugIn\TestRunnerDSPlugin.idl:
Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext
error checks: allocation ref bounds_check enum stub_data
*/
//@@MIDL_FILE_HEADING( )
#ifdef __cplusplus
extern "C"{
#endif
#ifndef __IID_DEFINED__
#define __IID_DEFINED__
typedef struct _IID
{
unsigned long x;
unsigned short s1;
unsigned short s2;
unsigned char c[8];
} IID;
#endif // __IID_DEFINED__
#ifndef CLSID_DEFINED
#define CLSID_DEFINED
typedef IID CLSID;
#endif // CLSID_DEFINED
const IID IID_ITestRunnerDSPlugin = {0x3ADE0E37,0x5A56,0x4a68,{0xBD,0x8D,0x67,0xE9,0xE7,0x50,0x29,0x71}};
const IID LIBID_TestRunnerDSPluginLib = {0x3ADE0E38,0x5A56,0x4a68,{0xBD,0x8D,0x67,0xE9,0xE7,0x50,0x29,0x71}};
const CLSID CLSID_DSAddIn = {0xF193CE54,0x716C,0x41CB,{0x80,0xB2,0xFA,0x74,0xCA,0x3E,0xE2,0xAC}};
#ifdef __cplusplus
}
#endif
View File
+55
View File
@@ -0,0 +1,55 @@
#ifndef CPPUNIT_TESTPLUGINRUNNER_TESTPLUGININTERFACE_H
#define CPPUNIT_TESTPLUGINRUNNER_TESTPLUGININTERFACE_H
#include <cppunit/Test.h>
#include <cppunit/TestSuite.h>
#if !defined(WINAPI)
#define WIN32_LEAN_AND_MEAN
#define NOGDI
#define NOUSER
#define NOKERNEL
#define NOSOUND
#define NOMINMAX
#include <windows.h>
#endif
/*! \brief Abstract TestPlugIn for DLL.
* \deprecated Use CppUnitTestPlugIn instead.
*
* A Test plug-in DLL must subclass this class and "publish" an instance
* using the following exported function:
* \code
* extern "C" {
* __declspec(dllimport) TestPlugInInterface *GetTestPlugInInterface();
* }
* \endcode
*
* When loading the DLL, the TestPlugIn runner look-up this function and
* retreives the
*
* See the TestPlugIn example for VC++ for details.
*/
class TestPlugInInterface
{
public:
virtual ~TestPlugInInterface() {}
/*! Returns an instance of the "All Tests" suite.
*
* \return Instance of the top-level suite that contains all test. Ownership
* is granted to the method caller.
*/
virtual CppUnit::Test *makeTest() =0;
};
typedef TestPlugInInterface* (WINAPI *GetTestPlugInInterfaceFunction)(void);
extern "C" {
__declspec(dllexport) TestPlugInInterface *GetTestPlugInInterface();
}
#endif // CPPUNIT_TESTPLUGINRUNNER_TESTPLUGININTERFACE_H
+17
View File
@@ -0,0 +1,17 @@
#ifndef CPPUNIT_MSVC_TESTRUNNER_H
#define CPPUNIT_MSVC_TESTRUNNER_H
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <cppunit/ui/mfc/MfcTestRunner.h>
/*! \brief MFC test runner (DEPRECATED)
* \ingroup ExecutingTest
* \deprecated Use CppUnit::MfcUi::TestRunner instead.
*/
typedef CPPUNIT_NS::MfcTestRunner TestRunner;
#endif // CPPUNIT_MSVC_TESTRUNNER_H
+5759
View File
File diff suppressed because it is too large Load Diff
+380
View File
@@ -0,0 +1,380 @@
/*
** 2006 June 7
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
*************************************************************************
** This header file defines the SQLite interface for use by
** shared libraries that want to be imported as extensions into
** an SQLite instance. Shared libraries that intend to be loaded
** as extensions by SQLite should #include this file instead of
** sqlite3.h.
**
** @(#) $Id: sqlite3ext.h,v 1.25 2008/10/12 00:27:54 shane Exp $
*/
#ifndef _SQLITE3EXT_H_
#define _SQLITE3EXT_H_
#include "sqlite3.h"
typedef struct sqlite3_api_routines sqlite3_api_routines;
/*
** The following structure holds pointers to all of the SQLite API
** routines.
**
** WARNING: In order to maintain backwards compatibility, add new
** interfaces to the end of this structure only. If you insert new
** interfaces in the middle of this structure, then older different
** versions of SQLite will not be able to load each others' shared
** libraries!
*/
struct sqlite3_api_routines {
void * (*aggregate_context)(sqlite3_context*,int nBytes);
int (*aggregate_count)(sqlite3_context*);
int (*bind_blob)(sqlite3_stmt*,int,const void*,int n,void(*)(void*));
int (*bind_double)(sqlite3_stmt*,int,double);
int (*bind_int)(sqlite3_stmt*,int,int);
int (*bind_int64)(sqlite3_stmt*,int,sqlite_int64);
int (*bind_null)(sqlite3_stmt*,int);
int (*bind_parameter_count)(sqlite3_stmt*);
int (*bind_parameter_index)(sqlite3_stmt*,const char*zName);
const char * (*bind_parameter_name)(sqlite3_stmt*,int);
int (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*));
int (*bind_text16)(sqlite3_stmt*,int,const void*,int,void(*)(void*));
int (*bind_value)(sqlite3_stmt*,int,const sqlite3_value*);
int (*busy_handler)(sqlite3*,int(*)(void*,int),void*);
int (*busy_timeout)(sqlite3*,int ms);
int (*changes)(sqlite3*);
int (*close)(sqlite3*);
int (*collation_needed)(sqlite3*,void*,void(*)(void*,sqlite3*,int eTextRep,const char*));
int (*collation_needed16)(sqlite3*,void*,void(*)(void*,sqlite3*,int eTextRep,const void*));
const void * (*column_blob)(sqlite3_stmt*,int iCol);
int (*column_bytes)(sqlite3_stmt*,int iCol);
int (*column_bytes16)(sqlite3_stmt*,int iCol);
int (*column_count)(sqlite3_stmt*pStmt);
const char * (*column_database_name)(sqlite3_stmt*,int);
const void * (*column_database_name16)(sqlite3_stmt*,int);
const char * (*column_decltype)(sqlite3_stmt*,int i);
const void * (*column_decltype16)(sqlite3_stmt*,int);
double (*column_double)(sqlite3_stmt*,int iCol);
int (*column_int)(sqlite3_stmt*,int iCol);
sqlite_int64 (*column_int64)(sqlite3_stmt*,int iCol);
const char * (*column_name)(sqlite3_stmt*,int);
const void * (*column_name16)(sqlite3_stmt*,int);
const char * (*column_origin_name)(sqlite3_stmt*,int);
const void * (*column_origin_name16)(sqlite3_stmt*,int);
const char * (*column_table_name)(sqlite3_stmt*,int);
const void * (*column_table_name16)(sqlite3_stmt*,int);
const unsigned char * (*column_text)(sqlite3_stmt*,int iCol);
const void * (*column_text16)(sqlite3_stmt*,int iCol);
int (*column_type)(sqlite3_stmt*,int iCol);
sqlite3_value* (*column_value)(sqlite3_stmt*,int iCol);
void * (*commit_hook)(sqlite3*,int(*)(void*),void*);
int (*complete)(const char*sql);
int (*complete16)(const void*sql);
int (*create_collation)(sqlite3*,const char*,int,void*,int(*)(void*,int,const void*,int,const void*));
int (*create_collation16)(sqlite3*,const void*,int,void*,int(*)(void*,int,const void*,int,const void*));
int (*create_function)(sqlite3*,const char*,int,int,void*,void (*xFunc)(sqlite3_context*,int,sqlite3_value**),void (*xStep)(sqlite3_context*,int,sqlite3_value**),void (*xFinal)(sqlite3_context*));
int (*create_function16)(sqlite3*,const void*,int,int,void*,void (*xFunc)(sqlite3_context*,int,sqlite3_value**),void (*xStep)(sqlite3_context*,int,sqlite3_value**),void (*xFinal)(sqlite3_context*));
int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*);
int (*data_count)(sqlite3_stmt*pStmt);
sqlite3 * (*db_handle)(sqlite3_stmt*);
int (*declare_vtab)(sqlite3*,const char*);
int (*enable_shared_cache)(int);
int (*errcode)(sqlite3*db);
const char * (*errmsg)(sqlite3*);
const void * (*errmsg16)(sqlite3*);
int (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**);
int (*expired)(sqlite3_stmt*);
int (*finalize)(sqlite3_stmt*pStmt);
void (*free)(void*);
void (*free_table)(char**result);
int (*get_autocommit)(sqlite3*);
void * (*get_auxdata)(sqlite3_context*,int);
int (*get_table)(sqlite3*,const char*,char***,int*,int*,char**);
int (*global_recover)(void);
void (*interruptx)(sqlite3*);
sqlite_int64 (*last_insert_rowid)(sqlite3*);
const char * (*libversion)(void);
int (*libversion_number)(void);
void *(*malloc)(int);
char * (*mprintf)(const char*,...);
int (*open)(const char*,sqlite3**);
int (*open16)(const void*,sqlite3**);
int (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
int (*prepare16)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*);
void (*progress_handler)(sqlite3*,int,int(*)(void*),void*);
void *(*realloc)(void*,int);
int (*reset)(sqlite3_stmt*pStmt);
void (*result_blob)(sqlite3_context*,const void*,int,void(*)(void*));
void (*result_double)(sqlite3_context*,double);
void (*result_error)(sqlite3_context*,const char*,int);
void (*result_error16)(sqlite3_context*,const void*,int);
void (*result_int)(sqlite3_context*,int);
void (*result_int64)(sqlite3_context*,sqlite_int64);
void (*result_null)(sqlite3_context*);
void (*result_text)(sqlite3_context*,const char*,int,void(*)(void*));
void (*result_text16)(sqlite3_context*,const void*,int,void(*)(void*));
void (*result_text16be)(sqlite3_context*,const void*,int,void(*)(void*));
void (*result_text16le)(sqlite3_context*,const void*,int,void(*)(void*));
void (*result_value)(sqlite3_context*,sqlite3_value*);
void * (*rollback_hook)(sqlite3*,void(*)(void*),void*);
int (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*,const char*,const char*),void*);
void (*set_auxdata)(sqlite3_context*,int,void*,void (*)(void*));
char * (*snprintf)(int,char*,const char*,...);
int (*step)(sqlite3_stmt*);
int (*table_column_metadata)(sqlite3*,const char*,const char*,const char*,char const**,char const**,int*,int*,int*);
void (*thread_cleanup)(void);
int (*total_changes)(sqlite3*);
void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*);
int (*transfer_bindings)(sqlite3_stmt*,sqlite3_stmt*);
void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*,sqlite_int64),void*);
void * (*user_data)(sqlite3_context*);
const void * (*value_blob)(sqlite3_value*);
int (*value_bytes)(sqlite3_value*);
int (*value_bytes16)(sqlite3_value*);
double (*value_double)(sqlite3_value*);
int (*value_int)(sqlite3_value*);
sqlite_int64 (*value_int64)(sqlite3_value*);
int (*value_numeric_type)(sqlite3_value*);
const unsigned char * (*value_text)(sqlite3_value*);
const void * (*value_text16)(sqlite3_value*);
const void * (*value_text16be)(sqlite3_value*);
const void * (*value_text16le)(sqlite3_value*);
int (*value_type)(sqlite3_value*);
char *(*vmprintf)(const char*,va_list);
/* Added ??? */
int (*overload_function)(sqlite3*, const char *zFuncName, int nArg);
/* Added by 3.3.13 */
int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
int (*clear_bindings)(sqlite3_stmt*);
/* Added by 3.4.1 */
int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*,void (*xDestroy)(void *));
/* Added by 3.5.0 */
int (*bind_zeroblob)(sqlite3_stmt*,int,int);
int (*blob_bytes)(sqlite3_blob*);
int (*blob_close)(sqlite3_blob*);
int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64,int,sqlite3_blob**);
int (*blob_read)(sqlite3_blob*,void*,int,int);
int (*blob_write)(sqlite3_blob*,const void*,int,int);
int (*create_collation_v2)(sqlite3*,const char*,int,void*,int(*)(void*,int,const void*,int,const void*),void(*)(void*));
int (*file_control)(sqlite3*,const char*,int,void*);
sqlite3_int64 (*memory_highwater)(int);
sqlite3_int64 (*memory_used)(void);
sqlite3_mutex *(*mutex_alloc)(int);
void (*mutex_enter)(sqlite3_mutex*);
void (*mutex_free)(sqlite3_mutex*);
void (*mutex_leave)(sqlite3_mutex*);
int (*mutex_try)(sqlite3_mutex*);
int (*open_v2)(const char*,sqlite3**,int,const char*);
int (*release_memory)(int);
void (*result_error_nomem)(sqlite3_context*);
void (*result_error_toobig)(sqlite3_context*);
int (*sleep)(int);
void (*soft_heap_limit)(int);
sqlite3_vfs *(*vfs_find)(const char*);
int (*vfs_register)(sqlite3_vfs*,int);
int (*vfs_unregister)(sqlite3_vfs*);
int (*xthreadsafe)(void);
void (*result_zeroblob)(sqlite3_context*,int);
void (*result_error_code)(sqlite3_context*,int);
int (*test_control)(int, ...);
void (*randomness)(int,void*);
sqlite3 *(*context_db_handle)(sqlite3_context*);
int (*extended_result_codes)(sqlite3*,int);
int (*limit)(sqlite3*,int,int);
sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*);
const char *(*sql)(sqlite3_stmt*);
int (*status)(int,int*,int*,int);
};
/*
** The following macros redefine the API routines so that they are
** redirected throught the global sqlite3_api structure.
**
** This header file is also used by the loadext.c source file
** (part of the main SQLite library - not an extension) so that
** it can get access to the sqlite3_api_routines structure
** definition. But the main library does not want to redefine
** the API. So the redefinition macros are only valid if the
** SQLITE_CORE macros is undefined.
*/
#ifndef SQLITE_CORE
#define sqlite3_aggregate_context sqlite3_api->aggregate_context
#ifndef SQLITE_OMIT_DEPRECATED
#define sqlite3_aggregate_count sqlite3_api->aggregate_count
#endif
#define sqlite3_bind_blob sqlite3_api->bind_blob
#define sqlite3_bind_double sqlite3_api->bind_double
#define sqlite3_bind_int sqlite3_api->bind_int
#define sqlite3_bind_int64 sqlite3_api->bind_int64
#define sqlite3_bind_null sqlite3_api->bind_null
#define sqlite3_bind_parameter_count sqlite3_api->bind_parameter_count
#define sqlite3_bind_parameter_index sqlite3_api->bind_parameter_index
#define sqlite3_bind_parameter_name sqlite3_api->bind_parameter_name
#define sqlite3_bind_text sqlite3_api->bind_text
#define sqlite3_bind_text16 sqlite3_api->bind_text16
#define sqlite3_bind_value sqlite3_api->bind_value
#define sqlite3_busy_handler sqlite3_api->busy_handler
#define sqlite3_busy_timeout sqlite3_api->busy_timeout
#define sqlite3_changes sqlite3_api->changes
#define sqlite3_close sqlite3_api->close
#define sqlite3_collation_needed sqlite3_api->collation_needed
#define sqlite3_collation_needed16 sqlite3_api->collation_needed16
#define sqlite3_column_blob sqlite3_api->column_blob
#define sqlite3_column_bytes sqlite3_api->column_bytes
#define sqlite3_column_bytes16 sqlite3_api->column_bytes16
#define sqlite3_column_count sqlite3_api->column_count
#define sqlite3_column_database_name sqlite3_api->column_database_name
#define sqlite3_column_database_name16 sqlite3_api->column_database_name16
#define sqlite3_column_decltype sqlite3_api->column_decltype
#define sqlite3_column_decltype16 sqlite3_api->column_decltype16
#define sqlite3_column_double sqlite3_api->column_double
#define sqlite3_column_int sqlite3_api->column_int
#define sqlite3_column_int64 sqlite3_api->column_int64
#define sqlite3_column_name sqlite3_api->column_name
#define sqlite3_column_name16 sqlite3_api->column_name16
#define sqlite3_column_origin_name sqlite3_api->column_origin_name
#define sqlite3_column_origin_name16 sqlite3_api->column_origin_name16
#define sqlite3_column_table_name sqlite3_api->column_table_name
#define sqlite3_column_table_name16 sqlite3_api->column_table_name16
#define sqlite3_column_text sqlite3_api->column_text
#define sqlite3_column_text16 sqlite3_api->column_text16
#define sqlite3_column_type sqlite3_api->column_type
#define sqlite3_column_value sqlite3_api->column_value
#define sqlite3_commit_hook sqlite3_api->commit_hook
#define sqlite3_complete sqlite3_api->complete
#define sqlite3_complete16 sqlite3_api->complete16
#define sqlite3_create_collation sqlite3_api->create_collation
#define sqlite3_create_collation16 sqlite3_api->create_collation16
#define sqlite3_create_function sqlite3_api->create_function
#define sqlite3_create_function16 sqlite3_api->create_function16
#define sqlite3_create_module sqlite3_api->create_module
#define sqlite3_create_module_v2 sqlite3_api->create_module_v2
#define sqlite3_data_count sqlite3_api->data_count
#define sqlite3_db_handle sqlite3_api->db_handle
#define sqlite3_declare_vtab sqlite3_api->declare_vtab
#define sqlite3_enable_shared_cache sqlite3_api->enable_shared_cache
#define sqlite3_errcode sqlite3_api->errcode
#define sqlite3_errmsg sqlite3_api->errmsg
#define sqlite3_errmsg16 sqlite3_api->errmsg16
#define sqlite3_exec sqlite3_api->exec
#ifndef SQLITE_OMIT_DEPRECATED
#define sqlite3_expired sqlite3_api->expired
#endif
#define sqlite3_finalize sqlite3_api->finalize
#define sqlite3_free sqlite3_api->free
#define sqlite3_free_table sqlite3_api->free_table
#define sqlite3_get_autocommit sqlite3_api->get_autocommit
#define sqlite3_get_auxdata sqlite3_api->get_auxdata
#define sqlite3_get_table sqlite3_api->get_table
#ifndef SQLITE_OMIT_DEPRECATED
#define sqlite3_global_recover sqlite3_api->global_recover
#endif
#define sqlite3_interrupt sqlite3_api->interruptx
#define sqlite3_last_insert_rowid sqlite3_api->last_insert_rowid
#define sqlite3_libversion sqlite3_api->libversion
#define sqlite3_libversion_number sqlite3_api->libversion_number
#define sqlite3_malloc sqlite3_api->malloc
#define sqlite3_mprintf sqlite3_api->mprintf
#define sqlite3_open sqlite3_api->open
#define sqlite3_open16 sqlite3_api->open16
#define sqlite3_prepare sqlite3_api->prepare
#define sqlite3_prepare16 sqlite3_api->prepare16
#define sqlite3_prepare_v2 sqlite3_api->prepare_v2
#define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2
#define sqlite3_profile sqlite3_api->profile
#define sqlite3_progress_handler sqlite3_api->progress_handler
#define sqlite3_realloc sqlite3_api->realloc
#define sqlite3_reset sqlite3_api->reset
#define sqlite3_result_blob sqlite3_api->result_blob
#define sqlite3_result_double sqlite3_api->result_double
#define sqlite3_result_error sqlite3_api->result_error
#define sqlite3_result_error16 sqlite3_api->result_error16
#define sqlite3_result_int sqlite3_api->result_int
#define sqlite3_result_int64 sqlite3_api->result_int64
#define sqlite3_result_null sqlite3_api->result_null
#define sqlite3_result_text sqlite3_api->result_text
#define sqlite3_result_text16 sqlite3_api->result_text16
#define sqlite3_result_text16be sqlite3_api->result_text16be
#define sqlite3_result_text16le sqlite3_api->result_text16le
#define sqlite3_result_value sqlite3_api->result_value
#define sqlite3_rollback_hook sqlite3_api->rollback_hook
#define sqlite3_set_authorizer sqlite3_api->set_authorizer
#define sqlite3_set_auxdata sqlite3_api->set_auxdata
#define sqlite3_snprintf sqlite3_api->snprintf
#define sqlite3_step sqlite3_api->step
#define sqlite3_table_column_metadata sqlite3_api->table_column_metadata
#define sqlite3_thread_cleanup sqlite3_api->thread_cleanup
#define sqlite3_total_changes sqlite3_api->total_changes
#define sqlite3_trace sqlite3_api->trace
#ifndef SQLITE_OMIT_DEPRECATED
#define sqlite3_transfer_bindings sqlite3_api->transfer_bindings
#endif
#define sqlite3_update_hook sqlite3_api->update_hook
#define sqlite3_user_data sqlite3_api->user_data
#define sqlite3_value_blob sqlite3_api->value_blob
#define sqlite3_value_bytes sqlite3_api->value_bytes
#define sqlite3_value_bytes16 sqlite3_api->value_bytes16
#define sqlite3_value_double sqlite3_api->value_double
#define sqlite3_value_int sqlite3_api->value_int
#define sqlite3_value_int64 sqlite3_api->value_int64
#define sqlite3_value_numeric_type sqlite3_api->value_numeric_type
#define sqlite3_value_text sqlite3_api->value_text
#define sqlite3_value_text16 sqlite3_api->value_text16
#define sqlite3_value_text16be sqlite3_api->value_text16be
#define sqlite3_value_text16le sqlite3_api->value_text16le
#define sqlite3_value_type sqlite3_api->value_type
#define sqlite3_vmprintf sqlite3_api->vmprintf
#define sqlite3_overload_function sqlite3_api->overload_function
#define sqlite3_prepare_v2 sqlite3_api->prepare_v2
#define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2
#define sqlite3_clear_bindings sqlite3_api->clear_bindings
#define sqlite3_bind_zeroblob sqlite3_api->bind_zeroblob
#define sqlite3_blob_bytes sqlite3_api->blob_bytes
#define sqlite3_blob_close sqlite3_api->blob_close
#define sqlite3_blob_open sqlite3_api->blob_open
#define sqlite3_blob_read sqlite3_api->blob_read
#define sqlite3_blob_write sqlite3_api->blob_write
#define sqlite3_create_collation_v2 sqlite3_api->create_collation_v2
#define sqlite3_file_control sqlite3_api->file_control
#define sqlite3_memory_highwater sqlite3_api->memory_highwater
#define sqlite3_memory_used sqlite3_api->memory_used
#define sqlite3_mutex_alloc sqlite3_api->mutex_alloc
#define sqlite3_mutex_enter sqlite3_api->mutex_enter
#define sqlite3_mutex_free sqlite3_api->mutex_free
#define sqlite3_mutex_leave sqlite3_api->mutex_leave
#define sqlite3_mutex_try sqlite3_api->mutex_try
#define sqlite3_open_v2 sqlite3_api->open_v2
#define sqlite3_release_memory sqlite3_api->release_memory
#define sqlite3_result_error_nomem sqlite3_api->result_error_nomem
#define sqlite3_result_error_toobig sqlite3_api->result_error_toobig
#define sqlite3_sleep sqlite3_api->sleep
#define sqlite3_soft_heap_limit sqlite3_api->soft_heap_limit
#define sqlite3_vfs_find sqlite3_api->vfs_find
#define sqlite3_vfs_register sqlite3_api->vfs_register
#define sqlite3_vfs_unregister sqlite3_api->vfs_unregister
#define sqlite3_threadsafe sqlite3_api->xthreadsafe
#define sqlite3_result_zeroblob sqlite3_api->result_zeroblob
#define sqlite3_result_error_code sqlite3_api->result_error_code
#define sqlite3_test_control sqlite3_api->test_control
#define sqlite3_randomness sqlite3_api->randomness
#define sqlite3_context_db_handle sqlite3_api->context_db_handle
#define sqlite3_extended_result_codes sqlite3_api->extended_result_codes
#define sqlite3_limit sqlite3_api->limit
#define sqlite3_next_stmt sqlite3_api->next_stmt
#define sqlite3_sql sqlite3_api->sql
#define sqlite3_status sqlite3_api->status
#endif /* SQLITE_CORE */
#define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api = 0;
#define SQLITE_EXTENSION_INIT2(v) sqlite3_api = v;
#endif /* _SQLITE3EXT_H_ */
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+271
View File
@@ -0,0 +1,271 @@
# Top-Level CmakeLists.txt
IF(APPLE OR WIN32)
# BundleUtilities.cmake from 2.8.3 required on Mac and ?Windows?
cmake_minimum_required(VERSION 2.8.3)
ELSE()
cmake_minimum_required(VERSION 2.8.0)
ENDIF()
PROJECT( RTAB-Map )
SET(PROJECT_PREFIX rtabmap)
####### local cmake modules #######
SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
#######################
# VERSION
#######################
SET(PROJECT_VERSION "0.2.7")
STRING(REGEX MATCHALL "[0-9]" PROJECT_VERSION_PARTS "${PROJECT_VERSION}")
LIST(GET PROJECT_VERSION_PARTS 0 PROJECT_VERSION_MAJOR)
LIST(GET PROJECT_VERSION_PARTS 1 PROJECT_VERSION_MINOR)
LIST(GET PROJECT_VERSION_PARTS 2 PROJECT_VERSION_PATCH)
SET(PROJECT_SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
CONFIGURE_FILE(Version.h.in ${PROJECT_SOURCE_DIR}/corelib/include/${PROJECT_PREFIX}/core/Version.h)
####### COMPILATION PARAMS #######
# In case of Makefiles if the user does not setup CMAKE_BUILD_TYPE, assume it's Release:
IF(${CMAKE_GENERATOR} MATCHES ".*Makefiles")
IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE Release)
ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
ENDIF(${CMAKE_GENERATOR} MATCHES ".*Makefiles")
SET(CMAKE_DEBUG_POSTFIX "d")
ADD_DEFINITIONS( "-Wall" )
IF(WIN32 AND NOT MINGW)
ADD_DEFINITIONS("-wd4100 -wd4512 -wd4548 -wd4619 -wd4625 -wd4626 -wd4668 -wd4710 -wd4820")
ELSE ()
ADD_DEFINITIONS("-Wno-unknown-pragmas")
ENDIF()
IF(MINGW)
# Hide the --enable-auto-import warning
SET(CMAKE_EXE_LINKER_FLAGS "-enable-auto-import")
SET(CMAKE_MODULE_LINKER_FLAGS "-enable-auto-import")
SET(CMAKE_SHARED_LINKER_FLAGS "-enable-auto-import")
ENDIF(MINGW)
# GCC 4 required
IF(UNIX OR MINGW)
EXEC_PROGRAM( gcc ARGS "-dumpversion" OUTPUT_VARIABLE GCC_VERSION )
IF(GCC_VERSION VERSION_LESS "4.0.0")
MESSAGE(FATAL_ERROR "GCC ${GCC_VERSION} found, but version 4.x.x minimum is required")
ENDIF(GCC_VERSION VERSION_LESS "4.0.0")
ENDIF(UNIX OR MINGW)
#The CDT Error Parser cannot handle error messages that span
#more than one line, which is the default gcc behavior.
#In order to force gcc to generate single line error messages with no line wrapping
IF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
# [Eclipse] Automatic Discovery of Include directories (Optional, but handy)
#SET(CMAKE_VERBOSE_MAKEFILE ON)
#Find libraries included with our project first
IF(WIN32)
SET(CMAKE_INCLUDE_PATH "${PROJECT_SOURCE_DIR}/3rdParty/include;${CMAKE_INCLUDE_PATH}")
SET(CMAKE_LIBRARY_PATH "${PROJECT_SOURCE_DIR}/3rdParty/lib;${CMAKE_LIBRARY_PATH}")
ENDIF(WIN32)
####### Build libraries as shared or static #######
OPTION(BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON)
####### SET RPATH #########
# When RPATH is activated (supported on most UNIX systems),
# the user doesn't need to change LD_LIBRARY_PATH
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# the RPATH to be used when installing
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
####### OUTPUT DIR #######
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
####### DEPENDENCIES #######
FIND_PACKAGE(UtiLite REQUIRED)
FIND_PACKAGE(OpenCV REQUIRED)
FIND_PACKAGE(Sqlite3 REQUIRED)
# If Qt is here, the GUI will be built
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtSvg)
# If CppUnit is here, the test will be built
FIND_PACKAGE(CppUnit)
####### OSX BUNDLE CMAKE_INSTALL_PREFIX #######
OPTION(BUILD_AS_BUNDLE "Set to ON to build as bundle (DragNDrop)" OFF)
IF(APPLE AND BUILD_AS_BUNDLE)
IF(QT4_FOUND AND QT_QTCORE_FOUND AND QT_QTGUI_FOUND)
#Force to Off, easiest to package into the bundle
SET( BUILD_SHARED_LIBS OFF )
# Required when packaging, and set CMAKE_INSTALL_PREFIX to "/".
SET(CPACK_SET_DESTDIR TRUE)
SET(CMAKE_BUNDLE_NAME
"${PROJECT_NAME} ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
SET(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
# make sure CMAKE_INSTALL_PREFIX ends in /
STRING(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN)
MATH(EXPR LEN "${LEN} -1" )
STRING(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
IF(NOT "${ENDCH}" STREQUAL "/")
SET(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
ENDIF(NOT "${ENDCH}" STREQUAL "/")
SET(CMAKE_INSTALL_PREFIX
"${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents")
ELSE()
#If Qt is not here, no need to build a bundle
SET(BUILD_AS_BUNDLE OFF)
ENDIF()
ENDIF(APPLE AND BUILD_AS_BUNDLE)
####### SOURCES (Projects) #######
ADD_SUBDIRECTORY( corelib )
INCLUDE_DIRECTORIES(corelib/include/)
IF(QT4_FOUND AND QT_QTCORE_FOUND AND QT_QTGUI_FOUND)
ADD_SUBDIRECTORY( guilib )
INCLUDE_DIRECTORIES(guilib/include/)
ADD_SUBDIRECTORY( ${PROJECT_PREFIX} )
ELSE()
MESSAGE(STATUS "[WARNING] Qt4 not found, the GUI lib and the stand-alone application will not be compiled...")
ENDIF()
#######################
# Uninstall target, for "make uninstall"
#######################
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
#######################
# CPACK (Packaging)
#######################
INCLUDE(InstallRequiredSystemLibraries)
SET(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
SET(CPACK_PACKAGE_VENDOR "${PROJECT_NAME} project")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CTAB-MAP is a Real-Time Appearance-Based Mapping approach.")
#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/Description.txt")
#SET(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.txt")
SET(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
#SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
#SET(CPACK_PACKAGE_EXECUTABLES "")
#SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_PACKAGE_CONTACT "matlabbe@gmail.com")
set(CPACK_SOURCE_IGNORE_FILES
"\\\\.svn/"
"${PROJECT_SOURCE_DIR}/build/[a-zA-Z0-9_]+"
"~$"
"${PROJECT_SOURCE_DIR}/bin/.*${PROJECT_PREFIX}"
"${PROJECT_SOURCE_DIR}/bin/.*${PROJECT_NAME}"
"${PROJECT_SOURCE_DIR}/bin/.*[tT]est"
"${PROJECT_SOURCE_DIR}/bin/.*[eE]xample"
"\\\\.DS_Store"
)
# Share files
INSTALL(FILES
${PROJECT_SOURCE_DIR}/Matlab/ShowLogs/ShowLogs.m
${PROJECT_SOURCE_DIR}/Matlab/ShowLogs/importfile.m
DESTINATION share/${PROJECT_PREFIX}
COMPONENT runtime)
IF(WIN32)
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.txt")
SET(CPACK_GENERATOR "NSIS")
SET(CPACK_SOURCE_GENERATOR "ZIP")
SET(CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME} ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
SET(ICON_PATH "${PROJECT_SOURCE_DIR}/${PROJECT_PREFIX}/src/${PROJECT_NAME}.ico")
SET(CPACK_NSIS_MUI_ICON ${ICON_PATH})
SET(CPACK_NSIS_MUI_UNIICON ${ICON_PATH})
#SET(CPACK_PACKAGE_ICON ${ICON_PATH})
#SET(CPACK_NSIS_INSTALLED_ICON_NAME ${ICON_PATH})
#SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.${PROJECT_PREFIX}.googlecode.com")
#SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.${PROJECT_PREFIX}.googlecode.com")
SET(CPACK_NSIS_DISPLAY_NAME "${PROJECT_NAME}")
SET(CPACK_NSIS_CONTACT ${CPACK_PACKAGE_CONTACT})
# Set the icon used for the Windows "Add or Remove Programs" tool.
SET(CPACK_NSIS_INSTALLED_ICON_NAME bin\\\\${PROJECT_NAME}.exe)
# Desktop link ("executableName" "linkName")
SET(CPACK_PACKAGE_EXECUTABLES "${PROJECT_NAME}" "${PROJECT_NAME}" ${CPACK_PACKAGE_EXECUTABLES})
SET(CPACK_CREATE_DESKTOP_LINKS "${PROJECT_NAME}" ${CPACK_CREATE_DESKTOP_LINKS})
SET(CPACK_NSIS_MODIFY_PATH ON)
ELSEIF(APPLE)
# The project is created as a bundle over the main app (see ./${PROJECT_PREFIX}/src).
# Here we package only this bundle. Note that we set
# CMAKE_INSTALL_PREFIX to "/" when packaging...
IF(BUILD_AS_BUNDLE)
SET(CPACK_GENERATOR "DragNDrop")
ELSE()
SET(CPACK_GENERATOR "PackageMaker;TBZ2")
ENDIF()
SET(CPACK_SOURCE_GENERATOR "TBZ2")
SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/${PROJECT_PREFIX}/src/${PROJECT_NAME}.icns")
ELSE()
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.txt")
SET(CPACK_GENERATOR "DEB;TBZ2")
SET(CPACK_SOURCE_GENERATOR "TBZ2")
# Extern : UtiLite (>= 0.2) http://code.google.com/p/utilite/, OpenCV (>= 2.2) http://opencv.willowgarage.com/wiki/
# ex. SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libgcc1 (>= 1:3.4.2-12)")
# have a look at GET_PROPERTY(result GLOBAL ENABLED_FEATURES), this returns the successful FIND_PACKAGE() calls, maybe this can help
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.4), libstdc++6 (>= 4.4), libgcc1 (>= 4.0), libsqlite3-0 (>= 3.6)") # Most have
SET(CPACK_DEBIAN_PACKAGE_RECOMMENDS "libqt4-dev (>= 4.6)") #Qt
SET(CPACK_DEBIAN_PACKAGE_SUGGESTS "")
SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
ENDIF()
INCLUDE(CPack)
MESSAGE(STATUS "--------------------------------------------")
MESSAGE(STATUS "Info :")
MESSAGE(STATUS " CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")
MESSAGE(STATUS " CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
MESSAGE(STATUS " BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}")
IF(APPLE)
MESSAGE(STATUS " BUILD_AS_BUNDLE = ${BUILD_AS_BUNDLE}")
ENDIF(APPLE)
MESSAGE(STATUS "--------------------------------------------")
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+86
View File
@@ -0,0 +1,86 @@
SignatureID WordsID...
-1 4 5 21 22 24 31 32 33 35 46 48 49 58 60 63 72 73 78 83 84 103 105 114 120 124 133 136 141 162 179 182 188 189 202 204 211 217 218 227 232 241 247 249 260 268 271 287 289 301 304 318 320 324 338 340 345 346 349 358 366 368 370 371 381 395 407 408 414 415 416 424 439 442 447 502 504 508 509 527 539 540 550 553 558 568 572 583 588 598 606 617 624 625 638 652 653 667 674 693 694 699 702 738 755 770 782 784 793 816 818 819 832 836 842 846 847 858 867 868 923 939 954 955 965 987 1027 1030 1034 1083 1087 1097 1098 1177 1187 1199 1200 1214 1241 1258 1259 1270 1303 1339 1351 1388 1451 1501 1515 1526 1630 1679 1680 1771 1841 1868 2014 2243 2400 2494 2591 2957 3075 3079 3194
1 1 2 2 3 4 4 4 5 6 7 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 24 24 25 26 27 28 29 30 31 31 32 33 34 34 35 35 36 37 38 39 40 41 42 43 44 44 45 46 47 48 49 49 50 51 52 53 53 54 55 56 57 58 59 59 60 60 60 61 62 63 64 65 66 67 68 69 70 70 71 72 73 74 75 76 77 78 79 80 81 82 83 83 83 84 85 86 86 87 88 89 90 91 92 93 94 95 96 97 98 99 99 100 101 102 103 104
2 4 4 4 4 4 4 5 7 7 7 12 14 18 19 21 22 26 28 29 29 31 32 33 35 37 48 49 49 51 51 53 54 55 56 56 57 58 58 59 60 60 60 63 65 66 67 70 73 75 77 77 77 78 78 82 84 84 84 84 92 94 94 96 96 99 103 105 105 106 107 108 109 110 111 112 113 114 115 116 116 117 118 118 119 120 120 121 122 123 124 125 126 127 128 129 130 131 132 133 133 133 134 135 136 137 138 139 140 141 141 142 143 144 145 146 147 148 149 150 151 151 152 152 153 154 155 156 156 157 158 159 160 161 161 162 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 189 189 190 191 192 193 194 195 196 197 198 199 200 201 202 202 203 204 204 205
3 4 4 5 12 12 19 21 22 23 28 28 29 32 32 33 33 44 46 48 48 49 52 53 55 56 58 59 60 60 65 65 67 71 72 72 73 78 84 96 96 97 103 105 105 123 124 124 133 136 136 136 139 139 141 141 141 142 143 144 148 162 167 167 182 188 189 189 202 206 207 208 209 210 210 211 212 213 214 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 247 248 249 249 250 251 252 253 254 255 255 256 257 258 259 260 261 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 287 288 289 290 291 292 293 294 295 296 296 297 298 298 299 300 301 302 303 303 304 305 306 306 307 307 308 309 310 311
4 4 5 18 21 21 22 24 24 32 33 35 42 44 46 46 46 46 49 65 67 68 68 70 70 72 72 72 83 84 95 96 96 103 120 130 135 136 136 136 136 139 142 143 143 153 156 162 177 179 179 182 189 189 189 189 189 189 202 202 204 217 217 218 218 227 227 228 228 230 230 232 246 247 249 249 255 268 271 271 275 276 276 284 287 290 312 313 314 315 316 317 318 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 338 339 340 341 342 343 344 345 346 347 348 349 349 350 351 352 352 353 354 354 355 356 357 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 408 409 410 411 412 413
5 4 5 24 25 31 32 33 42 45 45 48 48 67 70 84 105 114 120 120 120 130 133 179 189 202 202 217 217 217 217 217 217 217 217 232 268 270 271 318 324 338 345 346 349 349 354 355 356 362 366 366 407 414 414 415 416 417 418 418 419 420 421 422 423 423 424 424 425 425 426 427 428 429 429 430 431 432 433 433 434 435 436 436 437 438 439 439 440 441 442 443 444 445 446 447 448 449 450 451 451 452 453 454 455 456 457 458 459 460
6 4 4 4 4 21 22 24 24 25 31 31 31 31 31 31 32 33 45 48 64 64 72 72 72 84 95 105 114 114 114 120 122 130 136 156 189 189 189 189 189 189 202 202 208 213 217 217 217 227 232 243 271 280 287 312 320 320 320 324 324 340 345 345 358 366 366 366 366 407 414 416 416 416 416 421 423 424 426 436 439 439 439 439 439 439 442 447 457 457 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 497 498 498 499 499 500 501 501 502 502 503 504 504 505 505 506 507 508 509 510 511 512 513 514 515 516 517 518 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 536 537 537 538 539 540 541 542 543 544 545 546 547 548 549 550 550 551 552 553 554 555 556 557 558 559
7 30 31 31 31 31 32 32 32 33 33 39 46 48 53 58 58 58 78 78 182 188 218 228 236 249 304 318 318 318 318 346 358 366 368 368 408 410 414 429 431 447 447 453 453 473 499 508 527 539 550 550 553 560 561 562 563 564 565 565 566 567 568 569 570 571 572 572 573 574 575 576 577 578 578 579 580 581 582 582 583 584 585 586 587 588 588 589 590 590 591 592 593 594 595 596 597 598 599 600 601 602 603 603 604 605 606 607 607 608 609 610 611 612 613 614 614 615 616 617 617 618 619 620 621 621 622 623 624 625 625 626 627 628 629 630 631 632 632 633 634 635 636 637 638 638 639 640 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 654 655 656 657 658 658 659 660 661 661 662 663 664 665 666 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683
8 24 31 31 32 33 33 33 58 78 84 217 217 237 312 312 338 338 338 340 366 366 366 442 453 453 508 519 519 527 539 565 565 566 567 568 568 568 573 575 578 581 583 588 588 590 592 597 597 598 599 603 606 611 612 613 624 626 634 638 638 647 649 652 652 652 660 663 664 684 685 686 687 688 689 690 691 692 693 694 695 696 697 697 698 699 699 700 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 729 730 731 732 733 734 735 736 737
9 4 4 4 30 31 31 33 64 72 78 84 84 84 207 217 217 217 217 217 217 217 217 217 217 217 217 237 253 257 260 271 271 271 304 318 346 366 417 442 480 503 508 519 539 550 553 553 566 578 581 583 588 590 590 594 606 607 610 612 617 621 625 634 634 638 638 638 652 653 654 657 660 664 664 688 690 691 696 697 702 702 706 706 706 708 708 711 715 723 730 732 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 793 794 795 796 797 798 799 800 801 802 803 804 804 805 806 806 807 808 809 810 811
10 4 4 4 4 4 5 21 31 31 31 32 32 32 32 53 58 58 72 72 72 72 84 178 178 189 189 202 202 207 207 217 217 217 217 218 249 249 289 320 320 368 370 384 395 407 499 502 502 504 508 522 522 523 527 536 539 548 550 550 553 553 558 558 558 563 574 583 583 588 590 602 602 608 608 624 626 638 644 646 654 664 684 693 704 706 710 711 715 750 754 755 770 770 770 774 780 780 782 782 801 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 887 888 889 890 891 891 892 893 893 894 895 896 897 898 898 899 900 901 902 903 904
11 4 4 4 32 58 58 58 63 78 114 114 120 120 189 189 189 207 217 223 223 236 243 249 249 318 338 345 345 345 346 349 431 442 502 502 504 504 509 522 527 558 568 568 573 585 588 588 590 590 591 592 594 598 598 598 602 619 619 625 644 652 664 669 678 691 697 697 702 770 770 786 794 812 812 817 817 818 818 819 824 826 832 834 839 843 846 851 853 856 856 859 860 862 865 866 872 880 905 906 907 908 909 910 911 912 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952
12 4 5 24 24 24 31 32 32 32 32 32 33 33 33 46 63 72 78 120 120 120 124 136 136 162 182 189 189 217 217 217 237 237 249 249 249 249 253 271 370 370 370 395 415 416 502 502 502 502 502 514 531 536 540 540 540 540 553 553 558 568 580 585 588 606 625 638 653 664 684 693 693 699 702 714 726 731 755 755 755 755 755 770 786 793 793 794 794 810 810 818 824 832 834 836 842 846 846 851 883 883 883 883 893 898 898 901 916 916 922 923 929 931 932 935 939 941 943 953 954 955 956 957 958 958 958 959 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1013 1014 1015
13 4 4 4 4 4 4 4 4 24 32 32 35 63 78 83 83 84 84 105 105 114 120 165 188 188 189 204 210 211 223 227 237 247 247 249 249 249 249 249 260 260 289 289 317 325 338 384 405 414 432 439 439 447 463 502 502 502 502 502 502 502 504 509 540 544 544 550 558 568 568 588 593 604 606 606 606 607 617 625 634 653 653 693 712 750 754 755 782 786 794 804 805 810 812 818 836 836 845 846 846 846 847 849 852 868 893 896 915 918 939 943 955 958 965 965 965 974 974 979 986 989 989 997 1000 1002 1016 1017 1018 1019 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086
14 4 4 11 31 31 32 32 32 32 32 33 33 46 46 48 72 72 72 72 72 78 83 95 105 120 120 120 120 120 133 193 210 210 211 211 213 217 217 217 217 218 221 237 249 270 304 320 320 324 325 326 346 349 349 356 405 405 407 424 431 431 439 442 502 502 502 502 527 537 543 544 553 553 558 572 574 579 585 588 588 598 617 625 644 662 674 693 699 742 749 751 755 755 782 836 836 842 842 842 846 851 856 858 867 916 925 943 958 961 1001 1001 1001 1032 1035 1035 1052 1060 1082 1085 1087 1088 1089 1090 1091 1092 1093 1093 1094 1095 1096 1097 1098 1098 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1107 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1140 1141 1142 1143 1144 1145 1146
15 4 4 7 32 32 32 72 72 72 83 83 84 114 114 120 120 120 120 124 147 162 202 202 218 218 218 228 249 289 298 304 320 320 320 320 324 345 366 366 370 407 412 415 424 439 500 500 502 514 522 546 546 583 585 588 644 644 653 662 668 674 684 702 706 706 782 782 793 793 794 824 836 836 847 867 883 883 901 916 955 959 965 989 1003 1022 1027 1028 1030 1034 1034 1039 1060 1087 1087 1097 1099 1099 1103 1109 1114 1114 1120 1133 1140 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1164 1165 1166 1167 1168 1169 1170 1171 1171 1172 1173 1174 1175 1175 1176 1177 1177 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213
16 4 4 32 33 114 120 370 370 381 439 506 522 527 527 568 588 598 606 606 606 622 653 693 702 706 836 867 901 916 959 964 1019 1025 1097 1097 1177 1177 1177 1192 1193 1193 1202 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234
17 2 2 4 4 4 4 4 4 4 4 4 24 24 31 31 31 31 31 45 45 68 72 72 72 73 84 182 189 189 189 202 211 211 217 217 217 217 217 217 218 218 218 218 218 271 271 271 276 346 370 370 370 370 370 370 403 415 416 527 539 539 539 550 550 550 553 553 553 553 553 553 553 558 558 558 558 558 558 558 568 568 568 606 606 607 674 674 702 738 755 769 782 782 782 787 847 858 858 858 858 867 954 955 965 1087 1087 1087 1087 1087 1087 1087 1087 1087 1087 1087 1098 1149 1219 1223 1226 1233 1235 1236 1236 1236 1237 1238 1239 1240 1241 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275
18 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 22 22 24 24 31 31 33 45 46 46 68 72 72 84 133 133 133 136 179 189 189 189 189 189 189 189 189 202 202 202 207 207 211 211 217 218 218 218 227 268 271 271 289 370 370 370 370 370 370 370 370 370 415 416 416 429 463 504 504 504 510 539 539 550 550 550 553 553 553 553 553 553 553 553 558 558 558 558 558 558 558 558 559 568 568 568 568 588 588 607 607 755 755 755 755 755 782 782 782 908 919 919 954 954 954 954 954 954 954 954 954 954 954 954 955 1087 1087 1087 1087 1087 1087 1087 1087 1087 1149 1149 1155 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1250 1258 1258 1259 1267 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303
19
20 35 46 58 58 72 73 98 105 117 120 120 133 133 133 136 141 141 156 162 182 202 204 204 209 213 260 270 289 318 337 340 358 372 373 405 496 508 540 553 553 568 583 592 653 684 699 713 738 784 786 845 858 858 867 874 885 893 1029 1034 1061 1098 1098 1098 1111 1133 1155 1187 1187 1214 1219 1228 1283 1304 1305 1306 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1319 1320 1321 1322 1323 1323 1324 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1366 1367 1368 1369 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1388 1389 1390 1391 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422
21 33 45 48 48 56 133 162 165 204 270 325 338 340 340 366 370 370 371 433 434 553 558 572 572 572 583 583 784 806 842 845 847 852 925 979 1083 1177 1181 1187 1219 1256 1256 1290 1307 1331 1333 1339 1342 1342 1345 1352 1358 1367 1369 1378 1379 1381 1392 1392 1410 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1440 1441 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1475 1476
22 4 4 4 4 4 4 4 4 21 22 32 53 67 73 95 133 133 133 133 179 182 211 217 217 218 218 219 287 310 366 414 496 502 502 502 504 527 527 539 544 550 553 572 572 622 699 706 784 793 836 842 845 845 852 867 867 867 958 965 974 980 1030 1049 1087 1087 1088 1098 1153 1181 1187 1214 1214 1219 1219 1222 1256 1271 1283 1305 1310 1315 1339 1340 1342 1342 1350 1351 1369 1370 1370 1385 1388 1395 1450 1451 1451 1451 1463 1467 1477 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567
23 4 4 4 24 72 72 84 120 120 120 133 136 189 189 210 217 217 217 217 218 236 289 304 320 320 320 320 340 346 347 349 349 508 527 539 550 553 558 563 568 592 618 693 739 782 782 782 816 835 847 867 867 867 867 867 901 923 924 1018 1024 1047 1102 1153 1177 1181 1181 1199 1235 1241 1241 1246 1256 1257 1258 1270 1303 1304 1310 1326 1340 1340 1343 1350 1351 1351 1351 1371 1395 1432 1463 1487 1488 1490 1503 1511 1512 1515 1515 1526 1544 1568 1569 1570 1571 1572 1573 1574 1575 1576 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631
24 4 21 31 32 33 72 72 73 133 189 217 218 227 243 285 320 327 338 340 346 346 366 368 368 370 370 370 370 376 416 417 424 424 430 438 504 504 537 550 550 553 558 568 572 606 606 655 684 786 842 867 867 903 903 954 965 1030 1087 1087 1098 1170 1200 1200 1214 1218 1223 1223 1228 1246 1246 1258 1258 1270 1310 1322 1336 1343 1351 1370 1370 1463 1463 1488 1492 1513 1515 1518 1533 1545 1586 1589 1594 1597 1615 1621 1623 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1643 1644 1645 1646 1646 1646 1647 1648 1649 1650 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690
25 4 4 31 32 72 72 73 73 133 217 217 217 218 271 320 403 539 550 558 702 755 858 858 867 867 903 965 1073 1237 1241 1241 1241 1256 1336 1340 1351 1351 1370 1391 1426 1462 1463 1487 1533 1558 1560 1594 1671 1680 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1707 1708 1709 1710 1711 1712
26 22 31 32 39 56 58 78 84 105 133 136 141 142 162 182 182 210 219 241 247 249 256 260 318 324 345 358 366 403 416 506 506 509 568 572 572 598 626 642 653 674 674 691 751 793 819 847 868 918 923 923 978 980 987 1039 1082 1119 1155 1182 1199 1203 1206 1303 1345 1368 1368 1388 1388 1392 1398 1406 1415 1441 1477 1521 1521 1557 1575 1630 1646 1651 1704 1713 1714 1715 1716 1717 1718 1719 1719 1720 1721 1722 1723 1724 1725 1726 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1748 1749 1750 1751 1752 1753 1754 1755 1756 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1765 1766 1767 1767 1768 1769 1770 1771 1771 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821
27 32 32 33 35 35 38 58 58 78 78 81 84 89 114 124 124 162 168 182 182 182 202 204 211 211 223 241 249 249 249 259 296 320 320 325 345 346 366 366 366 366 370 395 417 428 433 500 510 527 553 572 598 598 619 626 653 654 675 699 702 702 704 755 805 818 832 842 864 923 955 987 987 987 990 1001 1088 1200 1200 1352 1368 1388 1388 1415 1415 1515 1515 1529 1672 1680 1692 1713 1720 1722 1733 1738 1743 1747 1748 1750 1755 1759 1763 1763 1764 1765 1766 1766 1766 1768 1771 1771 1771 1771 1771 1771 1775 1776 1777 1778 1779 1779 1785 1789 1790 1793 1794 1809 1815 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1893 1894 1895 1896 1897 1898 1899 1900 1901
28 22 35 58 78 78 133 168 182 204 241 243 249 249 260 324 346 354 366 366 371 372 414 429 447 504 536 538 553 553 558 572 572 594 622 625 637 653 653 654 679 694 699 702 702 704 704 706 706 713 738 818 819 819 832 848 922 923 923 923 925 954 954 965 987 987 1034 1059 1059 1087 1087 1127 1129 1155 1165 1183 1187 1226 1241 1301 1303 1342 1374 1406 1415 1444 1509 1518 1518 1538 1630 1696 1713 1718 1722 1728 1729 1738 1753 1763 1765 1771 1771 1771 1771 1771 1774 1789 1832 1833 1836 1841 1844 1862 1873 1883 1902 1903 1904 1905 1905 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1934 1935 1936 1937 1938 1939 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980
29 4 31 31 31 33 33 58 58 78 133 133 162 179 241 249 260 346 349 370 408 429 527 568 592 621 622 624 625 652 662 699 699 704 753 816 819 819 832 832 868 923 1083 1087 1155 1174 1303 1543 1543 1680 1714 1718 1718 1738 1743 1771 1771 1800 1800 1829 1830 1833 1835 1836 1841 1844 1868 1873 1877 1884 1889 1904 1916 1936 1957 1961 1971 1976 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043
30 31 32 33 33 58 76 83 144 162 204 210 219 221 230 320 340 345 345 347 366 395 403 429 527 540 540 543 548 553 553 583 594 622 652 652 653 662 694 699 709 709 744 753 782 832 858 923 923 923 923 934 954 1003 1026 1083 1083 1088 1111 1174 1290 1303 1303 1360 1521 1630 1651 1725 1738 1763 1771 1779 1787 1788 1799 1838 1852 1856 1871 1873 1874 1883 1902 1902 1903 1915 1916 1930 1931 1941 1961 1975 1997 1998 2014 2014 2015 2015 2015 2029 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150
31 4 7 7 31 31 32 33 33 48 78 78 89 114 133 147 162 182 208 211 241 260 296 315 345 381 395 403 439 494 498 543 553 563 619 623 624 699 704 707 895 923 923 978 978 990 1052 1174 1195 1199 1303 1518 1519 1566 1630 1630 1680 1721 1723 1731 1738 1743 1750 1848 1856 1868 1900 1902 1953 1957 1962 1963 1973 1987 1987 1993 2010 2033 2051 2052 2058 2061 2067 2069 2106 2147 2151 2152 2153 2154 2155 2156 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2209 2210 2211 2212 2213 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260
32 32 32 33 33 48 58 63 78 95 133 253 275 301 354 371 395 405 495 597 662 699 699 707 707 738 778 784 793 805 818 867 899 923 1027 1027 1034 1103 1103 1144 1200 1237 1529 1692 1714 1743 1743 1749 1750 1753 1768 1817 1841 1843 1878 1993 2047 2054 2054 2061 2067 2067 2067 2067 2101 2113 2116 2139 2152 2156 2159 2165 2167 2168 2171 2190 2190 2201 2208 2221 2233 2248 2261 2262 2263 2264 2264 2265 2265 2266 2267 2268 2269 2269 2270 2271 2272 2273 2274 2275 2276 2277 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2299 2300 2301 2302 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2316 2317 2318 2319 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369
33 33 48 58 78 78 114 118 162 167 182 182 193 202 202 204 221 226 249 249 257 261 274 287 287 345 346 368 408 412 457 504 506 576 592 624 653 697 699 699 771 818 832 847 923 923 1003 1103 1175 1199 1200 1202 1223 1370 1519 1696 1723 1723 1750 1771 1777 1848 1903 1929 1935 2014 2030 2053 2061 2072 2151 2152 2152 2153 2168 2168 2221 2243 2247 2262 2263 2264 2288 2291 2293 2293 2303 2323 2333 2335 2340 2352 2370 2371 2372 2373 2374 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2451 2452 2453 2454 2455 2456 2457 2458 2459 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474
34 31 32 32 33 35 35 44 58 58 67 67 70 78 78 83 96 115 136 136 162 182 182 202 202 202 202 217 230 237 249 320 324 340 345 346 366 397 405 414 504 519 540 572 576 593 597 622 625 669 694 694 699 790 815 815 832 835 920 923 923 954 1042 1098 1102 1110 1129 1199 1200 1218 1477 1501 1509 1515 1529 1557 1625 1692 1722 1723 1742 1844 1868 1877 1904 1904 1972 2152 2165 2168 2171 2173 2198 2243 2267 2293 2293 2294 2308 2317 2323 2323 2387 2389 2390 2400 2400 2422 2423 2423 2440 2442 2447 2459 2461 2475 2475 2476 2477 2478 2479 2480 2481 2481 2482 2483 2484 2485 2486 2487 2488 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2527 2528 2529 2530 2531 2532 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569
35 30 32 33 35 58 60 64 76 78 78 84 89 120 133 202 204 204 241 249 249 301 304 340 366 384 416 428 496 508 624 699 700 700 778 815 832 906 923 923 943 987 997 1001 1200 1203 1226 1303 1360 1424 1432 1441 1749 1802 1868 1914 1933 1936 1962 2171 2188 2243 2327 2342 2352 2360 2427 2490 2494 2494 2502 2504 2530 2532 2533 2546 2546 2547 2548 2558 2560 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612
36 32 32 32 58 58 63 89 98 133 133 133 162 162 188 204 213 217 304 345 358 366 366 366 366 381 395 395 395 539 553 623 624 624 640 667 667 667 694 694 699 722 782 815 816 858 922 923 979 1012 1026 1040 1063 1079 1079 1088 1091 1149 1222 1453 1461 1526 1565 1662 1692 1692 1731 1750 1796 1829 1889 1931 1997 2000 2014 2014 2038 2111 2164 2188 2427 2445 2501 2505 2546 2578 2580 2591 2594 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656
37 9 32 32 33 46 58 63 79 84 133 133 162 188 237 247 259 260 273 301 301 304 304 326 340 358 366 424 447 480 504 508 546 580 591 606 617 617 637 640 653 667 667 699 782 793 793 794 895 923 955 1001 1026 1034 1034 1061 1087 1088 1088 1127 1147 1148 1155 1166 1177 1177 1228 1249 1303 1323 1339 1343 1368 1388 1441 1441 1444 1515 1630 1645 1800 1809 1972 2000 2054 2117 2151 2157 2164 2292 2360 2580 2591 2591 2617 2624 2625 2626 2631 2632 2632 2633 2634 2635 2638 2642 2643 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705
38 4 32 32 33 46 58 63 78 88 179 182 204 204 211 241 249 249 259 301 345 346 346 366 412 415 416 416 438 439 447 447 447 504 527 527 539 540 553 553 558 661 667 667 667 674 699 722 725 725 782 794 797 812 842 842 842 923 954 954 1129 1137 1144 1181 1202 1259 1339 1339 1444 1543 1617 1680 1705 1713 1874 1874 1878 2030 2054 2153 2224 2256 2307 2360 2413 2461 2481 2546 2580 2617 2619 2633 2635 2660 2661 2662 2663 2664 2665 2666 2669 2679 2680 2681 2689 2694 2695 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752
39 4 4 32 32 55 58 58 70 95 124 133 141 177 186 211 211 217 247 249 249 259 260 301 304 312 312 326 329 338 340 345 366 366 408 447 447 502 509 509 510 522 527 553 558 566 598 612 619 621 622 625 625 625 640 653 653 653 667 667 667 674 699 715 741 753 868 954 955 958 1027 1034 1063 1102 1120 1147 1193 1241 1241 1303 1483 1672 1719 1803 1868 1868 1973 2003 2014 2138 2138 2211 2248 2450 2494 2580 2615 2617 2617 2624 2625 2625 2625 2633 2635 2661 2662 2666 2669 2679 2682 2689 2711 2713 2725 2725 2728 2729 2732 2734 2737 2740 2746 2748 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2780 2781 2782 2783 2784 2785
40 35 44 120 131 202 207 304 304 336 381 434 537 553 566 572 867 1039 1170 1222 1235 1259 1270 1357 1501 1575 1575 1617 1749 1795 1868 1889 2434 2627 2716 2756 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2799 2800 2801 2802 2803 2804 2804 2805 2806 2807 2808 2809 2810 2811 2812 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833
41 8 21 26 28 28 31 32 33 33 33 38 42 46 46 48 49 49 53 55 57 58 58 59 60 61 61 63 65 66 67 68 72 73 73 78 82 84 84 84 85 85 88 92 94 96 96 103 103 111 113 115 122 124 133 138 142 143 148 151 153 154 160 162 165 166 167 167 172 174 178 178 179 180 182 183 186 188 189 189 189 189 196 199 201 202 202 202 202 202 204 205 213 218 218 239 255 256 268 268 271 277 277 278 289 289 290 290 291 299 340 366 368 371 371 376 407 414 415 553 598 623 625 816 816 835 965 965 965 1082 1086 1129 1129 1172 1222 1241 1574 1575 1630 1673 1707 1825 1884 1928 2158 2293 2494 2619 2722 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2853 2854 2855 2856 2857 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883
42 4 5 24 28 32 32 33 44 44 48 49 51 52 55 56 56 56 59 65 70 72 72 73 78 96 97 103 111 111 113 117 123 124 135 136 136 136 141 143 148 152 153 167 178 179 182 185 186 188 190 217 218 226 230 232 235 236 241 244 246 247 249 255 259 260 260 260 261 268 268 268 273 274 276 277 278 279 282 287 289 290 291 291 293 294 295 304 305 308 310 326 340 340 349 368 376 381 384 403 406 407 407 414 417 450 454 510 535 540 553 554 702 710 738 789 889 964 1087 1087 1155 1200 1241 1241 1388 1432 1681 1696 1822 1962 1974 2014 2371 2372 2400 2409 2450 2619 2624 2781 2877 2878 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926
43 5 24 31 32 32 32 35 46 47 49 56 67 68 68 72 73 73 120 123 124 130 135 141 143 165 167 177 179 189 189 190 213 213 217 220 223 228 232 241 246 255 256 268 271 276 282 284 287 287 290 305 306 306 324 325 326 326 340 347 358 362 368 371 372 376 376 377 381 388 389 390 394 395 397 398 399 403 404 405 407 411 415 415 415 442 447 450 539 550 553 593 691 699 741 816 856 868 954 1097 1097 1102 1191 1195 1214 1214 1259 1351 1368 1390 1417 1477 1545 1545 1680 1841 1868 1868 1962 2223 2248 2293 2360 2475 2475 2506 2508 2510 2514 2625 2673 2678 2779 2877 2888 2915 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973
44 4 21 24 31 41 46 48 49 72 73 83 103 105 120 120 120 124 124 130 136 136 136 165 179 189 189 193 202 217 218 218 219 222 227 227 227 228 232 243 249 268 271 275 289 320 324 325 327 329 334 349 354 356 363 376 388 395 404 405 407 421 431 431 439 439 442 447 450 454 457 473 489 504 504 504 504 504 510 550 550 553 553 568 593 709 753 883 959 964 964 965 987 1047 1052 1086 1087 1097 1097 1241 1259 1432 1501 1696 1829 1865 2240 2469 2484 2726 2727 2847 2914 2933 2946 2947 2947 2948 2974 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2989 2990 2991 2992 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007
45 4 21 22 105 114 114 120 120 124 124 130 156 162 188 189 202 217 217 217 232 241 249 289 289 325 340 408 414 415 419 423 428 429 429 432 437 439 462 474 474 478 480 485 496 497 497 498 500 502 504 508 509 509 509 527 527 528 530 532 532 533 533 535 539 543 543 547 554 554 559 864 868 912 930 930 954 965 971 1002 1019 1087 1129 1149 1163 1183 1200 1214 1214 1237 1241 1259 1259 1318 1350 1390 1424 1501 1526 1538 1678 1714 1829 1829 1886 1973 2014 2086 2198 2198 2243 2371 2421 2678 2753 2758 2766 2851 2877 2995 2995 3003 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3020 3021 3022 3023 3024 3024 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3034 3035 3036 3037 3038 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081
46
47 21 31 32 33 33 58 58 64 78 204 207 217 217 260 260 318 366 366 408 504 508 508 539 550 553 567 568 568 568 568 568 570 573 574 576 577 580 588 590 590 591 594 597 597 598 599 601 603 604 606 608 608 609 610 612 613 614 623 624 625 626 634 635 638 641 642 643 646 646 649 652 652 653 659 662 663 664 672 678 690 693 699 703 708 712 713 715 717 725 726 727 733 751 763 782 790 792 819 823 841 849 867 868 887 919 934 939 939 939 954 1052 1087 1130 1270 1276 1303 1451 1673 1679 2400 2591 2591 2627 2706 2856 2926 3042 3075 3075 3082 3083 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120
48 21 31 31 58 67 181 181 217 217 217 217 340 346 346 356 366 366 499 527 527 527 539 553 568 588 588 588 590 590 606 606 612 623 626 630 637 638 638 638 641 650 652 652 653 664 687 691 700 706 711 711 714 715 716 721 723 725 729 738 741 745 753 762 763 764 765 765 767 769 774 780 782 783 785 786 787 787 791 796 802 803 810 810 811 838 849 858 894 895 942 951 954 954 979 1019 1027 1039 1044 1057 1170 1174 1203 1222 1222 1572 1691 1829 1953 1953 1987 1987 2014 2014 2135 2241 2736 2793 2912 2962 3100 3121 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164
49 4 4 4 4 32 32 33 33 58 58 72 72 83 84 105 157 162 162 162 162 179 179 179 213 217 217 217 217 217 243 318 320 321 336 346 366 368 384 388 416 424 504 539 550 550 550 553 553 553 553 558 570 573 583 588 590 635 638 644 654 664 691 691 697 702 704 711 750 753 753 754 755 755 756 757 759 760 762 763 765 770 774 775 799 807 817 818 819 823 837 838 842 842 844 845 846 846 849 851 854 858 858 858 858 860 865 866 868 874 875 878 880 880 885 885 887 889 889 891 891 892 895 897 922 925 942 951 954 970 1019 1030 1034 1047 1049 1060 1097 1170 1187 1195 1199 1214 1241 1241 1241 1241 1241 1259 1405 1465 1501 1529 1575 1622 1679 1768 1889 2276 2494 2576 2627 2678 2678 2847 2973 3006 3043 3063 3073 3147 3155 3165 3166 3167 3168 3169 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212
50 31 32 32 58 63 114 219 247 320 345 345 358 366 366 366 395 416 424 502 504 504 509 539 544 550 550 554 558 558 558 569 580 580 583 583 588 590 598 604 612 617 617 624 636 638 664 693 693 710 715 750 770 770 770 780 786 790 813 817 818 818 819 824 825 826 832 834 836 836 839 839 843 846 846 851 853 853 854 856 858 858 859 860 867 868 869 872 874 875 875 878 880 885 885 887 887 889 902 909 915 920 923 924 925 928 931 932 933 939 939 940 941 943 951 951 954 954 1002 1007 1083 1107 1111 1235 1235 1241 1303 1679 1742 1841 1841 1862 1872 2135 2165 2276 2276 2390 2627 2729 2745 2748 3105 3117 3182 3184 3194 3197 3197 3204 3208 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241
51 22 32 32 32 32 32 33 33 46 58 58 63 72 114 182 217 217 217 218 247 247 260 260 345 358 366 424 439 539 539 553 553 558 558 591 604 608 623 623 693 698 702 731 738 750 770 770 782 786 794 815 817 818 819 824 825 832 834 843 846 856 862 862 862 868 880 895 896 902 909 913 916 919 922 924 926 927 928 929 931 932 933 939 939 941 943 943 944 946 948 948 954 954 954 954 955 957 959 968 970 971 973 974 975 978 983 986 987 1000 1004 1007 1010 1014 1034 1061 1077 1079 1083 1087 1121 1149 1149 1153 1153 1187 1259 1707 1742 1742 1750 1829 1841 1841 1946 2047 2168 2188 2276 2306 2683 3004 3047 3075 3077 3104 3171 3194 3225 3235 3237 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274
52 4 22 31 32 33 58 72 72 105 124 204 218 218 218 218 218 227 227 247 249 287 326 439 480 489 502 502 502 502 502 502 504 504 539 540 553 553 558 568 572 574 583 585 588 606 606 606 606 684 693 699 709 751 755 765 793 804 829 836 846 846 849 851 868 881 898 911 915 916 916 939 943 949 954 954 955 956 957 958 961 962 965 969 972 974 974 978 978 987 989 996 1000 1001 1002 1003 1005 1016 1017 1021 1023 1029 1030 1030 1034 1034 1034 1035 1043 1050 1052 1055 1055 1058 1060 1060 1063 1064 1068 1071 1083 1106 1109 1111 1114 1127 1127 1152 1170 1174 1183 1204 1235 1259 1471 1506 1545 1660 1679 1696 1841 1841 1869 1874 1874 1974 2014 2014 2151 2152 2168 2188 2243 2307 2532 2532 2678 2736 2758 2764 3065 3152 3171 3192 3255 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309
53 32 33 48 69 105 120 120 188 188 189 189 204 204 204 217 217 218 247 247 249 249 260 271 320 320 320 349 370 405 408 408 416 438 500 500 502 502 502 502 502 509 543 544 546 552 553 553 566 588 588 607 617 652 654 654 662 693 699 812 819 842 842 847 851 858 868 868 868 916 955 959 964 965 983 1001 1003 1009 1019 1021 1022 1023 1024 1030 1033 1034 1041 1047 1057 1060 1061 1063 1064 1064 1076 1083 1085 1097 1097 1099 1107 1109 1109 1111 1114 1120 1120 1120 1121 1129 1129 1129 1129 1129 1129 1129 1132 1138 1145 1153 1155 1174 1182 1187 1199 1200 1214 1228 1258 1259 1270 1276 1386 1451 1506 1528 1553 1622 1696 1718 1809 2048 2138 2138 2248 2326 2532 2619 2758 2758 3034 3047 3071 3079 3085 3096 3096 3264 3275 3277 3278 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348
54 32 48 78 105 114 120 120 120 120 182 204 204 211 241 249 303 303 304 324 324 346 349 366 366 366 366 405 502 502 502 502 502 522 544 544 546 585 588 588 588 597 617 644 653 699 725 782 836 836 868 875 959 961 980 1001 1001 1027 1034 1052 1059 1083 1087 1087 1093 1099 1102 1102 1103 1109 1109 1110 1111 1114 1119 1120 1120 1127 1129 1130 1131 1133 1138 1140 1141 1141 1144 1153 1165 1169 1189 1192 1214 1241 1258 1258 1270 1392 1505 1509 1526 1526 1575 1678 1684 1684 1915 2014 2138 2269 2678 2761 2761 2874 2997 3003 3049 3054 3075 3138 3138 3316 3319 3325 3330 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371
55 4 4 4 30 31 31 32 32 32 32 33 202 228 247 249 276 320 320 338 345 346 366 366 366 366 366 366 366 366 366 381 439 442 462 509 546 568 588 588 653 653 653 653 653 674 674 751 782 842 842 842 847 847 847 989 1025 1027 1030 1030 1034 1041 1060 1097 1097 1097 1098 1114 1140 1148 1150 1151 1155 1168 1169 1169 1170 1170 1177 1183 1183 1187 1189 1192 1193 1196 1200 1205 1206 1210 1213 1226 1227 1229 1233 1234 1234 1241 1256 1258 1258 1258 1270 1270 1303 1392 1415 1451 1501 1550 1662 1673 1679 1680 1742 1794 1822 2014 2014 2461 2493 2713 2764 3079 3098 3121 3147 3152 3194 3254 3316 3360 3361 3365 3372 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402
56 4 4 4 32 114 120 217 218 218 358 366 366 370 370 381 426 506 506 540 543 553 558 558 568 588 588 638 810 810 867 939 964 1019 1060 1087 1087 1098 1153 1177 1214 1218 1219 1234 1241 1241 1242 1258 1258 1270 1276 1286 1371 1424 1451 1501 1678 1679 1679 1679 1745 2242 2706 2791 2941 3194 3284 3360 3392 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414
57 4 4 4 24 24 24 25 31 31 45 46 68 72 72 72 72 72 72 73 73 133 182 189 189 189 189 202 217 217 217 217 218 218 218 218 218 218 218 218 218 271 345 345 345 345 346 346 346 366 366 370 370 370 370 370 407 434 489 527 539 539 539 539 550 550 550 550 550 550 553 553 553 553 558 558 568 568 588 607 618 653 716 782 816 867 867 867 954 954 954 954 1041 1087 1087 1087 1087 1177 1187 1218 1223 1223 1235 1236 1236 1236 1238 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1246 1253 1254 1258 1258 1259 1265 1265 1266 1266 1270 1273 1278 1286 1290 1303 1451 1526 1550 1588 1679 1679 1679 1680 1692 1822 2014 2047 2242 2369 2501 2823 2941 3075 3075 3075 3079 3079 3079 3372 3372 3372 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449
58 4 4 4 4 4 4 4 4 4 4 4 21 24 24 24 24 24 24 31 31 31 32 32 33 46 46 72 72 72 84 133 133 189 189 189 189 189 202 202 202 213 217 217 217 217 217 218 218 234 271 312 370 370 370 370 370 370 434 527 527 527 539 539 550 553 553 568 568 607 755 755 782 858 908 919 954 954 954 954 954 1087 1087 1087 1087 1087 1087 1087 1087 1087 1087 1149 1223 1238 1238 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1242 1258 1258 1258 1258 1259 1259 1281 1283 1286 1287 1290 1424 1673 1679 1679 1679 1692 1704 2014 2591 2753 2941 2957 2957 2957 2957 3079 3194 3194 3194 3194 3194 3194 3416 3429 3438 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464
59 4 4 24 31 32 33 46 46 72 120 120 133 179 189 189 189 189 189 189 202 217 218 218 218 268 370 370 539 550 550 553 553 558 558 558 558 558 568 568 568 755 755 782 782 843 858 954 954 955 965 965 965 1039 1087 1087 1087 1214 1235 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1283 1286 1538 1538 1675 1679 1679 1679 1679 2014 2238 2761 2941 2957 3075 3079 3194 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3485 3486
60 4 4 4 24 24 31 31 32 33 56 72 105 136 189 189 207 209 209 209 217 217 217 217 217 218 247 260 271 301 306 312 317 320 354 408 548 550 553 553 558 568 568 568 568 568 568 568 613 619 619 623 635 637 652 653 684 706 738 784 847 853 858 894 939 954 965 985 1087 1151 1187 1193 1223 1226 1237 1334 1338 1339 1342 1343 1355 1375 1375 1378 1411 1422 1428 1441 1460 1468 1471 1515 1617 1673 1809 1829 1841 1905 2326 2494 2510 2532 2706 2707 2729 2745 3075 3194 3264 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576
61 4 4 33 33 45 48 58 73 83 105 120 120 120 133 133 202 204 204 217 218 285 289 312 320 320 320 324 327 340 370 432 438 485 502 504 508 509 509 527 540 544 550 558 563 699 739 770 845 867 867 867 922 965 1022 1030 1047 1082 1083 1086 1097 1098 1109 1177 1206 1214 1241 1270 1271 1303 1305 1307 1310 1312 1315 1337 1339 1339 1340 1342 1345 1353 1365 1367 1367 1369 1370 1378 1379 1379 1379 1381 1381 1382 1383 1388 1388 1392 1392 1415 1424 1443 1450 1451 1451 1457 1458 1459 1460 1467 1475 1515 1515 1523 1526 1544 1560 1621 1623 1679 1681 1696 1705 1779 1796 1805 1972 2014 2018 2138 2240 2341 2400 2706 2736 2753 2753 2765 2877 2903 2957 2957 2957 3079 3171 3252 3293 3311 3325 3455 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626
62 4 21 21 24 45 53 72 72 73 120 133 133 146 156 179 204 204 217 312 320 320 338 340 349 366 407 429 502 502 502 502 502 553 553 558 637 699 699 725 739 784 784 816 845 852 867 867 884 949 965 979 1087 1097 1097 1097 1098 1098 1109 1182 1187 1218 1246 1256 1310 1315 1339 1340 1342 1342 1342 1345 1350 1351 1351 1351 1365 1371 1379 1381 1388 1395 1407 1450 1450 1451 1451 1451 1463 1467 1482 1483 1486 1487 1489 1490 1493 1494 1497 1498 1500 1501 1502 1504 1504 1505 1507 1508 1508 1511 1513 1514 1515 1518 1519 1520 1522 1523 1523 1525 1526 1526 1527 1529 1530 1531 1532 1538 1538 1540 1541 1543 1552 1553 1553 1557 1560 1561 1562 1563 1629 1630 1678 1679 1680 1690 1796 1839 1962 1965 2134 2161 2400 2483 2867 2925 3047 3194 3248 3360 3583 3627 3628 3629 3630 3631 3632 3633 3634 3635 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665
63 4 4 21 22 72 73 120 120 133 133 133 136 165 232 320 320 327 340 439 508 527 537 539 539 550 696 702 702 782 784 784 835 841 847 867 1072 1098 1098 1098 1098 1102 1170 1177 1181 1214 1214 1219 1241 1241 1246 1256 1256 1271 1310 1339 1342 1342 1395 1451 1451 1467 1501 1512 1515 1515 1515 1517 1526 1544 1550 1560 1568 1572 1575 1576 1580 1581 1589 1591 1593 1598 1605 1609 1616 1617 1618 1619 1621 1623 1630 1704 1711 1712 1723 1780 1868 2014 2135 2619 2812 2847 2979 3047 3047 3075 3075 3139 3251 3426 3537 3587 3591 3612 3612 3651 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695
64 4 4 4 4 19 32 33 35 48 118 120 133 133 217 217 227 289 340 368 441 443 550 558 782 813 842 842 842 852 867 867 867 901 954 1241 1310 1336 1340 1350 1351 1351 1370 1370 1371 1501 1513 1538 1587 1589 1594 1597 1615 1615 1621 1632 1636 1637 1637 1638 1640 1642 1646 1646 1647 1650 1651 1652 1656 1661 1662 1663 1663 1671 1672 1681 1684 1689 1694 1702 1707 2014 2753 2812 3121 3499 3687 3694 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714
65 4 4 4 4 4 4 4 22 31 31 32 32 72 73 84 162 217 318 321 346 370 370 508 550 558 755 784 842 954 965 1087 1226 1241 1276 1336 1351 1557 1594 1623 1671 1680 1689 1697 1702 1703 2014 2014 2014 2117 2135 2792 2941 2941 3056 3152 3177 3326 3703 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727
66 32 39 58 204 275 318 318 320 371 407 408 408 414 417 432 473 626 649 653 653 653 653 655 667 668 668 674 674 793 797 939 1030 1113 1115 1203 1210 1319 1352 1388 1529 1557 1566 1714 1716 1720 1722 1725 1726 1729 1738 1742 1742 1745 1745 1747 1748 1748 1750 1751 1755 1756 1758 1759 1763 1764 1766 1766 1766 1768 1771 1771 1777 1779 1779 1781 1784 1785 1785 1791 1794 1796 1798 1799 1800 1802 1803 1807 1808 1809 1810 1811 1812 1813 1815 1820 1821 1836 1841 1842 1864 1868 1870 1871 1875 1889 1895 1901 1902 1929 1936 1961 1980 2014 2017 2018 2060 2106 2186 2202 2237 2301 2360 2360 2389 2450 2491 2494 2494 2521 2546 2591 2617 2745 2745 2748 2748 2781 3038 3075 3293 3311 3378 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3770 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783
67 14 32 32 32 48 58 84 133 133 168 183 211 259 260 366 395 395 408 433 439 547 558 563 566 572 572 580 583 591 598 622 625 642 653 654 662 662 684 694 699 704 731 755 797 816 818 818 819 832 832 858 910 922 923 925 954 987 1034 1200 1352 1415 1477 1501 1521 1543 1543 1630 1692 1726 1738 1747 1748 1750 1763 1763 1765 1766 1771 1771 1771 1771 1776 1777 1785 1809 1819 1822 1824 1826 1832 1837 1840 1841 1841 1843 1844 1845 1852 1862 1863 1868 1871 1879 1882 1882 1885 1886 1888 1889 1891 1892 1896 1897 1899 1901 1903 1908 1909 1936 1953 1961 1963 1968 1972 1973 2000 2000 2030 2053 2099 2107 2138 2151 2242 2243 2361 2372 2400 2442 2470 2494 2501 2506 2563 2729 2741 2939 3047 3075 3079 3181 3219 3311 3369 3707 3707 3758 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824
68 33 58 72 78 98 133 133 168 193 204 217 217 217 241 241 249 354 366 366 366 366 414 439 447 463 494 537 592 607 619 625 632 635 637 653 654 668 675 675 679 699 794 819 842 923 925 958 1048 1079 1174 1374 1386 1388 1521 1543 1575 1753 1761 1771 1771 1829 1832 1856 1856 1862 1868 1868 1874 1874 1877 1899 1914 1916 1928 1928 1928 1929 1930 1931 1933 1933 1933 1937 1941 1943 1945 1946 1953 1953 1958 1959 1962 1963 1965 1965 1965 1968 1969 1971 1973 1980 2005 2014 2014 2016 2018 2028 2039 2042 2106 2111 2136 2147 2151 2151 2185 2237 2292 2360 2400 2440 2459 2470 2494 2578 2587 2653 2741 2881 2918 3075 3079 3079 3096 3464 3748 3789 3795 3800 3800 3801 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3867 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880
69 32 33 33 33 58 63 188 228 239 247 249 260 296 325 340 345 366 371 395 432 540 550 568 624 652 662 684 694 699 736 782 816 863 868 922 923 923 923 1027 1034 1061 1165 1170 1199 1241 1301 1303 1395 1680 1717 1721 1768 1810 1824 1833 1836 1856 1874 1884 1903 1916 1930 1957 2014 2030 2040 2048 2051 2052 2053 2058 2060 2061 2065 2084 2091 2094 2102 2103 2117 2117 2122 2128 2137 2141 2147 2152 2218 2243 2288 2361 2440 2481 2494 2546 2546 2572 2600 2614 2625 2655 2748 2751 2764 2874 2957 2957 3075 3075 3075 3312 3764 3784 3833 3835 3844 3854 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928
70 32 32 38 48 58 58 78 112 204 210 211 226 226 231 236 287 366 366 371 550 644 653 694 699 744 782 784 845 923 955 1009 1024 1027 1034 1036 1042 1052 1083 1220 1226 1303 1380 1441 1518 1538 1543 1630 1630 1738 1753 1777 1788 1836 1841 1856 1871 1916 1936 1936 1957 2000 2014 2015 2027 2033 2033 2046 2047 2052 2058 2061 2063 2067 2074 2083 2083 2099 2106 2113 2116 2122 2125 2132 2138 2145 2147 2152 2153 2156 2157 2161 2162 2165 2168 2170 2183 2186 2187 2188 2191 2193 2204 2205 2206 2207 2209 2224 2228 2230 2253 2258 2301 2302 2440 2440 2442 2459 2482 2494 2613 2624 2625 2668 2736 2851 2979 3004 3006 3059 3150 3281 3464 3464 3667 3801 3854 3862 3863 3880 3890 3891 3922 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005
71 33 63 105 143 162 217 260 321 371 372 390 408 429 432 540 572 613 621 642 694 699 707 784 789 793 842 842 895 918 923 923 923 1027 1034 1072 1157 1160 1199 1303 1357 1432 1543 1731 1743 1746 1750 1836 1836 1852 1870 1872 1875 1987 1995 2010 2061 2067 2125 2141 2147 2147 2151 2152 2156 2158 2186 2203 2207 2208 2224 2233 2258 2261 2263 2266 2268 2269 2272 2276 2280 2293 2301 2306 2323 2329 2336 2344 2352 2361 2440 2442 2459 2459 2494 2542 2576 2591 2726 2728 2979 2979 3047 3205 3205 3292 3321 3507 3587 3743 3790 3863 3870 3979 4006 4007 4008 4009 4010 4011 4012 4013 4014 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089
72 4 5 24 31 33 48 58 88 98 162 217 231 268 366 372 429 486 527 566 592 694 738 923 985 1019 1019 1200 1352 1432 1630 1675 1690 1692 1726 1753 1870 1871 1878 1946 1954 2082 2158 2202 2221 2234 2263 2276 2288 2293 2301 2303 2333 2371 2372 2373 2386 2390 2400 2413 2417 2423 2426 2433 2437 2440 2442 2443 2447 2450 2455 2458 2460 2462 2465 2470 2471 2494 2494 2494 2527 2558 2560 2568 2625 2741 2799 2851 2898 2914 2984 3063 3100 3150 3201 3309 3311 3318 3348 3348 3356 3356 3612 3784 3801 3844 3906 3913 3918 3979 4011 4052 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186
73 32 33 33 33 35 35 44 58 58 78 104 217 237 257 320 351 397 405 408 416 502 508 528 583 625 686 738 753 918 920 987 987 1009 1019 1052 1144 1175 1175 1199 1223 1377 1483 1515 1615 1622 1722 1726 1742 1877 1896 1915 1915 1946 1974 2061 2171 2221 2301 2323 2325 2327 2340 2385 2386 2387 2420 2423 2442 2445 2459 2494 2521 2528 2528 2537 2544 2558 2560 2561 2561 2563 2591 2594 2666 2805 2928 2972 3004 3042 3147 3177 3251 3311 3588 3641 3741 3742 3784 3785 3851 3898 3908 4109 4172 4179 4187 4188 4189 4190 4190 4191 4192 4193 4194 4195 4196 4196 4197 4198 4199 4200 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275
74 32 32 32 58 58 124 193 202 204 204 213 217 260 340 366 366 395 415 485 527 553 589 591 625 625 642 668 684 694 699 812 818 923 1003 1034 1034 1042 1199 1200 1200 1203 1471 1526 1675 1868 1884 1904 1914 1931 1950 2062 2111 2165 2165 2168 2243 2292 2292 2356 2360 2387 2389 2400 2423 2427 2440 2445 2491 2491 2494 2527 2532 2533 2542 2542 2546 2547 2555 2558 2558 2560 2563 2567 2583 2585 2591 2592 2593 2598 2600 2603 2609 2610 2617 2636 2638 2639 2666 2691 2736 2741 2755 2851 2874 3228 3264 3348 3356 3503 3725 3725 3835 3912 4036 4048 4115 4149 4210 4232 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4319 4320 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334
75 7 32 32 33 72 76 98 210 217 228 301 301 304 320 346 366 366 395 432 508 566 572 572 617 624 640 699 770 815 860 906 916 923 923 1061 1063 1219 1222 1229 1253 1263 1270 1303 1421 1692 1742 1822 1841 1868 1868 1870 1874 1941 2015 2117 2138 2138 2165 2214 2237 2241 2243 2292 2459 2475 2494 2494 2505 2546 2547 2560 2589 2598 2604 2617 2622 2625 2626 2627 2631 2638 2645 2652 2655 2680 2686 2696 2730 2801 3075 3417 3425 3503 3707 3750 3826 4291 4320 4321 4335 4335 4336 4337 4338 4339 4340 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364
76 32 33 33 33 60 63 68 89 133 156 188 237 260 301 304 368 395 432 617 617 619 624 640 652 667 694 699 713 772 815 860 923 1026 1069 1079 1222 1398 1444 1505 1681 1787 1800 1822 1953 2000 2014 2151 2164 2188 2243 2243 2292 2400 2494 2494 2580 2591 2592 2617 2623 2626 2628 2632 2638 2645 2654 2664 2669 2696 2701 2735 2746 2801 2851 2997 3075 3079 3588 3676 3682 4036 4048 4189 4343 4344 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382
77 8 32 32 32 33 33 33 58 58 105 120 124 133 133 156 162 228 287 301 304 349 366 366 395 414 442 447 447 527 553 568 625 640 640 653 653 667 667 699 702 738 797 835 847 954 963 1034 1069 1083 1121 1214 1271 1339 1543 1679 1720 1742 1829 1844 2111 2153 2188 2241 2248 2248 2413 2413 2427 2494 2497 2560 2576 2580 2613 2633 2635 2661 2662 2663 2669 2676 2680 2684 2687 2689 2695 2713 2721 2723 2726 2730 2732 2736 2740 2741 2743 2744 2745 2746 2747 2748 2748 2749 2751 2753 2775 2855 2874 2947 2957 3082 3205 3284 3294 3952 4115 4115 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409
78 32 46 58 60 60 78 124 133 144 162 182 182 186 210 211 211 211 287 304 312 324 345 358 366 381 414 415 416 447 447 487 504 527 565 621 622 623 625 652 653 667 699 725 739 782 858 898 965 974 1027 1034 1052 1058 1061 1087 1169 1196 1241 1451 1477 1633 1719 1787 2138 2224 2243 2269 2360 2413 2580 2616 2624 2625 2635 2635 2665 2679 2682 2713 2725 2729 2729 2732 2734 2736 2740 2741 2743 2748 2753 2757 2760 2766 2767 2768 2770 2775 2776 2777 2780 2780 2780 2781 2782 2783 2784 2785 2925 2957 3007 3053 3075 3075 3082 3127 3152 3299 3464 3510 3510 3536 3536 3746 4115 4182 4387 4402 4410 4411 4412 4413 4414 4415 4416 4417 4417 4418 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437
79 4 4 31 32 33 46 48 55 58 58 59 114 120 133 144 162 182 182 217 228 235 247 249 249 287 304 345 366 366 370 381 395 408 424 426 439 442 502 504 558 568 625 637 653 653 667 668 755 755 784 810 858 858 901 954 954 954 964 974 989 1027 1049 1063 1087 1087 1120 1214 1241 1241 1303 1406 1451 1462 1501 1501 1501 1678 1678 1718 1809 1880 1888 1889 1901 1972 2014 2070 2293 2360 2372 2494 2501 2578 2591 2615 2615 2617 2617 2617 2633 2661 2665 2678 2679 2691 2711 2713 2734 2757 2758 2759 2759 2760 2762 2767 2768 2770 2771 2775 2780 2784 2941 3018 3063 3071 3075 3075 3079 3313 3426 3464 3676 3731 3835 4287 4383 4396 4402 4420 4423 4428 4434 4434 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475
80 32 33 58 72 79 179 202 207 217 304 304 338 366 381 395 498 553 553 553 576 591 623 674 694 782 810 845 857 918 1087 1120 1120 1157 1229 1241 1241 1339 1511 1660 1704 1829 2117 2269 2533 2617 2661 2665 2665 2711 2759 2767 2768 2780 2784 2816 2847 2941 3005 3251 3464 4290 4387 4390 4390 4395 4418 4422 4427 4427 4457 4462 4462 4463 4464 4466 4470 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521
81 3 4 4 5 7 9 11 12 19 23 29 32 33 35 35 36 39 43 45 48 48 49 51 52 55 56 57 58 58 59 60 61 63 64 65 67 68 70 72 72 72 72 72 73 73 76 77 80 82 83 84 84 84 84 85 85 88 92 94 96 97 98 98 99 101 103 133 141 141 153 156 157 157 157 165 167 169 178 179 183 186 188 189 189 198 199 204 205 217 217 217 218 218 227 239 249 256 277 278 289 290 301 354 358 366 368 370 370 371 371 376 395 407 415 424 430 536 553 614 623 625 636 784 965 1030 1195 1241 1465 1526 1575 1617 1673 1673 1679 1953 2030 2223 2480 2812 2836 2841 2853 2853 2856 2879 2918 2957 3006 3146 3205 3326 3676 3676 3676 3707 4391 4489 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4561 4562
82 5 7 12 21 24 29 32 44 49 49 52 52 55 56 58 58 58 60 65 68 73 73 97 99 103 113 115 126 126 131 136 136 136 136 141 142 143 147 147 148 150 151 154 158 165 165 167 179 179 182 182 186 188 189 192 197 199 231 232 235 240 249 255 260 268 268 268 270 271 274 275 276 278 280 287 289 289 290 291 295 301 304 305 307 320 320 320 320 370 372 403 404 407 415 454 502 784 786 842 959 964 964 964 965 965 1030 1088 1200 1219 1223 1352 1390 1501 1868 2113 2159 2409 2447 2480 2483 2552 2624 2624 2690 2845 2846 2848 2869 2878 2903 2907 2914 2917 2918 2924 2948 2957 2957 2957 2968 2973 2990 3030 3045 3047 3194 3197 3667 3835 3890 3921 4115 4429 4489 4524 4529 4529 4535 4538 4541 4544 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601
83 5 19 23 28 31 32 32 42 48 49 52 73 73 96 97 103 105 135 141 142 143 162 167 179 207 218 227 232 235 244 246 250 255 257 261 262 268 273 274 275 276 277 280 282 283 284 289 290 292 295 297 304 331 340 354 358 371 371 376 388 390 395 395 398 403 404 407 407 414 417 450 553 699 702 816 816 829 868 955 1102 1102 1241 1323 1388 1528 1874 1874 2243 2430 2619 2756 2758 2848 2848 2856 2893 2898 2901 2903 2911 2914 2915 2917 2918 2941 2946 2962 2965 2997 3002 3030 3045 3282 3284 3356 3968 4280 4345 4529 4546 4582 4582 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626
84 4 4 4 21 22 22 24 71 73 103 103 124 124 130 136 143 162 165 178 202 217 218 232 243 246 247 249 255 271 271 276 276 286 289 290 296 311 315 320 328 328 335 337 338 340 340 342 354 358 381 381 389 390 395 399 399 403 404 407 409 414 417 434 439 442 451 453 454 457 504 553 568 607 653 842 959 1097 1155 1219 1223 1241 1342 1351 1395 1406 1675 1681 1742 1792 2215 2341 2469 2806 2848 2903 2903 2914 2931 2934 2965 2991 2991 3045 3047 3186 3194 3290 3890 3928 4411 4569 4601 4605 4615 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648
+4
View File
@@ -0,0 +1,4 @@
This directory contains some basic concepts on Bayes filtering.
Main scripts :
RecursivesBayes.m
RecursivesBayesAvpd.m
+187
View File
@@ -0,0 +1,187 @@
%%%%%%%%%%%%%%%%%%
%Example of the recursive Bayes filtering
%In this example, the memory is fixed (each new signatures aren't added to
%the memory after each iteration). The likelihood is also predefined to see
%the effect of the filter.
%%%%%%%%%%%%%%%%%%
close all
clear all
%%%%%%%%%%%%
%User inputs
%%%%%%%%%%%%
stepByStep = 0; %If we want a pause after each iteration (1) otherwise batch mode (0)
usePrefinedGaussians = 0;
loopThreshold = 0.3;
%%%%%%%%%%%%
%Based on the very simple example on discrete recursive Bayes filter found
%in the green book p. 543
%(Russel and Norvig : Artificial Intelligence - A Modern Approach)
m = 11; %image counts in the working memory (virtual place included)
nIter = 10; %iterations
virtualPlacePrior = 0.8;
% likelihood = rand(nIter,m);
likelihood = [0.537812527177546,0.973823826601782,0.679517492334616,0.511334385523834,0.133172784517682,0.616295123827850,0.333032553637148,0.0931269898117809,0.834956800914038,0.789846368465099,0.966949104425550,0.646502710583242;0.134060600345818,0.764640454269780,0.704121891203037,0.914142330394849,0.295008954572581,0.669364170554407,0.413416552284401,0.319027136248953,0.325143400597060,0.913520615552384,0.208804360594363,0.128169077499018;0.540947224212142,0.243683930209342,0.460884056746050,0.0919339388425310,0.166627082935154,0.0372015327510951,0.414348152562633,0.886961614706448,0.367639299837922,0.533254359985603,0.520476252773875,0.0813205028568441;0.857368192475905,1,2,8,2,1,0.414348152562633,0.413416552284401,0.794839466004007,0.804076444490502,0.225546129397670,0.659227054221110;0.198017363329941,0.137854510225166,1,2,8,2,1,0.414348152562633,0.0993087162421777,0.562660356611037,0.567197873830803,0.0273988510815916;0.155609101290637,0.629811667025549,0.0762044335388465,1,2,8,2,1,0.414348152562633,0.750876451961769,0.998163526074098,0.985179800828888;0.0613777678138677,0.857014692659853,0.444624971046257,0.785375111038118,1,2,8,2,1,0.414348152562633,0.131865336731199,0.539330947126751;0.661073988932246,0.899798333270360,0.165706296551124,0.602400257965727,0.218271272437479,1,2,8,2,1,0.414348152562633,0.373834916709097;0.0186026419313314,0.348368402231864,0.398748973477181,0.465908353449366,0.706077628393318,0.522221302087482,1,2,8,2,1,0.414348152562633;0.291102936564625,0.486310193286963,0.920584670910461,0.298131346189007,0.0390136924156214,0.567617714955188,0.901802906347484,1,2,8,2,1;];
likelihoodNormalized = ones(nIter,m+1);
%Initialize the prediction matrix
%first row is for the virtual place (loop closure)
%next rows are for each already visited place
prediction = zeros(m+1,m+1);
%Gaussians...
if(usePrefinedGaussians == 0)
%A-Create prediction with two gaussians
x = 1:1:m;
for i=1:m
y1 = gaussmf(x, [0.8 i-1]);
y2 = gaussmf(x, [0.8 i+1]);
y = y1+y2;
y = (y / sum(y));
prediction(i+1,:) = [0.1 y];
%normalize
prediction(i+1,:) = prediction(i+1,:) / sum(prediction(i+1,:));
end
prediction(1,:) = [virtualPlacePrior ones(1,m)*0.1/(m)];
%Example
x=1:1:9;
y=gaussmf(x,[0.8 4])+gaussmf(x,[0.8 6]);
y=y/sum(y);
y=[0.1 y];
y=y/sum(y);
figure(1);
plot([-1 x],y)
title(['Example of the prediction (two gaussians) for the loop closure event at 5' char(10) '(we suppose that it''s more probable to be in the next/previous place) after a loop closure.' char(10) 'Id -1 means a new place.'])
else
%B-Create prediction using predefined values (representing approximativaly
%a sum of gaussian curves)
%(like implemented in c++, AvpdCore::BayesFilter::generatePrediction())
%Format of predictionLC = {virtualPlace LoopCLosure neighbor-1 neighbor+1 neighbor-2 neighbor+2...}
predictionLC = [0.1 0.175 0.1 0.275 0.05 0.15 0.025 0.025]; %Forward probabilities
% predictionLC = [0.1 0.19 0.24 0.24 0.1 0.1 0.01 0.01]; %equal backward/forward
prediction = generatePrediction(virtualPlacePrior, predictionLC, m);
%Example
x=1:1:9;
smallValue = (1-sum(predictionLC)) / length(x-5);
y = [predictionLC(1) smallValue predictionLC(7) predictionLC(5) predictionLC(3) predictionLC(2) predictionLC(4) predictionLC(6) predictionLC(8) smallValue];
y=y/sum(y);
figure(1);
plot([-1 x],y)
title(['Example of the prediction (predefined pdf) for the loop closure event at 5' char(10) '(we suppose that it''s more probable to be in the next and/or previous place) after a loop closure.' char(10) 'Id -1 means a new place.'])
end
%Initialize the prior with "no loop closure event"
prior = zeros(nIter+1, m+1);
prior(1,:) = prediction(1,:);
figure(2)
subplot(211)
imagesc(prediction)
title('prediction matrix (m+1 x m+1 where m is the number of images + 1 virtual place)')
subplot(212)
imagesc(prediction')
title('prediction^T')
statusLoop = zeros(1,nIter);
loopClosureId = 0;
for iter=1:nIter
%reset loopClosureId
loopClosureId = 0;
%Adjust likelihood
likelihoodNormalized(iter,:) = adjustLikelihood(likelihood(iter,:));
%posterior = n * likelihood * (prediction x prior)
% Note the transposed prediction'
prior(iter+1,:) = likelihoodNormalized(iter,:) .* (prediction' * prior(iter,:)')';
%normalize
prior(iter+1,:) = prior(iter+1,:) / sum(prior(iter+1,:));
% Loop closure ?
maxLoopProb = 0;
for i=2:m+1
if prior(iter+1,i) > maxLoopProb
if i >= 3 && i <= m
if prior(iter+1,i-1)+prior(iter+1,i)+prior(iter+1,i+1) > loopThreshold
loopClosureId = i-1;
maxLoopProb = prior(iter+1,i);
end
elseif i == 2
if prior(iter+1,i) + prior(iter+1,i+1) > loopThreshold
loopClosureId = i-1;
maxLoopProb = prior(iter+1,i);
end
else
if prior(iter+1,i-1) + prior(iter+1,i) > loopThreshold
loopClosureId = i-1;
maxLoopProb = prior(iter+1,i);
end
end
end
end
statusLoop(iter) = loopClosureId;
figure(3)
plot(statusLoop(1:iter), 'o');
title(['Loop closure (image id)(iteration ' num2str(iter) ')'])
xlabel('Iteration')
ylabel('Loop closure id')
figure(4)
subplot(411)
plot(prior(iter,:)');
title(['prior (iteration ' num2str(iter) ')'])
subplot(412)
plot((prediction' * prior(iter,:)')');
title('prediction^T x prior')
subplot(413)
plot(likelihoodNormalized(iter,:));
title('likelihoodNormalized')
subplot(414)
plot(prior(iter+1,:));
title('posterior = n * likelihood * (prediction^T x prior)')
if(stepByStep ~=0)
disp('Press any key to continue...')
pause
end
end
figure(5)
subplot(3,1,1)
plot(likelihood');
title('likelihood')
subplot(3,1,2)
plot(likelihoodNormalized');
title('likelihoodNormalized')
subplot(3,1,3)
plot(prior');
title('posterior')
%% We simulate here when the neighbors of id=4 don't exist...
% On loop closure, the pdf is {1 ... 1 2 3 5 3 1...} where the
% first 3 is the center... (its a forward probability)
% No loop closure, the pdf is {10 1 1 1 1 1 1....}
figure(6)
tmp=[10,1,1,1,1,1,1,1,1,1,1;
1,6,5,4,0,0,0,0,0,0,0;
1,3,3,9,0,0,0,0,0,0,0;
1,1,2,12,0,0,0,0,0,0,0;
1,0,0,0,15,0,0,0,0,0,0;
1,0,0,0,0,6,5,3,1,0,0;
1,0,0,0,0,3,3,5,3,1,0;
1,0,0,0,0,1,2,3,5,3,1;];
subplot(211)
imagesc(tmp)
title('Example of the effect of forgotten neighbors (around 5) on a prediction matrix')
subplot(212)
imagesc(tmp')
title('prediction^T')
+121
View File
@@ -0,0 +1,121 @@
%%%%%%%%%%%%%%%%%%%%%%%%
%In this example, we show how the resursive Bayes filtering works in RTAB-Map
%(Already Visited Place Detector). We load real data from an experiment on
%the 090206-3 dataset (in bin/data/090206-3). This example doesn't
%show the "forgotten" skill of the real algorithm implemented in RTAB-Map, so
%it doesn't show how probabilities are managed when a signature is
%forgotten. The links (parent, loop) between signatures are not shown.
%
%You can use the same script for your data. Just have the same format than
%the one used in the data text files. An other way is to use the RTAB-Map Gui,
%it provides an option to dump the working memory (Edit->Dump memory)
%directly.
%%%%%%%%%%%%%%%%%%%%%%%%
close all
clear all
%%%%%%%%%%%%
%User inputs
%%%%%%%%%%%%
stepByStep = 0; %If we want a pause after each iteration (1) otherwise batch mode (0)
plotPriorAfterEachIter = 1;
loopThreshold = 0.3;
predictionNP = 0.8; % prediction for "New place event"
predictionLC = [0.1 0.175 0.1 0.275 0.05 0.15 0.025 0.025]; % prediction pattern for "Loop closure event"
%%%%%%%%%%%%
% load data
signRef = dlmread('DumpMemorySign.txt', ' ', 1, 0);
%ignore the virtual place, it will be generated afer each iteration
signRef = signRef(2:end,:); %preallocation
nIter = size(signRef,1);
% Initialize the prior
prior = cell(nIter,1); %preallocation
% Initialize the memory, contains only a virtual place null
memory = zeros(nIter+1,size(signRef,2)); %preallocation
memory(1,1) = -1; %id virtual place
dictionary = [];
timeUpdateDictionary = zeros(nIter,1); %seconds
timeUpdateCommonSignature = zeros(nIter,1); %seconds
timeGetLikelihood = zeros(nIter,1); %seconds
timeAdjustLikelihood = zeros(nIter,1); %seconds
timeGeneratePrediction = zeros(nIter,1); %seconds
timeUpdatePrior = zeros(nIter,1); %seconds
% Recursive Bayes estimation
for iter=1:nIter
% Signature creation
newSign = signRef(iter,:); %[id wordIds...]
t = cputime;
dictionary = updateDictionary(dictionary, newSign);
timeUpdateDictionary(iter) = cputime - t;
t = cputime;
% add to memory
memory(iter+1, :) = newSign;
% Update virtual place
[memory(1,:) dictionary] = updateCommonSignature(memory(1:iter+1,:), dictionary);
timeUpdateCommonSignature(iter) = cputime - t;
t = cputime;
% Compute the likelihood
likelihood = computeLikelihood(memory(iter+1,:), memory(1:iter+1,:), dictionary);
%ignore the last (current signature)
likelihood = likelihood(1:end-1);
timeGetLikelihood(iter) = cputime - t;
t = cputime;
% normalize the likelihood with std dev and mean
likelihoodNormalized = adjustLikelihood(likelihood);
timeAdjustLikelihood(iter) = cputime - t;
t = cputime;
% generate prediction
prediction = generatePrediction(predictionNP, predictionLC, length(likelihood)-1);
timeGeneratePrediction(iter) = cputime - t;
t = cputime;
% update the prior (recursive Bayes estimation equation)
if iter == 1
prior{iter} = 1; % 100% probability to be in a new place
else
prior{iter} = [prior{iter-1};0];
end
prior{iter} = likelihoodNormalized .* (prediction' * prior{iter});
prior{iter} = prior{iter}/sum(prior{iter}); %Normalize
timeUpdatePrior(iter) = cputime - t;
t = cputime;
if plotPriorAfterEachIter || iter == nIter
figure(1)
hold off
x = -1;
if length(prior{iter}) > 1
x = [x 1:length(prior{iter})-1];
end
plot(x, prior{iter});
axis([x(1) x(end)+6 0 1])
hold on
plot(x, ones(size(x))*loopThreshold, 'r')
title(['Prior pdf (iteration ' num2str(iter) '/' num2str(nIter) ')'])
legend('pdf', 'loop closure threshold')
end
clc
disp(['(iteration ' num2str(iter) '/' num2str(nIter) ')'])
if stepByStep ~= 0 && iter ~= nIter
disp('Press any key to continue...')
pause
end
end
figure(2)
plot([timeUpdateDictionary timeUpdateCommonSignature timeGetLikelihood timeAdjustLikelihood timeGeneratePrediction timeUpdatePrior])
title('Timings (seconds)')
legend('timeUpdateDictionary', 'timeUpdateCommonSignature', 'timeGetLikelihood', 'timeAdjustLikelihood', 'timeGeneratePrediction', 'timeUpdatePrior')
+340
View File
@@ -0,0 +1,340 @@
%---------------------------------------------------------
% MatLab script.
% This shows some informations logged by the application.
% This script may work directly with octave.
%---------------------------------------------------------
% Just put along LogF.txt and LogI.txt files generated
% (look in the application working directory).
% The files must have the same number of lines.
%
% Dependency : importfile.m
%---------------------------------------------------------
%--------------------
% Parameters
%--------------------
close all
clear all
Prefix = '.';
%Prefix = './Results';
DataSet = '';
%DataSet = 'NewCollege';
%DataSet = 'CityCentre';
%DataSet = 'Lip6Indoor';
%DataSet = 'Lip6Outdoor';
%DataSet = 'Lip6Outdoor_1Hz';
%DataSet = 'UdeS_1Hz';
% The Ground Truth is a squared bmp file (size must match the log files
% length) where white dots mean loop closures.
% Grey dots mean 'loop closures to ignore', this happens when the rehearsal
% doesn't match consecutive images together.
PrefixGT = '.';
%PrefixGT = './GT';
GroundTruthFile = [PrefixGT '/' '090206-3_GT.bmp'];
%GroundTruthFile = [PrefixGT '/' DataSet '.bmp'];
%---------------------------------------------------------
display(' ');
display('Loading log files...');
importfile([Prefix '/' DataSet '/' 'LogF.txt']);
% COLUMN HEADERS :
% 1 totalTime
% 2 timeMemoryUpdate,
% 3 timeReactivations,
% 4 timeLikelihoodCalculation,
% 5 timePosteriorCalculation,
% 6 timeHypothesesCreation,
% 7 timeHypothesesValidation,
% 8 timeRealTimeLimitReachedProcess,
% 9 timeStatsCreation
% 10 highestHypothesisValue
% 11 vpLikelihood
% 12 maxLikelihood
% 13 sumLikelihoods
% 14 mean likelihood
% 15 stddev likelihood
importfile([Prefix '/' DataSet '/' 'LogI.txt']);
% COLUMN HEADERS :
% 1 lcHypothesisId,
% 2 mostLikelihoodId,
% 3 signaturesRemoved,
% 4 hessianThr,
% 5 wordsNewSign,
% 6 dictionarySize,
% 7 this->getSTMem().size(),
% 8 rejectLoopReason,
% 9 processMemoryUsed,
% 10 databaseMemoryUsed
% 11 signaturesReactivated
% 12 lcHypothesisReactivated
% 13 refUniqueWordsCount
% 14 reactivateId
% 15 non nulls count
startAt = 1;
% endAt = 1175;
endAt = length(LogF(:,1));
figure
H1 = plot(LogF(startAt:endAt,1)*1000);
hold on
% H2 = plot(1:length(LogF(startAt:endAt,1)), ones(length(LogF(startAt:endAt,1)),1).*mean(LogF(startAt:endAt,1))*1000, 'r-')
%title('Total process time / Location')
ylabel('Time (ms)')
xlabel('Location indexes')
meanTime = mean(LogF(startAt:endAt,1))*1000
%plot([1 length(LogF(:,1))], [800 800], 'r')
%plot([1 length(LogF(:,1))], [1000 1000], 'k')
% -------------------------
% Time details
figure
subplot(7,1,1)
plot(LogF(startAt:endAt,2)*1000)
title('timeMemoryUpdate (ms)')
subplot(7,1,2)
plot(LogF(startAt:endAt,3)*1000)
title('timeReactivations (ms)')
subplot(7,1,3)
plot(LogF(startAt:endAt,4)*1000)
title('timeLikelihoodCalculation (ms)')
subplot(7,1,4)
plot(LogF(startAt:endAt,5)*1000)
title('timePosteriorCalculation (ms)')
subplot(7,1,5)
plot(LogF(startAt:endAt,6)*1000)
title('timeHypothesesCreation (ms)')
subplot(7,1,6)
plot(LogF(startAt:endAt,7)*1000)
title('timeHypothesesValidation (ms)')
subplot(7,1,7)
plot(LogF(startAt:endAt,8)*1000)
title('timeStatsCreation (ms)')
% -------------------------
figure
plot([LogF(startAt:endAt,2) sum(LogF(startAt:endAt,2:3),2) sum(LogF(startAt:endAt,2:4),2) sum(LogF(startAt:endAt,2:5),2) sum(LogF(startAt:endAt,2:6),2) sum(LogF(startAt:endAt,2:7),2) sum(LogF(startAt:endAt,2:8),2)]);
legend('timeMemoryUpdate', 'timeReactivations', 'timeLikelihoodCalculation', 'timePosteriorCalculation', 'timeHypothesesCreation', 'timeHypothesesValidation', 'timeRealTimeLimitReachedProcess', 'timeStatsCreation')
title('Process time details')
figure
subplot(211)
plot(LogF(startAt:endAt,3));
title('Reactivation time')
subplot(212)
plot(LogI(:,11),'.')
% -------------------------
figure
subplot(211)
plot(LogI(startAt:endAt, 6));
title('dictionary size')
subplot(212)
plot([LogI(startAt:endAt, 9)/1000000 LogI(startAt:endAt, 10)/1000000]);
title('Memory usage (in MB)')
legend('Process', 'Database')
% -------------------------
figure
% subplot(211)
H1 = plot(LogI(startAt:endAt,7));
% hold on
% H2 = plot(1:length(LogI(startAt:endAt,7)), ones(length(LogI(startAt:endAt,7)),1).*mean(LogI(startAt:endAt,7)), 'r--')
%title('Working memory size')
meanWM = mean(LogI(startAt:endAt,7))
ylabel('WM size (locations)')
xlabel('Location indexes')
% set(H1,'color',[0.3 0.3 0.3])
% set(H2,'color',[0 0 0])
% subplot(212)
% plot(LogI(startAt:endAt,6));
meanDict = mean(LogI(startAt:endAt,6))
% ylabel('Dictionary size')
% xlabel('Location indexes')
meanWordsPerSign = mean(LogI(startAt:endAt,5))
% -------------------------
% Detected/Accepted/Rejected loop closures
% from VerifyEpipolarGeometry.h
% UNDEFINED, 10
% ACCEPTED, 11
% NO_HYPOTHESIS, 12
% MEMORY_IS_NULL, 13
% NOT_ENOUGH_MATCHING_PAIRS, 14
% EPIPOLAR_CONSTRAINT_FAILED, 15
% NULL_MATCHING_SURF_SIGNATURES 16
figure;
subplot(311)
plot(LogF(:,10), '.')
title('Highest posterior + lc accepted and rejected')
hold on
%rejected hypotheses
y = LogF(:,10);
x = 1:length(y);
y(LogI(startAt:endAt, 8) >= 10 & LogI(startAt:endAt, 8) <= 11) = [];
x(LogI(startAt:endAt, 8) >= 10 & LogI(startAt:endAt, 8) <= 11) = [];
plot(x,y, 'r.')
%rejected (by ratio) hypotheses
y = LogF(:,10);
x = 1:length(y);
y(LogI(startAt:endAt, 8) ~= 3) = [];
x(LogI(startAt:endAt, 8) ~= 3) = [];
plot(x,y, 'b.')
%Accepted hypotheses
y = LogF(:,10);
x = 1:length(y);
y(LogI(startAt:endAt, 8) < 10 | LogI(startAt:endAt, 8) > 11) = [];
x(LogI(startAt:endAt, 8) < 10 | LogI(startAt:endAt, 8) > 11) = [];
plot(x,y, 'g.')
subplot(312)
plot(LogI(:,2), '.')
title('Id corresponding to highest posterior + lc accepted and rejected')
hold on
%rejected hypotheses
y = LogI(:,2);
x = 1:length(y);
y(LogI(startAt:endAt, 8) >= 10 & LogI(startAt:endAt, 8) <= 11) = [];
x(LogI(startAt:endAt, 8) >= 10 & LogI(startAt:endAt, 8) <= 11) = [];
plot(x,y, 'r.')
%rejected (by ratio) hypotheses
y = LogI(:,2);
x = 1:length(y);
y(LogI(startAt:endAt, 8) ~= 3) = [];
x(LogI(startAt:endAt, 8) ~= 3) = [];
plot(x,y, 'b.')
%Accepted hypotheses
y = LogI(:,2);
x = 1:length(y);
y(LogI(startAt:endAt, 8) < 10 | LogI(startAt:endAt, 8) > 11) = [];
x(LogI(startAt:endAt, 8) < 10 | LogI(startAt:endAt, 8) > 11) = [];
plot(x,y, 'g.')
subplot(313)
plot(LogI(:,5),'.')
title('wordsNewSign')
hold on
%rejected hypotheses
y = LogI(:,5);
x = 1:length(y);
y(LogI(startAt:endAt, 8) >= 10 & LogI(startAt:endAt, 8) <= 11) = [];
x(LogI(startAt:endAt, 8) >= 10 & LogI(startAt:endAt, 8) <= 11) = [];
plot(x,y, 'r.')
%rejected (by ratio) hypotheses
y = LogI(:,5);
x = 1:length(y);
y(LogI(startAt:endAt, 8) ~= 3) = [];
x(LogI(startAt:endAt, 8) ~= 3) = [];
plot(x,y, 'b.')
%Accepted hypotheses
y = LogI(:,5);
x = 1:length(y);
y(LogI(startAt:endAt, 8) < 10 | LogI(startAt:endAt, 8) > 11) = [];
x(LogI(startAt:endAt, 8) < 10 | LogI(startAt:endAt, 8) > 11) = [];
plot(x,y, 'g.')
% %matched sign words
% y = LogI(:,2);
% x = 1:length(y);
% mask = zeros(1,length(y));
% y(LogI(startAt:endAt, 8) ~= 11) = [];
% for i=1:length(y)
% mask(y(i)) = 1;
% end
% y = LogI(:,5);
% y(~mask) = [];
% x(~mask) = [];
% plot(x,y, 'c.')
% %matched sign words for rejected
% y = LogI(:,2);
% x = 1:length(y);
% mask = zeros(1,length(y));
% y(LogI(startAt:endAt, 8) < 12) = [];
% for i=1:length(y)
% mask(y(i)) = 1;
% end
% y = LogI(:,5);
% y(~mask) = [];
% x(~mask) = [];
% plot(x,y, 'm.')
lcAccepted = sum(LogI(startAt:endAt, 8) >= 10 & LogI(startAt:endAt, 8) <= 11)
lcReactivated = sum(LogI(startAt:endAt, 12) == 1)
lcRejected = sum(LogI(startAt:endAt, 8) > 11 | LogI(startAt:endAt, 8) == 3)
lcRejectedNotEnoughPairs = sum(LogI(startAt:endAt, 8) == 14)
lcRejectedEpipolarGeo = sum(LogI(startAt:endAt, 8) > 14)
%figure;
%plot([1.0 * (LogI(startAt:endAt, 8) == 10) ...
% 1.01 * (LogI(startAt:endAt, 8) == 11) ...
% 1.02 * (LogI(startAt:endAt, 8) == 14) ...
% 1.03 * (LogI(startAt:endAt, 8) == 15)], '.');
%title('Reject loop reason')
%legend('UNDEFINED', 'ACCEPTED', 'NOT ENOUGH MATCHING PAIRS', 'EPIPOLAR CONSTRAINT FAILED')
% -----------------
% Squared matrix
%%
%Precision-Recall graph
GroundTruth = [];
if exist(GroundTruthFile, 'file')
PR = getPrecisionRecall(LogI, LogF, GroundTruthFile, 0.03);
Precision = PR(:,1);
Recall = PR(:,2);
PrecisionVerified = PR(:,3);
RecallVerified = PR(:,4);
%plot the Precision-Recall
figure
plot([Recall RecallVerified], [Precision PrecisionVerified])
legend('Without verification', 'With verification')
title('Precision - Recall')
xlabel('Recall (%)')
ylabel('Precision (%)')
end
%%
% count = 0;
% for i=2:length(LogF(:,10))
% if(LogF(i,10) > 0.45 && LogF(i,10) < LogF(i-1,10)*0.9)
% display(['i=' num2str(i) ' with=' num2str(LogI(i,2)) ' ratio=' num2str(LogF(i,10)/LogF(i-1,10))])
% count = count +1;
% end
% end
% count
%%
% figure
% hold on
% K=100;
% %plot(1./(K*LogF(:,15)), 'r')
% %plot(log10(1./(LogF(:,15))), 'c')
% scale=1;
% %plot(log10(1./(LogF(:,15))).^2 ./ ((LogF(:,12)-LogF(:,15))./LogF(:,14)), 'k')
% %plot(log10(1./(LogF(:,15))), 'm')
% plot((LogF(:,12)-LogF(:,15))./LogF(:,14), 'g')
% plot([0, length(LogF(:,15))], [1 1], 'k:')
% plot(LogF(:,11), 'b')
% %legend(['K=' num2str(K)], 'ln', 'ln scaled', 'log10', 'max sim', '1', 'Vp likelihood')
+109
View File
@@ -0,0 +1,109 @@
function [ PR ] = getPrecisionRecall( LogI, LogF, GT_file, LoopThr )
%GETPRECISIONRECALL Calculate the precision-recall results from the log
%files of RTAB-Map and a Ground Truth file (a bmp).
% PR(:,1) = Precision
% PR(:,2) = Recall
% PR(:,3) = Precision with verification
% PR(:,4) = Recall with verification
%
% LogI: The 'LogI.txt' generated file
% LogF: The 'LogF.txt' generated file
% GT_file: The related Ground truth file of the dataset ('GT.bmp')
% LoopThr: Display false positives over the loop thr (>=0.0 && < 1.0)
GroundTruth = [];
if exist(GT_file, 'file')
display('--- getPrecisionRecall ---');
display(['Loading GroundTruth ''' GT_file ''' ...']);
GroundTruth = imread(GT_file);
else
error(['The ground truth ''' GT_file '''doesn''t exist.'])
end
if ~isempty(GroundTruth)
%display('Calculating Precision-Recall graph')
%figure
%imshow(GroundTruth)
%title('GroundTruth')
if size(GroundTruth, 1) ~= length(LogF(:,1)) || size(GroundTruth, 1) ~= length(LogI(:,1))
error(['The ground truth size doesn''t match the log files (LogI=' num2str(length(LogI(:,1))) ', LogF=' num2str(length(LogF(:,1))) ', GT=' num2str(size(GroundTruth, 1)) ')'])
end
%[highestHypot, CorrespondingID, GT, Accepted, Good, Index, UnderLoopRatio] descending order
lc = [LogF(:,10) LogI(:,2) sum(GroundTruth == 255, 2)>0 (LogI(:, 8) == 10 | LogI(:, 8) == 11) zeros(length(LogI(:,1)),1) (1:length(LogF(:,10)))' LogI(:, 8) == 3];
%eliminate loops on diagonal
ignored = 0;
for i=1:length(lc)
index = find(GroundTruth(:,i) > 0 & GroundTruth(:,i) < 255);
if ~isempty(index)
row = GroundTruth(index(1), :);
if lc(i,2) >= min(index) && lc(i,2) <= max(index)
display(['i=' NUM2STR(i) ' loop=' NUM2STR(LogI(i,2)) ' min(index)=' NUM2STR(min(index)) ' max(index)' NUM2STR(max(index))])
lc(i,1) = 0;
ignored = ignored + 1;
end
end
end
lc = sortrows(lc, -1);
GT_total_positives = sum(sum(GroundTruth == 255, 2) > 0)
%figure
%plot(sum(GroundTruth > 0, 2)>0)
%title('Ground truth (timeline)')
sizeNonZero = sum(lc(:,1) > 0);
PR = zeros(sizeNonZero, 4);
for i=1:length(lc)
if lc(i,1) == 0
break;
end
id = lc(i,2);
if id && sum(GroundTruth(lc(i,6), id)) > 0
lc(i,5) = 1;
end
PR(i,2) = sum(lc(1:i,5) & ~lc(1:i,7) & lc(1:i,2))/GT_total_positives;
PR(i,1) = sum(lc(1:i,5) & ~lc(1:i,7) & lc(1:i,2)) / sum(~lc(1:i, 7) & lc(1:i,2));
%PR(i,2) = sum(lc(1:i,5))/GT_total_positives;
%PR(i,1) = sum(lc(1:i,5)) / i;
PR(i,4) = sum(lc(1:i,4) & lc(1:i,5))/GT_total_positives;
PR(i,3) = sum(lc(1:i,4) & lc(1:i,5)) / sum(lc(1:i,4));
if ~lc(i,5) && ~lc(i,7) && id && lc(i,1) >= LoopThr
display(['False positive! id=' num2str(lc(i,6)) ' with old=' num2str(id) ' (p=' num2str(lc(i,1)) ')'] )
end
if lc(i,4) ~= lc(i,5) && lc(i,4)
display(['False positive! (v) id=' num2str(lc(i,6)) ' with old=' num2str(id) ' (p=' num2str(lc(i,1)) ')'] )
end
end
index = find(PR(:,1) == 1);
if ~isempty(index)
maxRecall = PR(index(end),2) * 100;
display(['Recall max (Precision=100%) = ' num2str(maxRecall) '% (p=' num2str(lc(index(end),1)) '), accepted=' num2str(sum(lc(1:index(end),5) & ~lc(1:index(end),7) & lc(1:index(end),2)))])
else
display('Recall max (Precision=100%) = 0')
end
indexV = find(PR(:,3) == 1);
if ~isempty(indexV)
maxRecallVerified = PR(indexV(end),4) * 100;
display(['Recall max (Precision=100%, with verification) = ' num2str(maxRecallVerified) '% (p=' num2str(lc(indexV(end),1)) ')'])
else
display('Recall max (Precision=100%, with verification) = 0')
end
display(['ignored = ' num2str(ignored)])
end
end
+22
View File
@@ -0,0 +1,22 @@
function importfile(fileToRead1)
%IMPORTFILE(FILETOREAD1)
% Imports data from the specified file
% FILETOREAD1: file to read
% Auto-generated by MATLAB on 07-Oct-2009 10:10:26
% Import the file
rawData1 = importdata(fileToRead1);
% For some simple files (such as a CSV or JPEG files), IMPORTDATA might
% return a simple array. If so, generate a structure so that the output
% matches that from the Import Wizard.
[unused,name] = fileparts(fileToRead1); %#ok
newData1.(genvarname(name)) = rawData1;
% Create new variables in the base workspace from those fields.
vars = fieldnames(newData1);
for i = 1:length(vars)
assignin('base', vars{i}, newData1.(vars{i}));
end
+17
View File
@@ -0,0 +1,17 @@
fprintf(_foutFloat, "%f %f %f %f %f %f %f %f %f\n",
totalTime,
timeMemoryUpdate,
timeReactivations,
timeLikelihoodCalculation,
timePosteriorCalculation,
timeHypothesesCreation,
timeHypothesesValidation,
timeRealTimeLimitReachedProcess,
timeStatsCreation);
fprintf(_foutInt, "%d %d %d %d\n",
lcHypothesisId,
mostLikelihoodId,
signaturesRemoved,
hessianThr,
wordsNewSign,
dictionarySize);

Some files were not shown because too many files have changed in this diff Show More