git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@437 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2012-04-01 21:20:23 +00:00
parent c1b3b1d4dd
commit 783d24a89f
69 changed files with 482 additions and 351 deletions

View file

@ -1,2 +1,2 @@
extensions = svn,headers extensions = svn,headers,check
platform = vc80 platform = vc80

View file

@ -95,6 +95,7 @@
<target name="reports" description="generate code analysis reports"> <target name="reports" description="generate code analysis reports">
<headers name="turtle"/> <headers name="turtle"/>
<check name="turtle"/>
</target> </target>
<target name="export" description="export distribution"> <target name="export" description="export distribution">

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_ACTION_HPP_INCLUDED #ifndef MOCK_ACTION_HPP_INCLUDED
#define MOCK_ACTION_HPP_INCLUDED #define MOCK_ACTION_HPP_INCLUDED
@ -162,7 +163,9 @@ namespace detail
{} {}
action( const action& rhs ) action( const action& rhs )
: r_( const_cast< action& >( rhs ).r_.release() ) : r_( const_cast< action& >( rhs ).r_.release() )
, f_( r_.get() ? lambda_type::make_val( boost::ref( r_ ) ) : rhs.f_ ) , f_( r_.get()
? lambda_type::make_val( boost::ref( r_ ) )
: rhs.f_ )
{} {}
template< typename Value > template< typename Value >

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2010 // Copyright Mathieu Champlon 2010
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_ARGS_HPP_INCLUDED #ifndef MOCK_ARGS_HPP_INCLUDED
#define MOCK_ARGS_HPP_INCLUDED #define MOCK_ARGS_HPP_INCLUDED
@ -50,7 +51,8 @@ namespace detail
} }
#define MOCK_ARG(N, n, S, tpn) \ #define MOCK_ARG(N, n, S, tpn) \
BOOST_PP_COMMA_IF(n) tpn mock::detail::arg< S, BOOST_PP_INC(n), N >::type p##n BOOST_PP_COMMA_IF(n) tpn \
mock::detail::arg< S, BOOST_PP_INC(n), N >::type p##n
#define MOCK_ARG_PROXY(z, n, d) \ #define MOCK_ARG_PROXY(z, n, d) \
MOCK_ARG( \ MOCK_ARG( \
BOOST_PP_ARRAY_ELEM(0, d), \ BOOST_PP_ARRAY_ELEM(0, d), \

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_BOOST_TEST_ERROR_POLICY_HPP_INCLUDED #ifndef MOCK_BOOST_TEST_ERROR_POLICY_HPP_INCLUDED
#define MOCK_BOOST_TEST_ERROR_POLICY_HPP_INCLUDED #define MOCK_BOOST_TEST_ERROR_POLICY_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_CHECK_HPP_INCLUDED #ifndef MOCK_CHECK_HPP_INCLUDED
#define MOCK_CHECK_HPP_INCLUDED #define MOCK_CHECK_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_CHILD_HPP_INCLUDED #ifndef MOCK_CHILD_HPP_INCLUDED
#define MOCK_CHILD_HPP_INCLUDED #define MOCK_CHILD_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_CLEANUP_HPP_INCLUDED #ifndef MOCK_CLEANUP_HPP_INCLUDED
#define MOCK_CLEANUP_HPP_INCLUDED #define MOCK_CLEANUP_HPP_INCLUDED
@ -24,7 +25,9 @@ namespace detail
{ {
~cleanup() ~cleanup()
{ {
//mock::verify(); // $$$$ MAT : because of a bug in Boost.Test this will crash if anything needs to be logged // $$$$ MAT : because of a bug in Boost.Test
// this will crash if anything needs to be logged
//mock::verify();
mock::reset(); mock::reset();
} }
}; };

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2009 // Copyright Mathieu Champlon 2009
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_CONFIG_HPP_INCLUDED #ifndef MOCK_CONFIG_HPP_INCLUDED
#define MOCK_CONFIG_HPP_INCLUDED #define MOCK_CONFIG_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_CONSTRAINT_HPP_INCLUDED #ifndef MOCK_CONSTRAINT_HPP_INCLUDED
#define MOCK_CONSTRAINT_HPP_INCLUDED #define MOCK_CONSTRAINT_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_CONSTRAINTS_HPP_INCLUDED #ifndef MOCK_CONSTRAINTS_HPP_INCLUDED
#define MOCK_CONSTRAINTS_HPP_INCLUDED #define MOCK_CONSTRAINTS_HPP_INCLUDED
@ -67,7 +68,8 @@ namespace mock
} \ } \
friend std::ostream& operator<<( std::ostream& s, const N& n ) \ friend std::ostream& operator<<( std::ostream& s, const N& n ) \
{ \ { \
return s << BOOST_STRINGIZE(N) << "( " << mock::format( n.expected_ ) << " )"; \ return s << BOOST_STRINGIZE(N) \
<< "( " << mock::format( n.expected_ ) << " )"; \
} \ } \
Expected expected_; \ Expected expected_; \
}; \ }; \
@ -186,7 +188,8 @@ namespace detail
{} {}
bool operator()( const std::string& actual ) const bool operator()( const std::string& actual ) const
{ {
return actual.find( boost::unwrap_ref( expected_ ) ) != std::string::npos; return actual.find( boost::unwrap_ref( expected_ ) )
!= std::string::npos;
} }
friend std::ostream& operator<<( std::ostream& s, const contain& n ) friend std::ostream& operator<<( std::ostream& s, const contain& n )
{ {

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_CONTEXT_HPP_INCLUDED #ifndef MOCK_CONTEXT_HPP_INCLUDED
#define MOCK_CONTEXT_HPP_INCLUDED #define MOCK_CONTEXT_HPP_INCLUDED
@ -34,7 +35,8 @@ namespace detail
virtual void add( verifiable& v ) = 0; virtual void add( verifiable& v ) = 0;
virtual void remove( verifiable& v ) = 0; virtual void remove( verifiable& v ) = 0;
virtual void serialize( std::ostream& s, const verifiable& v ) const = 0; virtual void serialize( std::ostream& s,
const verifiable& v ) const = 0;
}; };
} }
} }

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_DEFAULT_ERROR_POLICY_HPP_INCLUDED #ifndef MOCK_DEFAULT_ERROR_POLICY_HPP_INCLUDED
#define MOCK_DEFAULT_ERROR_POLICY_HPP_INCLUDED #define MOCK_DEFAULT_ERROR_POLICY_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_ERROR_HPP_INCLUDED #ifndef MOCK_ERROR_HPP_INCLUDED
#define MOCK_ERROR_HPP_INCLUDED #define MOCK_ERROR_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_EXPECTATION_HPP_INCLUDED #ifndef MOCK_EXPECTATION_HPP_INCLUDED
#define MOCK_EXPECTATION_HPP_INCLUDED #define MOCK_EXPECTATION_HPP_INCLUDED
@ -96,7 +97,9 @@ namespace detail
boost::shared_ptr< detail::invocation > i_; boost::shared_ptr< detail::invocation > i_;
private: private:
typedef std::vector< boost::shared_ptr< detail::sequence_impl > > sequences_type; typedef std::vector<
boost::shared_ptr< detail::sequence_impl >
> sequences_type;
typedef sequences_type::const_iterator sequences_cit; typedef sequences_type::const_iterator sequences_cit;
sequences_type sequences_; sequences_type sequences_;
@ -160,7 +163,8 @@ namespace detail
MOCK_EXPECTATION_METHODS MOCK_EXPECTATION_METHODS
friend std::ostream& operator<<( std::ostream& s, const expectation& m ) friend std::ostream& operator<<( std::ostream& s,
const expectation& m )
{ {
return s << (m.i_->exhausted() ? 'v' : '.') << ' ' << *m.i_; return s << (m.i_->exhausted() ? 'v' : '.') << ' ' << *m.i_;
} }
@ -173,23 +177,40 @@ namespace detail
boost::function_types::parameter_types< Signature >, \ boost::function_types::parameter_types< Signature >, \
n \ n \
>::type arg##n##_type; >::type arg##n##_type;
#define MOCK_EXPECTATION_CONSTRUCTOR(z, n, d) BOOST_PP_COMMA_IF(n) c##n##_( new detail::check< arg##n##_type, constraint< detail::any > >( mock::any ) ) #define MOCK_EXPECTATION_INITIALIZE(z, n, d) \
#define MOCK_EXPECTATION_WITH(z, n, d) c##n##_.reset( new detail::check< arg##n##_type, Constraint_##n >( c##n ) ); BOOST_PP_COMMA_IF(n) c##n##_( \
#define MOCK_EXPECTATION_MEMBER(z, n, d) boost::shared_ptr< detail::check_base< arg##n##_type > > c##n##_; new detail::check< \
#define MOCK_EXPECTATION_ARGS(z, n, d) BOOST_PP_COMMA_IF(n) arg##n##_type a##n arg##n##_type, \
#define MOCK_EXPECTATION_IS_VALID(z, n, d) && (*c##n##_)( a##n ) constraint< detail::any > \
#define MOCK_EXPECTATION_SERIALIZE(z, n, d) BOOST_PP_IF(n, << ", " <<,) *m.c##n##_ >( mock::any ) )
#define MOCK_EXPECTATION_WITH(z, n, d) \
c##n##_.reset( \
new detail::check< \
arg##n##_type, \
Constraint_##n \
>( c##n ) );
#define MOCK_EXPECTATION_MEMBER(z, n, d) \
boost::shared_ptr< detail::check_base< arg##n##_type > > c##n##_;
#define MOCK_EXPECTATION_ARGS(z, n, d) \
BOOST_PP_COMMA_IF(n) arg##n##_type a##n
#define MOCK_EXPECTATION_IS_VALID(z, n, d) \
&& (*c##n##_)( a##n )
#define MOCK_EXPECTATION_SERIALIZE(z, n, d) \
BOOST_PP_IF(n, << ", " <<,) *m.c##n##_
#define MOCK_EXPECTATION(z, n, d) \ #define MOCK_EXPECTATION(z, n, d) \
template< typename Signature > \ template< typename Signature > \
class expectation< Signature, n > \ class expectation< Signature, n > \
: public expectation_base \ : public expectation_base \
, public action< BOOST_DEDUCED_TYPENAME \ , public action< \
boost::function_types::result_type< Signature >::type, Signature > \ BOOST_DEDUCED_TYPENAME \
boost::function_types::result_type< Signature >::type, \
Signature \
> \
{ \ { \
BOOST_PP_REPEAT(n, MOCK_EXPECTATION_TYPEDEF, BOOST_PP_EMPTY) \ BOOST_PP_REPEAT(n, MOCK_EXPECTATION_TYPEDEF, BOOST_PP_EMPTY) \
public: \ public: \
expectation() \ expectation() \
: BOOST_PP_REPEAT(n, MOCK_EXPECTATION_CONSTRUCTOR, BOOST_PP_EMPTY) \ : BOOST_PP_REPEAT(n, MOCK_EXPECTATION_INITIALIZE, BOOST_PP_EMPTY) \
{} \ {} \
template< BOOST_PP_ENUM_PARAMS(n, typename Constraint_) > \ template< BOOST_PP_ENUM_PARAMS(n, typename Constraint_) > \
expectation& with( BOOST_PP_ENUM_BINARY_PARAMS(n, Constraint_, c) ) \ expectation& with( BOOST_PP_ENUM_BINARY_PARAMS(n, Constraint_, c) ) \
@ -197,27 +218,36 @@ namespace detail
BOOST_PP_REPEAT(n, MOCK_EXPECTATION_WITH, BOOST_PP_EMPTY) \ BOOST_PP_REPEAT(n, MOCK_EXPECTATION_WITH, BOOST_PP_EMPTY) \
return *this; \ return *this; \
} \ } \
bool is_valid( BOOST_PP_REPEAT(n, MOCK_EXPECTATION_ARGS, BOOST_PP_EMPTY) ) const \ bool is_valid( \
BOOST_PP_REPEAT(n, MOCK_EXPECTATION_ARGS, BOOST_PP_EMPTY) ) const \
{ \ { \
return ! i_->exhausted() \ return ! i_->exhausted() \
BOOST_PP_REPEAT(n, MOCK_EXPECTATION_IS_VALID, BOOST_PP_EMPTY); \ BOOST_PP_REPEAT(n, \
MOCK_EXPECTATION_IS_VALID, BOOST_PP_EMPTY); \
} \ } \
MOCK_EXPECTATION_METHODS \ MOCK_EXPECTATION_METHODS \
friend std::ostream& operator<<( std::ostream& s, const expectation& m ) \ friend std::ostream& operator<<( \
std::ostream& s, const expectation& m ) \
{ \ { \
return s << (m.i_->exhausted() ? 'v' : '.') << ' ' << *m.i_ << ".with( " \ return s << (m.i_->exhausted() ? 'v' : '.') \
<< \ << ' ' << *m.i_ << ".with( " \
BOOST_PP_REPEAT(n, MOCK_EXPECTATION_SERIALIZE, BOOST_PP_EMPTY) \ << BOOST_PP_REPEAT(n, \
MOCK_EXPECTATION_SERIALIZE, BOOST_PP_EMPTY) \
<< " )"; \ << " )"; \
} \ } \
private: \ private: \
BOOST_PP_REPEAT(n, MOCK_EXPECTATION_MEMBER, BOOST_PP_EMPTY) \ BOOST_PP_REPEAT(n, MOCK_EXPECTATION_MEMBER, BOOST_PP_EMPTY) \
}; };
BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(MOCK_MAX_ARGS), MOCK_EXPECTATION, BOOST_PP_EMPTY)
BOOST_PP_REPEAT_FROM_TO(
1,
BOOST_PP_INC(MOCK_MAX_ARGS),
MOCK_EXPECTATION,
BOOST_PP_EMPTY)
#undef MOCK_EXPECTATION_METHODS #undef MOCK_EXPECTATION_METHODS
#undef MOCK_EXPECTATION_TYPEDEF #undef MOCK_EXPECTATION_TYPEDEF
#undef MOCK_EXPECTATION_CONSTRUCTOR #undef MOCK_EXPECTATION_INITIALIZE
#undef MOCK_EXPECTATION_WITH #undef MOCK_EXPECTATION_WITH
#undef MOCK_EXPECTATION_MEMBER #undef MOCK_EXPECTATION_MEMBER
#undef MOCK_EXPECTATION_ARGS #undef MOCK_EXPECTATION_ARGS

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_FUNCTION_HPP_INCLUDED #ifndef MOCK_FUNCTION_HPP_INCLUDED
#define MOCK_FUNCTION_HPP_INCLUDED #define MOCK_FUNCTION_HPP_INCLUDED
@ -101,7 +102,13 @@ namespace mock
{ \ { \
return (*impl_)( BOOST_PP_ENUM_PARAMS(n, p) ); \ return (*impl_)( BOOST_PP_ENUM_PARAMS(n, p) ); \
} }
BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(MOCK_MAX_ARGS), MOCK_FUNCTION_OPERATOR, BOOST_PP_EMPTY)
BOOST_PP_REPEAT_FROM_TO(
1,
BOOST_PP_INC(MOCK_MAX_ARGS),
MOCK_FUNCTION_OPERATOR,
BOOST_PP_EMPTY)
#undef MOCK_FUNCTION_OPERATOR #undef MOCK_FUNCTION_OPERATOR
friend std::ostream& operator<<( std::ostream& s, const function& e ) friend std::ostream& operator<<( std::ostream& s, const function& e )
@ -201,40 +208,49 @@ namespace mock
} }
#define MOCK_FUNCTION_FORMAT(z, n, N) \ #define MOCK_FUNCTION_FORMAT(z, n, N) \
<< " " << mock::format( p##n ) << BOOST_PP_IF(BOOST_PP_EQUAL(N,n), " ", ",") << " " << mock::format( p##n ) \
#define MOCK_FUNCTION_CALL_CONTEXT(n) \ << BOOST_PP_IF(BOOST_PP_EQUAL(N,n), " ", ",")
#define MOCK_FUNCTION_CONTEXT(n) \
boost::unit_test::lazy_ostream::instance() \ boost::unit_test::lazy_ostream::instance() \
<< lazy_context( this ) \ << lazy_context( this ) \
<< "(" BOOST_PP_REPEAT(n, MOCK_FUNCTION_FORMAT, BOOST_PP_DEC(n)) << ")" \ << "(" BOOST_PP_REPEAT(n, MOCK_FUNCTION_FORMAT, BOOST_PP_DEC(n)) \
<< ")" \
<< lazy_expectations( this ) << lazy_expectations( this )
#define MOCK_FUNCTION_INVOKE(z, n, A) \ #define MOCK_FUNCTION_INVOKE(z, n, A) \
{ \ { \
valid_ = false; \ valid_ = false; \
for( expectations_cit it = expectations_.begin(); it != expectations_.end(); ++it ) \ for( expectations_cit it = expectations_.begin(); \
it != expectations_.end(); ++it ) \
if( it->is_valid( BOOST_PP_ENUM_PARAMS(n, p) ) ) \ if( it->is_valid( BOOST_PP_ENUM_PARAMS(n, p) ) ) \
{ \ { \
if( ! it->invoke() ) \ if( ! it->invoke() ) \
{ \ { \
error_type::sequence_failed( MOCK_FUNCTION_CALL_CONTEXT(n), it->file(), it->line() ); \ error_type::sequence_failed( \
MOCK_FUNCTION_CONTEXT(n), it->file(), it->line() ); \
return A; \ return A; \
} \ } \
if( ! it->functor() ) \ if( ! it->functor() ) \
{ \ { \
error_type::missing_action( MOCK_FUNCTION_CALL_CONTEXT(n), it->file(), it->line() ); \ error_type::missing_action( \
MOCK_FUNCTION_CONTEXT(n), it->file(), it->line() ); \
return A; \ return A; \
} \ } \
valid_ = true; \ valid_ = true; \
error_type::expected_call( MOCK_FUNCTION_CALL_CONTEXT(n), it->file(), it->line() ); \ error_type::expected_call( \
MOCK_FUNCTION_CONTEXT(n), it->file(), it->line() ); \
return it->functor()( BOOST_PP_ENUM_PARAMS(n, p) ); \ return it->functor()( BOOST_PP_ENUM_PARAMS(n, p) ); \
} \ } \
error_type::unexpected_call( MOCK_FUNCTION_CALL_CONTEXT(n) ); \ error_type::unexpected_call( MOCK_FUNCTION_CONTEXT(n) ); \
return A; \ return A; \
} }
#define MOCK_FUNCTION_OPERATOR(z, n, P) \ #define MOCK_FUNCTION_OPERATOR(z, n, P) \
MOCK_DECL(operator(), n, Signature, const, BOOST_DEDUCED_TYPENAME) \ MOCK_DECL(operator(), n, Signature, const, BOOST_DEDUCED_TYPENAME) \
MOCK_FUNCTION_INVOKE(z, n, P) MOCK_FUNCTION_INVOKE(z, n, P)
BOOST_PP_REPEAT(BOOST_PP_INC(MOCK_MAX_ARGS), MOCK_FUNCTION_OPERATOR, error_type::abort()) BOOST_PP_REPEAT(
BOOST_PP_INC(MOCK_MAX_ARGS),
MOCK_FUNCTION_OPERATOR,
error_type::abort())
void test() const void test() const
MOCK_FUNCTION_INVOKE(, 0,) MOCK_FUNCTION_INVOKE(, 0,)
@ -242,9 +258,10 @@ namespace mock
#undef MOCK_FUNCTION_FORMAT #undef MOCK_FUNCTION_FORMAT
#undef MOCK_FUNCTION_OPERATOR #undef MOCK_FUNCTION_OPERATOR
#undef MOCK_FUNCTION_INVOKE #undef MOCK_FUNCTION_INVOKE
#undef MOCK_FUNCTION_CALL_CONTEXT #undef MOCK_FUNCTION_CONTEXT
friend std::ostream& operator<<( std::ostream& s, const function_impl& e ) friend std::ostream& operator<<(
std::ostream& s, const function_impl& e )
{ {
return s << lazy_context( &e ) << lazy_expectations( &e ); return s << lazy_context( &e ) << lazy_expectations( &e );
} }
@ -254,7 +271,8 @@ namespace mock
lazy_context( const function_impl* impl ) lazy_context( const function_impl* impl )
: impl_( impl ) : impl_( impl )
{} {}
friend std::ostream& operator<<( std::ostream& s, const lazy_context& e ) friend std::ostream& operator<<(
std::ostream& s, const lazy_context& e )
{ {
if( e.impl_->context_ ) if( e.impl_->context_ )
e.impl_->context_->serialize( s, *e.impl_ ); e.impl_->context_->serialize( s, *e.impl_ );
@ -270,7 +288,8 @@ namespace mock
lazy_expectations( const function_impl* impl ) lazy_expectations( const function_impl* impl )
: impl_( impl ) : impl_( impl )
{} {}
friend std::ostream& operator<<( std::ostream& s, const lazy_expectations& e ) friend std::ostream& operator<<(
std::ostream& s, const lazy_expectations& e )
{ {
for( expectations_cit it = e.impl_->expectations_.begin(); for( expectations_cit it = e.impl_->expectations_.begin();
it != e.impl_->expectations_.end(); ++it ) it != e.impl_->expectations_.end(); ++it )

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_GROUP_HPP_INCLUDED #ifndef MOCK_GROUP_HPP_INCLUDED
#define MOCK_GROUP_HPP_INCLUDED #define MOCK_GROUP_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_INVOCATION_HPP_INCLUDED #ifndef MOCK_INVOCATION_HPP_INCLUDED
#define MOCK_INVOCATION_HPP_INCLUDED #define MOCK_INVOCATION_HPP_INCLUDED
@ -30,7 +31,8 @@ namespace detail
virtual bool invoked() const = 0; virtual bool invoked() const = 0;
virtual bool exhausted() const = 0; virtual bool exhausted() const = 0;
friend inline std::ostream& operator<<( std::ostream& s, const invocation& i ) friend inline std::ostream& operator<<(
std::ostream& s, const invocation& i )
{ {
return i.serialize( s ); return i.serialize( s );
} }
@ -81,7 +83,8 @@ namespace detail
private: private:
virtual std::ostream& serialize( std::ostream& s ) const virtual std::ostream& serialize( std::ostream& s ) const
{ {
return s << "between( " << count_ << "/[" << min_ << ',' << max_ << "] )"; return s << "between( " << count_
<< "/[" << min_ << ',' << max_ << "] )";
} }
}; };

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2009 // Copyright Mathieu Champlon 2009
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_IS_FUNCTOR_HPP_INCLUDED #ifndef MOCK_IS_FUNCTOR_HPP_INCLUDED
#define MOCK_IS_FUNCTOR_HPP_INCLUDED #define MOCK_IS_FUNCTOR_HPP_INCLUDED
@ -21,10 +22,13 @@ namespace mock
namespace detail namespace detail
{ {
#define MOCK_IS_FUNCTION_HELPER(N, M) \ #define MOCK_IS_FUNCTION_HELPER(N, M) \
template< typename T > yes_type& N##_helper( BOOST_DEDUCED_TYPENAME T::M* ); \ template< typename T > yes_type& N##_helper( \
BOOST_DEDUCED_TYPENAME T::M* ); \
template< typename T > no_type& N##_helper( ... ); \ template< typename T > no_type& N##_helper( ... ); \
template< typename T > struct N \ template< typename T > struct N \
: boost::mpl::bool_< sizeof( N##_helper< T >( 0 ) ) == sizeof( yes_type ) > \ : boost::mpl::bool_< \
sizeof( N##_helper< T >( 0 ) ) == sizeof( yes_type ) \
> \
{}; {};
MOCK_IS_FUNCTION_HELPER( has_result_type, result_type ) MOCK_IS_FUNCTION_HELPER( has_result_type, result_type )

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_LAMBDA_HPP_INCLUDED #ifndef MOCK_LAMBDA_HPP_INCLUDED
#define MOCK_LAMBDA_HPP_INCLUDED #define MOCK_LAMBDA_HPP_INCLUDED
@ -41,7 +42,8 @@ namespace detail
template< typename T > template< typename T >
static functor_type make_val( boost::reference_wrapper< T > t ) static functor_type make_val( boost::reference_wrapper< T > t )
{ {
return mock::detail::bind( &do_ref_identity< T >, t.get_pointer() ); return mock::detail::bind(
&do_ref_identity< T >, t.get_pointer() );
} }
template< typename T > template< typename T >
static functor_type make_throw( T t ) static functor_type make_throw( T t )

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_LOG_HPP_INCLUDED #ifndef MOCK_LOG_HPP_INCLUDED
#define MOCK_LOG_HPP_INCLUDED #define MOCK_LOG_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_MOCK_HPP_INCLUDED #ifndef MOCK_MOCK_HPP_INCLUDED
#define MOCK_MOCK_HPP_INCLUDED #define MOCK_MOCK_HPP_INCLUDED
@ -103,7 +104,9 @@ namespace detail
#define MOCK_SIGNATURE(M) \ #define MOCK_SIGNATURE(M) \
mock::detail::signature< \ mock::detail::signature< \
BOOST_TYPEOF( mock::ambiguous_method_name_use_MOCK_METHOD_EXT_instead( &base_type::M ) ) \ BOOST_TYPEOF( \
mock::ambiguous_method_name_use_MOCK_METHOD_EXT_instead( \
&base_type::M ) ) \
>::type >::type
#define MOCK_METHOD_AUX(M, n, S, t, c, tpn) \ #define MOCK_METHOD_AUX(M, n, S, t, c, tpn) \

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_NODE_HPP_INCLUDED #ifndef MOCK_NODE_HPP_INCLUDED
#define MOCK_NODE_HPP_INCLUDED #define MOCK_NODE_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_OBJECT_HPP_INCLUDED #ifndef MOCK_OBJECT_HPP_INCLUDED
#define MOCK_OBJECT_HPP_INCLUDED #define MOCK_OBJECT_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2010 // Copyright Mathieu Champlon 2010
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_OPERATORS_HPP_INCLUDED #ifndef MOCK_OPERATORS_HPP_INCLUDED
#define MOCK_OPERATORS_HPP_INCLUDED #define MOCK_OPERATORS_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_PARENT_HPP_INCLUDED #ifndef MOCK_PARENT_HPP_INCLUDED
#define MOCK_PARENT_HPP_INCLUDED #define MOCK_PARENT_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_ROOT_HPP_INCLUDED #ifndef MOCK_ROOT_HPP_INCLUDED
#define MOCK_ROOT_HPP_INCLUDED #define MOCK_ROOT_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_SEQUENCE_HPP_INCLUDED #ifndef MOCK_SEQUENCE_HPP_INCLUDED
#define MOCK_SEQUENCE_HPP_INCLUDED #define MOCK_SEQUENCE_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2009 // Copyright Mathieu Champlon 2009
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_TYPE_NAME_HPP_INCLUDED #ifndef MOCK_TYPE_NAME_HPP_INCLUDED
#define MOCK_TYPE_NAME_HPP_INCLUDED #define MOCK_TYPE_NAME_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_VERIFIABLE_HPP_INCLUDED #ifndef MOCK_VERIFIABLE_HPP_INCLUDED
#define MOCK_VERIFIABLE_HPP_INCLUDED #define MOCK_VERIFIABLE_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_YES_NO_TYPE_HPP_INCLUDED #ifndef MOCK_YES_NO_TYPE_HPP_INCLUDED
#define MOCK_YES_NO_TYPE_HPP_INCLUDED #define MOCK_YES_NO_TYPE_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#define MOCK_MAX_ARGS 10 #define MOCK_MAX_ARGS 10
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#define MOCK_MAX_ARGS 20 #define MOCK_MAX_ARGS 20
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#define MOCK_MAX_ARGS 30 #define MOCK_MAX_ARGS 30
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#define MOCK_MAX_ARGS 30 #define MOCK_MAX_ARGS 30
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/mock.hpp> #include <turtle/mock.hpp>
#ifdef _MSC_VER #ifdef _MSC_VER

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#define MOCK_MAX_ARGS 10 #define MOCK_MAX_ARGS 10
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#define MOCK_MAX_ARGS 20 #define MOCK_MAX_ARGS 20
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#define MOCK_MAX_ARGS 30 #define MOCK_MAX_ARGS 30
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#define BOOST_AUTO_TEST_MAIN #define BOOST_AUTO_TEST_MAIN
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>
@ -20,12 +21,12 @@ namespace
fixture() fixture()
{ {
std::cout << __FUNCTION__ << std::endl; std::cout << __FUNCTION__ << std::endl;
//BOOST_FAIL( "oups" ); BOOST_FAIL( "oups" );
} }
~fixture() ~fixture()
{ {
std::cout << __FUNCTION__ << std::endl; std::cout << __FUNCTION__ << std::endl;
//BOOST_FAIL( "oups" ); BOOST_FAIL( "oups" );
} }
}; };
BOOST_GLOBAL_FIXTURE( fixture ); BOOST_GLOBAL_FIXTURE( fixture );

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2012 // Copyright Mathieu Champlon 2012
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#define BOOST_AUTO_TEST_MAIN #define BOOST_AUTO_TEST_MAIN
#include "hippomocks.h" #include "hippomocks.h"

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include "pch_test.h" #include "pch_test.h"

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2011 // Copyright Mathieu Champlon 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
//#include <boost/spirit/home/phoenix/statement/throw.hpp> //#include <boost/spirit/home/phoenix/statement/throw.hpp>
//#include <boost/spirit/home/phoenix/operator/self.hpp> //#include <boost/spirit/home/phoenix/operator/self.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/constraints.hpp> #include <turtle/constraints.hpp>
#include <turtle/operators.hpp> #include <turtle/operators.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/error.hpp> #include <turtle/error.hpp>
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#define BOOST_AUTO_TEST_MAIN #define BOOST_AUTO_TEST_MAIN
#include "mock_error.hpp" #include "mock_error.hpp"

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include "mock_error.hpp" #include "mock_error.hpp"
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/invocation.hpp> #include <turtle/invocation.hpp>
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2009 // Copyright Mathieu Champlon 2009
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/is_functor.hpp> #include <turtle/is_functor.hpp>
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/log.hpp> #include <turtle/log.hpp>
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include "mock_error.hpp" #include "mock_error.hpp"
#include <turtle/mock.hpp> #include <turtle/mock.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#ifndef MOCK_TEST_MOCK_ERROR_HPP_INCLUDED #ifndef MOCK_TEST_MOCK_ERROR_HPP_INCLUDED
#define MOCK_TEST_MOCK_ERROR_HPP_INCLUDED #define MOCK_TEST_MOCK_ERROR_HPP_INCLUDED

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2009 // Copyright Mathieu Champlon 2009
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/mock.hpp> #include <turtle/mock.hpp>
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include "mock_error.hpp" #include "mock_error.hpp"
#include <turtle/object.hpp> #include <turtle/object.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include "mock_error.hpp" #include "mock_error.hpp"
#include <turtle/sequence.hpp> #include <turtle/sequence.hpp>

View file

@ -1,10 +1,11 @@
// //
// Copyright Mathieu Champlon 2008 // Copyright Mathieu Champlon 2008
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// See http://turtle.sf.net for documentation.
#include <turtle/type_name.hpp> #include <turtle/type_name.hpp>
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>