diff --git a/build/build.xml b/build/build.xml index 4d24615..0b5306e 100644 --- a/build/build.xml +++ b/build/build.xml @@ -18,6 +18,12 @@ + + + + + + @@ -26,6 +32,12 @@ - + + + + + + + diff --git a/build/vc80/turtle.sln b/build/vc80/turtle.sln index 32af7d8..05643b0 100644 --- a/build/vc80/turtle.sln +++ b/build/vc80/turtle.sln @@ -4,6 +4,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "turtle", "turtle.vcproj", " EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "turtle_test", "turtle_test.vcproj", "{74810A2A-33D8-47D6-9A50-71261F1683F5}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "turtle_bench", "turtle_bench.vcproj", "{2D607783-30B9-46DE-81E2-28513B31D5D2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution debug|Win32 = debug|Win32 @@ -18,6 +20,10 @@ Global {74810A2A-33D8-47D6-9A50-71261F1683F5}.debug|Win32.Build.0 = debug|Win32 {74810A2A-33D8-47D6-9A50-71261F1683F5}.release|Win32.ActiveCfg = release|Win32 {74810A2A-33D8-47D6-9A50-71261F1683F5}.release|Win32.Build.0 = release|Win32 + {2D607783-30B9-46DE-81E2-28513B31D5D2}.debug|Win32.ActiveCfg = debug|Win32 + {2D607783-30B9-46DE-81E2-28513B31D5D2}.debug|Win32.Build.0 = debug|Win32 + {2D607783-30B9-46DE-81E2-28513B31D5D2}.release|Win32.ActiveCfg = release|Win32 + {2D607783-30B9-46DE-81E2-28513B31D5D2}.release|Win32.Build.0 = release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/build/vc80/turtle_bench.vcproj b/build/vc80/turtle_bench.vcproj new file mode 100644 index 0000000..398a25c --- /dev/null +++ b/build/vc80/turtle_bench.vcproj @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/applications/turtle_bench/turtle_bench.cpp b/src/applications/turtle_bench/turtle_bench.cpp new file mode 100644 index 0000000..648072c --- /dev/null +++ b/src/applications/turtle_bench/turtle_bench.cpp @@ -0,0 +1,31 @@ +// +// Copyright Mathieu Champlon 2010 +// +// 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) +// + +#include +#include + +#define F(z, n, d) virtual void f##n() = 0; + +#define NUMBER_OF_METHODS 20 + +namespace +{ + class base_class + { + public: + virtual ~base_class() {} + BOOST_PP_REPEAT_FROM_TO(0, NUMBER_OF_METHODS, F, ) + }; +} + +#define BOOST_PP_FILENAME_1 "turtle_bench.hpp" +#define BOOST_PP_ITERATION_LIMITS (1, 10) +#include BOOST_PP_ITERATE() + +int main() +{} diff --git a/src/applications/turtle_bench/turtle_bench.hpp b/src/applications/turtle_bench/turtle_bench.hpp new file mode 100644 index 0000000..6ce53e8 --- /dev/null +++ b/src/applications/turtle_bench/turtle_bench.hpp @@ -0,0 +1,17 @@ +// +// Copyright Mathieu Champlon 2010 +// +// 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) +// + +//#pragma message( BOOST_PP_STRINGIZE( BOOST_PP_CAT( mock_class, BOOST_PP_ITERATION() ) ) ) + +#define MOCK_F(z, n, d) MOCK_METHOD( f##n, 0 ) +//#define MOCK_F(z, n, d) MOCK_METHOD_ALT( f##n ) + +MOCK_BASE_CLASS( BOOST_PP_CAT( mock_class, BOOST_PP_ITERATION() ), base_class ) +{ + BOOST_PP_REPEAT_FROM_TO(0, NUMBER_OF_METHODS, MOCK_F, ) +};