Fixed crash when comparing null pointers to const char* arguments in matcher

This commit is contained in:
Mathieu Champlon 2015-08-09 10:30:11 +02:00
parent 77a4816c56
commit b40680a32a
3 changed files with 9 additions and 2 deletions

View file

@ -54,7 +54,11 @@ BOOST_FIXTURE_TEST_CASE( const_char_pointer_and_const_char_pointer_can_be_compar
const char* expected = "same text";
BOOST_CHECK( match( expected, actual ) );
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 )