git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@184 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2011-01-13 21:35:52 +00:00
parent b654bc6bbb
commit 2b5385be40
4 changed files with 19 additions and 19 deletions

View file

@ -29,9 +29,9 @@ namespace mock
(void)actual; \ (void)actual; \
return Expr; \ return Expr; \
} \ } \
friend std::ostream& operator<<( std::ostream& os, const N& ) \ friend std::ostream& operator<<( std::ostream& s, const N& ) \
{ \ { \
return os << BOOST_STRINGIZE( N ); \ return s << BOOST_STRINGIZE( N ); \
} \ } \
}; \ }; \
} \ } \
@ -64,9 +64,9 @@ namespace mock
{ \ { \
return Expr; \ return Expr; \
} \ } \
friend std::ostream& operator<<( std::ostream& os, const N& n ) \ friend std::ostream& operator<<( std::ostream& s, const N& n ) \
{ \ { \
return os << BOOST_STRINGIZE( N ) << "( " << mock::format( n.expected_ ) << " )"; \ return s << BOOST_STRINGIZE( N ) << "( " << mock::format( n.expected_ ) << " )"; \
} \ } \
Expected expected_; \ Expected expected_; \
}; \ }; \
@ -126,9 +126,9 @@ namespace detail
*actual = expected_; *actual = expected_;
return true; return true;
} }
friend std::ostream& operator<<( std::ostream& os, const assign& a ) friend std::ostream& operator<<( std::ostream& s, const assign& a )
{ {
return os << "assign( " << mock::format( a.expected_ ) << " )"; return s << "assign( " << mock::format( a.expected_ ) << " )";
} }
Expected expected_; Expected expected_;
}; };
@ -155,9 +155,9 @@ namespace detail
*expected_ = &actual; *expected_ = &actual;
return true; return true;
} }
friend std::ostream& operator<<( std::ostream& os, const retrieve& r ) friend std::ostream& operator<<( std::ostream& s, const retrieve& r )
{ {
return os << "retrieve( " << mock::format( *r.expected_ ) << " )"; return s << "retrieve( " << mock::format( *r.expected_ ) << " )";
} }
Expected* expected_; Expected* expected_;
}; };

View file

@ -243,8 +243,8 @@ namespace mock
{ {
return s << e.context(); return s << e.context();
} }
private:
private:
template< typename T > template< typename T >
result_type invoke() const result_type invoke() const
{ {

View file

@ -28,9 +28,9 @@ namespace detail
{ {
return f1_( actual ) && f2_( actual ); return f1_( actual ) && f2_( actual );
} }
friend std::ostream& operator<<( std::ostream& os, const and_& a ) friend std::ostream& operator<<( std::ostream& s, const and_& a )
{ {
return os << "( " << a.f1_ << " && " << a.f2_ << " )"; return s << "( " << a.f1_ << " && " << a.f2_ << " )";
} }
private: private:
Functor1 f1_; Functor1 f1_;
@ -50,9 +50,9 @@ namespace detail
{ {
return f1_( actual ) || f2_( actual ); return f1_( actual ) || f2_( actual );
} }
friend std::ostream& operator<<( std::ostream& os, const or_& o ) friend std::ostream& operator<<( std::ostream& s, const or_& o )
{ {
return os << "( " << o.f1_ << " || " << o.f2_ << " )"; return s << "( " << o.f1_ << " || " << o.f2_ << " )";
} }
private: private:
Functor1 f1_; Functor1 f1_;
@ -71,9 +71,9 @@ namespace detail
{ {
return ! f_( actual ); return ! f_( actual );
} }
friend std::ostream& operator<<( std::ostream& os, const not_& n ) friend std::ostream& operator<<( std::ostream& s, const not_& n )
{ {
return os << "! " << n.f_; return s << "! " << n.f_;
} }
private: private:
Functor f_; Functor f_;

View file

@ -327,15 +327,15 @@ namespace
return std::abs( actual - expected_ ) < threshold_; return std::abs( actual - expected_ ) < threshold_;
} }
friend std::ostream& operator<<( std::ostream& os, const near_constraint& c ) friend std::ostream& operator<<( std::ostream& s, const near_constraint& c )
{ {
return os << "std::abs( _ - " << c.expected_ << " ) < " << c.threshold_; return s << "std::abs( _ - " << c.expected_ << " ) < " << c.threshold_;
} }
//template< typename Actual > //template< typename Actual >
//void explain( std::ostream& os, Actual actual ) const //void explain( std::ostream& s, Actual actual ) const
//{ //{
// os << std::abs( actual - expected_ ) << " >= " << threshold_; // s << std::abs( actual - expected_ ) << " >= " << threshold_;
//} //}
Expected expected_; Expected expected_;