diff --git a/src/libraries/turtle/function.hpp b/src/libraries/turtle/function.hpp index 30d604f..24b084e 100644 --- a/src/libraries/turtle/function.hpp +++ b/src/libraries/turtle/function.hpp @@ -197,7 +197,7 @@ namespace mock expectation_type& expect() { if( ! parent_ ) - set_parent( root ); + set_parent( mock::detail::root ); expectations_.push_back( expectation_type() ); valid_ = true; return expectations_.back(); diff --git a/src/libraries/turtle/node.hpp b/src/libraries/turtle/node.hpp index b04fc16..0a190b1 100644 --- a/src/libraries/turtle/node.hpp +++ b/src/libraries/turtle/node.hpp @@ -35,13 +35,13 @@ namespace mock return name_; } - void add( verifiable& e ) + void add( verifiable& v ) { - v_.push_back( &e ); + v_.push_back( &v ); } - void remove( verifiable& e ) + void remove( verifiable& v ) { - v_.erase( std::remove( v_.begin(), v_.end(), &e ), v_.end() ); + v_.erase( std::remove( v_.begin(), v_.end(), &v ), v_.end() ); } virtual bool verify() const diff --git a/src/libraries/turtle/object.hpp b/src/libraries/turtle/object.hpp index f2fa72e..75a2366 100644 --- a/src/libraries/turtle/object.hpp +++ b/src/libraries/turtle/object.hpp @@ -59,13 +59,13 @@ namespace mock { if( ! parent_ ) { - root.add( *this ); - parent_ = &root; + mock::detail::root.add( *this ); + parent_ = &mock::detail::root; } t.set_parent( *this ); } - protected: + private: virtual void untie() { parent_ = 0; diff --git a/src/libraries/turtle/root.hpp b/src/libraries/turtle/root.hpp index 5ddd7d7..7afbdb6 100644 --- a/src/libraries/turtle/root.hpp +++ b/src/libraries/turtle/root.hpp @@ -14,24 +14,27 @@ #include namespace mock +{ +namespace detail { class root_t : public boost::unit_test::singleton< root_t >, public node { - protected: + private: virtual void untie() {} private: BOOST_TEST_SINGLETON_CONS( root_t ); }; BOOST_TEST_SINGLETON_INST( root ) +} inline bool verify() { - return root.verify(); + return mock::detail::root.verify(); } inline void reset() { - root.reset(); + mock::detail::root.reset(); } }