[PATCH] D43330: [gtest] Add PrintTo overload for StringRef.

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 05:02:23 PST 2018


labath added a comment.

This is unfortunate, but it's kind of a consequence of how googletest implements it's universal printers. The reason why I don't think it's a good idea is that this is not a problem specific to StringRef, as any class can come out as giberrish if the user forgets to include the PrintTo function. I am not adamant about this, but I think the bar for modifying gtest code should be higher than this (it's trivial to add the right include if you see you're values aren't coming out right).

It's possible I am being too pedantic about this (if it were up to me, I would implement even the raw_ostream trickery outside of gtest with a SFINAE-ed templated PrintTo function), but I'd like to hear others have to say about this, (particulary @zturner, as he's the one who came up with the `llvm/Testing` idea).


Repository:
  rL LLVM

https://reviews.llvm.org/D43330





More information about the llvm-commits mailing list