mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Changed char* constraint behaviour to be comparable to another char*
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@547 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
125f6c2a80
commit
3d9011f99d
2 changed files with 55 additions and 0 deletions
|
|
@ -57,6 +57,26 @@ namespace detail
|
|||
Expected expected_;
|
||||
};
|
||||
|
||||
template<>
|
||||
class check< const char*, const char* > : public check_base< const char* >
|
||||
{
|
||||
public:
|
||||
explicit check( const char* expected )
|
||||
: expected_( expected )
|
||||
{}
|
||||
virtual bool operator()( const char* actual )
|
||||
{
|
||||
return strcmp( actual, expected_ ) == 0;
|
||||
}
|
||||
private:
|
||||
virtual void serialize( std::ostream& s ) const
|
||||
{
|
||||
s << mock::format( expected_ );
|
||||
}
|
||||
private:
|
||||
const char* expected_;
|
||||
};
|
||||
|
||||
template< typename Actual, typename Constraint >
|
||||
class check< Actual, mock::constraint< Constraint > >
|
||||
: public check_base< Actual >
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue