[gtest] Fix printing of StringRef and SmallString in assert messages.
authorSam McCall <sam.mccall@gmail.com>
Wed, 21 Aug 2019 11:37:06 +0000 (11:37 +0000)
committerSam McCall <sam.mccall@gmail.com>
Wed, 21 Aug 2019 11:37:06 +0000 (11:37 +0000)
commit2fe9ce60640762f27294ae60c6b508a5bfb72f2b
tree4a340bd9d046c2e7ced126199d7cdced76c20bc8
parent82275ec51d00c33316506054faebb1033a9b7690
[gtest] Fix printing of StringRef and SmallString in assert messages.

Summary:
These are detected by gtest as containers, and so previously printed as e.g.
  { '.' (46, 0x2E), 's' (115, 0x73), 'e' (101, 0x65), 'c' (99, 0x63), '0' (48, 0x30) },

gtest itself overloads PrintTo for std::string and friends, we use the same mechanism.

Reviewers: labath

Subscribers: dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66520

llvm-svn: 369518
llvm/unittests/ADT/SmallStringTest.cpp
llvm/unittests/ADT/StringRefTest.cpp
llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest-printers.h