compare pointers as addresses and use BOOST_TEST_CSTR_xx to compare cstrings

This commit is contained in:
hans.dembinski@gmail.com
2017-02-06 20:08:43 +00:00
parent 3942e9c097
commit cc5472623f
2 changed files with 49 additions and 9 deletions

View File

@@ -64,14 +64,15 @@ int main()
BOOST_TEST_EQ( ++x, ++y );
BOOST_TEST_EQ( x++, y++ );
BOOST_TEST_EQ("xabc"+1, "yabc"+1); // make sure addresses are different
BOOST_TEST_CSTR_EQ("xabc"+1, "yabc"+1); // equal cstrings, different addresses
BOOST_TEST_EQ( &y, &y );
// BOOST_TEST_NE
BOOST_TEST_NE( ++x, y );
BOOST_TEST_NE( &x, &y );
BOOST_TEST_NE( "abc", "ABC" );
BOOST_TEST_NE("xabc"+1, "yabc"+1); // equal cstrings, different addresses
BOOST_TEST_CSTR_NE("x", "y");
// BOOST_TEST_THROWS