git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@21 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2009-09-06 14:49:55 +00:00
parent 44431e359c
commit f98339ea9d
3 changed files with 9 additions and 6 deletions

View file

@ -46,11 +46,11 @@ namespace mock
matcher_type; matcher_type;
public: public:
expectation( node& parent = root, const std::string& name = "?" ) expectation( node& parent = detail::root, const std::string& name = "?" )
: impl_( new expectation_impl( parent, name ) ) : impl_( new expectation_impl( parent, name ) )
{} {}
expectation( const std::string& name ) expectation( const std::string& name )
: impl_( new expectation_impl( root, name ) ) : impl_( new expectation_impl( detail::root, name ) )
{} {}
expectation& set_name( const std::string& name ) expectation& set_name( const std::string& name )

View file

@ -19,12 +19,12 @@ namespace mock
class object : public node class object : public node
{ {
public: public:
explicit object( node& parent = root, const std::string& name = "" ) explicit object( node& parent = detail::root, const std::string& name = "" )
: node( parent ) : node( parent )
, name_( name ) , name_( name )
{} {}
explicit object( const std::string& name ) explicit object( const std::string& name )
: node( root ) : node( detail::root )
, name_( name ) , name_( name )
{} {}

View file

@ -13,6 +13,8 @@
#include <boost/test/utils/trivial_singleton.hpp> #include <boost/test/utils/trivial_singleton.hpp>
namespace mock namespace mock
{
namespace detail
{ {
class root_t : public boost::unit_test::singleton< root_t >, public node class root_t : public boost::unit_test::singleton< root_t >, public node
{ {
@ -22,14 +24,15 @@ namespace mock
BOOST_TEST_SINGLETON_CONS( root_t ); BOOST_TEST_SINGLETON_CONS( root_t );
}; };
BOOST_TEST_SINGLETON_INST( root ) BOOST_TEST_SINGLETON_INST( root )
}
inline bool verify() inline bool verify()
{ {
return root.verify(); return detail::root.verify();
} }
inline void reset() inline void reset()
{ {
root.reset(); detail::root.reset();
} }
} }