Merge pull request #1620 from gennadiycivil/master

Adress, #1616, add  printer for std::nullptr_t
This commit is contained in:
Gennadiy Civil 2018-06-04 17:49:24 +02:00 committed by GitHub
commit 7e7f9d5fbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -636,6 +636,10 @@ inline void PrintTo(absl::string_view sp, ::std::ostream* os) {
}
#endif // GTEST_HAS_ABSL
#if GTEST_LANG_CXX11
inline void PrintTo(std::nullptr_t, ::std::ostream* os) { *os << "(nullptr)"; }
#endif // GTEST_LANG_CXX11
#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
// Helper function for printing a tuple. T must be instantiated with
// a tuple type.

View File

@ -1115,6 +1115,12 @@ TEST(PrintStdTupleTest, NestedTuple) {
#endif // GTEST_LANG_CXX11
#if GTEST_LANG_CXX11
TEST(PrintNullptrT, Basic) {
EXPECT_EQ("(nullptr)", Print(nullptr));
}
#endif // GTEST_LANG_CXX11
// Tests printing user-defined unprintable types.
// Unprintable types in the global namespace.