Refactoring

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@134 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2010-03-01 23:25:23 +00:00
parent 9a6c43ca6b
commit dad638f4ab
2 changed files with 9 additions and 9 deletions

View file

@ -55,12 +55,12 @@ namespace mock
expectation_type; expectation_type;
public: public:
struct expectation_tag struct function_tag
{}; {};
expectation_tag exp_; function_tag exp_;
function() function()
: impl_( new expectation_impl() ) : impl_( new function_impl() )
{} {}
void tag( const std::string& name ) void tag( const std::string& name )
@ -118,17 +118,17 @@ namespace mock
} }
private: private:
class expectation_impl : private verifiable class function_impl : private verifiable
{ {
public: public:
expectation_impl() function_impl()
: name_( "?" ) : name_( "?" )
, parent_( &root ) , parent_( &root )
, valid_( true ) , valid_( true )
{ {
parent_->add( *this ); parent_->add( *this );
} }
virtual ~expectation_impl() virtual ~function_impl()
{ {
parent_->remove( *this ); parent_->remove( *this );
if( ! std::uncaught_exception() ) if( ! std::uncaught_exception() )
@ -232,7 +232,7 @@ namespace mock
#undef MOCK_EXPECTATION_FORMAT #undef MOCK_EXPECTATION_FORMAT
#undef MOCK_EXPECTATION_OPERATOR #undef MOCK_EXPECTATION_OPERATOR
friend std::ostream& operator<<( std::ostream& s, const expectation_impl& e ) friend std::ostream& operator<<( std::ostream& s, const function_impl& e )
{ {
return s << e.context(); return s << e.context();
} }
@ -303,7 +303,7 @@ namespace mock
}; };
private: private:
boost::shared_ptr< expectation_impl > impl_; boost::shared_ptr< function_impl > impl_;
}; };
} }

View file

@ -107,7 +107,7 @@ namespace detail
} }
template< typename E > template< typename E >
E& configure( BOOST_DEDUCED_TYPENAME E::expectation_tag, E& configure( BOOST_DEDUCED_TYPENAME E::function_tag,
const std::string& parent, const std::string& /*op*/, const std::string& parent, const std::string& /*op*/,
const std::string& /*name*/, E& e ) const std::string& /*name*/, E& e )
{ {