From 2b5385be40b55b579947dd57987e90ec55ab9cd8 Mon Sep 17 00:00:00 2001 From: mat007 Date: Thu, 13 Jan 2011 21:35:52 +0000 Subject: [PATCH] Clean-up git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@184 860be788-9bd5-4423-9f1e-828f051e677b --- src/libraries/turtle/constraints.hpp | 16 ++++++++-------- src/libraries/turtle/function.hpp | 2 +- src/libraries/turtle/operators.hpp | 12 ++++++------ src/tests/turtle_test/integration_test.cpp | 8 ++++---- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/libraries/turtle/constraints.hpp b/src/libraries/turtle/constraints.hpp index bf7866f..22c67cf 100644 --- a/src/libraries/turtle/constraints.hpp +++ b/src/libraries/turtle/constraints.hpp @@ -29,9 +29,9 @@ namespace mock (void)actual; \ 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; \ } \ - 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_; \ }; \ @@ -126,9 +126,9 @@ namespace detail *actual = expected_; 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_; }; @@ -155,9 +155,9 @@ namespace detail *expected_ = &actual; 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_; }; diff --git a/src/libraries/turtle/function.hpp b/src/libraries/turtle/function.hpp index cef6362..5c151ab 100644 --- a/src/libraries/turtle/function.hpp +++ b/src/libraries/turtle/function.hpp @@ -243,8 +243,8 @@ namespace mock { return s << e.context(); } - private: + private: template< typename T > result_type invoke() const { diff --git a/src/libraries/turtle/operators.hpp b/src/libraries/turtle/operators.hpp index 45d5bbc..b9193d6 100644 --- a/src/libraries/turtle/operators.hpp +++ b/src/libraries/turtle/operators.hpp @@ -28,9 +28,9 @@ namespace detail { 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: Functor1 f1_; @@ -50,9 +50,9 @@ namespace detail { 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: Functor1 f1_; @@ -71,9 +71,9 @@ namespace detail { 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: Functor f_; diff --git a/src/tests/turtle_test/integration_test.cpp b/src/tests/turtle_test/integration_test.cpp index 4eb149b..0513a78 100644 --- a/src/tests/turtle_test/integration_test.cpp +++ b/src/tests/turtle_test/integration_test.cpp @@ -327,15 +327,15 @@ namespace 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 > - //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_;