diff options
author | Abseil Team <absl-team@google.com> | 2019-01-12 17:26:37 (GMT) |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2019-01-14 22:01:56 (GMT) |
commit | 097407fd3cfb4d1e5f89ae242635b1f321b222bb (patch) | |
tree | cf83f668a3026f5cab2dede77d834ad177550c63 /googletest/test/googletest-printers-test.cc | |
parent | 0599a7b8410dc5cfdb477900b280475ae775d7f9 (diff) | |
download | googletest-097407fd3cfb4d1e5f89ae242635b1f321b222bb.zip googletest-097407fd3cfb4d1e5f89ae242635b1f321b222bb.tar.gz googletest-097407fd3cfb4d1e5f89ae242635b1f321b222bb.tar.bz2 |
Googletest export
Deduplicate testing::ReferenceWrapper with std::reference_wrapper.
Minor cleanups in matchers_test.
PiperOrigin-RevId: 229022872
Diffstat (limited to 'googletest/test/googletest-printers-test.cc')
-rw-r--r-- | googletest/test/googletest-printers-test.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/googletest/test/googletest-printers-test.cc b/googletest/test/googletest-printers-test.cc index 961e818..5ce2a77 100644 --- a/googletest/test/googletest-printers-test.cc +++ b/googletest/test/googletest-printers-test.cc @@ -1023,16 +1023,20 @@ TEST(PrintNullptrT, Basic) { TEST(PrintReferenceWrapper, Printable) { int x = 5; - EXPECT_EQ("5", Print(std::ref(x))); - EXPECT_EQ("5", Print(std::cref(x))); + EXPECT_EQ("@" + PrintPointer(&x) + " 5", Print(std::ref(x))); + EXPECT_EQ("@" + PrintPointer(&x) + " 5", Print(std::cref(x))); } TEST(PrintReferenceWrapper, Unprintable) { ::foo::UnprintableInFoo up; - EXPECT_EQ("16-byte object <EF-12 00-00 34-AB 00-00 00-00 00-00 00-00 00-00>", - Print(std::ref(up))); - EXPECT_EQ("16-byte object <EF-12 00-00 34-AB 00-00 00-00 00-00 00-00 00-00>", - Print(std::cref(up))); + EXPECT_EQ( + "@" + PrintPointer(&up) + + " 16-byte object <EF-12 00-00 34-AB 00-00 00-00 00-00 00-00 00-00>", + Print(std::ref(up))); + EXPECT_EQ( + "@" + PrintPointer(&up) + + " 16-byte object <EF-12 00-00 34-AB 00-00 00-00 00-00 00-00 00-00>", + Print(std::cref(up))); } // Tests printing user-defined unprintable types. |