mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Unit test nullptr C-style strings
Added unit tests for the cases of matching and serializing C-style strings (char*) that are nullptr. (As of this revision, these new tests correctly fail, except for the test of mock::equal; fix to follow.)
This commit is contained in:
parent
0dd0dfa15f
commit
528761b180
3 changed files with 26 additions and 1 deletions
|
|
@ -89,6 +89,14 @@ BOOST_AUTO_TEST_CASE(strings_are_serialized_with_double_quotes)
|
|||
BOOST_CHECK_EQUAL("\"string\"", to_string(std::string("string")));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(null_c_strings_are_serialized_to_nullptr)
|
||||
{
|
||||
const char* const null_str = nullptr;
|
||||
BOOST_CHECK_EQUAL("nullptr", to_string(null_str));
|
||||
// Note the lack of double quotes in the output, as opposed to when the
|
||||
// string "nullptr" is serialized.
|
||||
}
|
||||
|
||||
namespace {
|
||||
struct non_serializable
|
||||
{};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue