mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Added hippomocks_test
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@409 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
96ad4b068b
commit
d1a7049505
4 changed files with 6609 additions and 1 deletions
206
build/vc80/hippomocks_test.vcproj
Normal file
206
build/vc80/hippomocks_test.vcproj
Normal file
|
|
@ -0,0 +1,206 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="hippomocks_test"
|
||||
ProjectGUID="{ED2540E2-411B-4E25-95D2-5C8FA017B806}"
|
||||
RootNamespace="hippomocks_test"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="debug|Win32"
|
||||
OutputDirectory="../../out/vc80/$(ConfigurationName)/tests/$(ProjectName)"
|
||||
IntermediateDirectory="../../out/vc80/$(ConfigurationName)/tests/$(ProjectName)"
|
||||
ConfigurationType="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm172"
|
||||
Optimization="0"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../../src/libraries, ../../include"
|
||||
PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeTypeInfo="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough="$(ProjectName)_pch.h"
|
||||
PrecompiledHeaderFile="$(IntDir)/$(ProjectName).pch"
|
||||
AssemblerListingLocation="$(IntDir)/"
|
||||
ObjectFile="$(IntDir)/"
|
||||
ProgramDataBaseFileName="$(IntDir)/$(ProjectName).pdb"
|
||||
WarningLevel="4"
|
||||
SuppressStartupBanner="true"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Kernel32.lib"
|
||||
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||
AdditionalLibraryDirectories="../../lib/vc80"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="cd ../../run/vc80
"$(TargetDir)$(TargetName).exe" --result_code=no --report_level=no --log_level=warning
"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="release|Win32"
|
||||
OutputDirectory="../../out/vc80/$(ConfigurationName)/tests/$(ProjectName)"
|
||||
IntermediateDirectory="../../out/vc80/$(ConfigurationName)/tests/$(ProjectName)"
|
||||
ConfigurationType="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/Zm162"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="../../src/libraries, ../../include"
|
||||
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
|
||||
BasicRuntimeChecks="0"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeTypeInfo="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough="$(ProjectName)_pch.h"
|
||||
PrecompiledHeaderFile="$(IntDir)/$(ProjectName).pch"
|
||||
AssemblerListingLocation="$(IntDir)/"
|
||||
ObjectFile="$(IntDir)/"
|
||||
ProgramDataBaseFileName="$(IntDir)/$(ProjectName).pdb"
|
||||
WarningLevel="4"
|
||||
SuppressStartupBanner="true"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Kernel32.lib"
|
||||
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||
AdditionalLibraryDirectories="../../lib/vc80"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="cd ../../run/vc80
"$(TargetDir)$(TargetName).exe" --result_code=no --report_level=no --log_level=warning
"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx;h;hpp;hxx;hm;inl;inc;xsd"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\src\tests\hippomocks_test\hippomocks.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\tests\hippomocks_test\test.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual C++ Express 2005
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "turtle", "turtle.vcproj", "{831F2DEE-1E35-4533-A3B2-12C01BA8DA1D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "turtle_test", "turtle_test.vcproj", "{74810A2A-33D8-47D6-9A50-71261F1683F5}"
|
||||
|
|
@ -12,6 +12,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost_test", "boost_test.vc
|
|||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "errors_test", "errors_test.vcproj", "{231E907C-7B55-4128-B9EF-AB5B8042898D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hippomocks_test", "hippomocks_test.vcproj", "{ED2540E2-411B-4E25-95D2-5C8FA017B806}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
debug|Win32 = debug|Win32
|
||||
|
|
@ -42,6 +44,10 @@ Global
|
|||
{231E907C-7B55-4128-B9EF-AB5B8042898D}.debug|Win32.Build.0 = debug|Win32
|
||||
{231E907C-7B55-4128-B9EF-AB5B8042898D}.release|Win32.ActiveCfg = release|Win32
|
||||
{231E907C-7B55-4128-B9EF-AB5B8042898D}.release|Win32.Build.0 = release|Win32
|
||||
{ED2540E2-411B-4E25-95D2-5C8FA017B806}.debug|Win32.ActiveCfg = debug|Win32
|
||||
{ED2540E2-411B-4E25-95D2-5C8FA017B806}.debug|Win32.Build.0 = debug|Win32
|
||||
{ED2540E2-411B-4E25-95D2-5C8FA017B806}.release|Win32.ActiveCfg = release|Win32
|
||||
{ED2540E2-411B-4E25-95D2-5C8FA017B806}.release|Win32.Build.0 = release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
|||
6351
src/tests/hippomocks_test/hippomocks.h
Normal file
6351
src/tests/hippomocks_test/hippomocks.h
Normal file
File diff suppressed because it is too large
Load diff
45
src/tests/hippomocks_test/test.cpp
Normal file
45
src/tests/hippomocks_test/test.cpp
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
//
|
||||
// Copyright Mathieu Champlon 2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#define BOOST_AUTO_TEST_MAIN
|
||||
#include "hippomocks.h"
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
#define BOOST_LIB_NAME boost_unit_test_framework
|
||||
#include <boost/config/auto_link.hpp>
|
||||
|
||||
namespace
|
||||
{
|
||||
struct s
|
||||
{
|
||||
virtual void method( int ) {}
|
||||
};
|
||||
bool check( int )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( hmm )
|
||||
{
|
||||
MockRepository mocks;
|
||||
s* m = mocks.Mock< s >();
|
||||
mocks.ExpectCall( m, s::method ).Match( check );
|
||||
m->method( 7 );
|
||||
}
|
||||
|
||||
//namespace
|
||||
//{
|
||||
// void free_function() { std::cout << "ok" << std::endl; }
|
||||
//}
|
||||
//
|
||||
//BOOST_AUTO_TEST_CASE( hmm2 )
|
||||
//{
|
||||
// MockRepository mocks;
|
||||
// mocks.ExpectCallFunc( free_function );
|
||||
// free_function();
|
||||
//}
|
||||
Loading…
Add table
Add a link
Reference in a new issue