Added detection for a pointer in mock::assign to dereference it before performing the assignment

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@158 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2010-05-31 11:36:05 +00:00
parent a4b061184c
commit df46dec9e0
3 changed files with 28 additions and 15 deletions

View file

@ -59,6 +59,11 @@ BOOST_AUTO_TEST_CASE( assign )
BOOST_CHECK( mock::assign( 3 ).f_( i ) );
BOOST_CHECK_EQUAL( 3, i );
}
{
int i = 0;
BOOST_CHECK( mock::assign( 3 ).f_( &i ) );
BOOST_CHECK_EQUAL( 3, i );
}
{
const int* i = 0;
const int j = 1;