[PATCH] D65633: [Object] Create MutableELFObject Class for Doing Mutations on ELFObjectFiles [Part 3]

Sam McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 02:58:35 PDT 2019


sammccall added a comment.

In D65633#1638835 <https://reviews.llvm.org/D65633#1638835>, @sammccall wrote:

> In D65633#1638796 <https://reviews.llvm.org/D65633#1638796>, @labath wrote:
>
> > In D65633#1638673 <https://reviews.llvm.org/D65633#1638673>, @abrachet wrote:
> >
> > > I've been using `::testing::ElementsAre(...)` against a vector of `StringRef` a lot, when it fails the output is really bad. Like this: `element #1 is equal to { '.' (46, 0x2E), 's' (115, 0x73), 'e' (101, 0x65), 'c' (99, 0x63), '0' (48, 0x30) },` Is there a way to provide formatting for types to gtest? Or should I just be using `const char *`?
> >
> >
> > Yeah, there is <https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#teaching-googletest-how-to-print-your-values>. It involves writing either an `operator<<` or a `PrintTo` function. The StringRef class already has an operator<<, but the problem here is that gtest wants to print it as a container instead of using that operator<<. I don't know if there's anything we can do here, but @sammccall might.
>
>
> This has bothered at various times, but I never really investigated how to fix it. I'll try to put together a patch.


D66520 <https://reviews.llvm.org/D66520> addresses this.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65633/new/

https://reviews.llvm.org/D65633





More information about the llvm-commits mailing list