mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Merge b40680a32a into 77a4816c56
This commit is contained in:
commit
809d649a74
3 changed files with 9 additions and 2 deletions
|
|
@ -11,6 +11,7 @@
|
||||||
Not yet released
|
Not yet released
|
||||||
|
|
||||||
* Fixed missing thread synchronization in mock::sequence
|
* Fixed missing thread synchronization in mock::sequence
|
||||||
|
* Fixed crash when comparing null pointers to const char* arguments in matcher
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,9 @@ namespace mock
|
||||||
{}
|
{}
|
||||||
bool operator()( const char* actual )
|
bool operator()( const char* actual )
|
||||||
{
|
{
|
||||||
return std::strcmp( actual, expected_ ) == 0;
|
return actual == expected_
|
||||||
|
|| actual && expected_
|
||||||
|
&& std::strcmp( actual, expected_ ) == 0;
|
||||||
}
|
}
|
||||||
friend std::ostream& operator<<(
|
friend std::ostream& operator<<(
|
||||||
std::ostream& s, const matcher& m )
|
std::ostream& s, const matcher& m )
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,11 @@ BOOST_FIXTURE_TEST_CASE( const_char_pointer_and_const_char_pointer_can_be_compar
|
||||||
const char* expected = "same text";
|
const char* expected = "same text";
|
||||||
BOOST_CHECK( match( expected, actual ) );
|
BOOST_CHECK( match( expected, actual ) );
|
||||||
const char* unexpected = "different text";
|
const char* unexpected = "different text";
|
||||||
BOOST_CHECK( ! match( actual, unexpected ) );
|
BOOST_CHECK( ! match( unexpected, actual ) );
|
||||||
|
const char* null = 0;
|
||||||
|
BOOST_CHECK( ! match( expected, null ) );
|
||||||
|
BOOST_CHECK( ! match( null, actual ) );
|
||||||
|
BOOST_CHECK( match( null, null ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_FIXTURE_TEST_CASE( const_char_pointer_and_string_literal_can_be_compared, fixture )
|
BOOST_FIXTURE_TEST_CASE( const_char_pointer_and_string_literal_can_be_compared, fixture )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue