Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(665)

Unified Diff: testing/gmock/include/gmock/gmock-generated-matchers.h.pump

Issue 1507002: Roll gtest r395:408 and gmock r278:282 to pick up ThreadLocal leak fix. (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: testing/gmock/include/gmock/gmock-generated-matchers.h.pump
diff --git a/testing/gmock/include/gmock/gmock-generated-matchers.h.pump b/testing/gmock/include/gmock/gmock-generated-matchers.h.pump
index fb2bc3589ac8b6b9c998947725780cd835500ed4..07a51a36666fbacd0ea167d4142fd06fc2d87979 100644
--- a/testing/gmock/include/gmock/gmock-generated-matchers.h.pump
+++ b/testing/gmock/include/gmock/gmock-generated-matchers.h.pump
@@ -118,15 +118,28 @@ class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
virtual bool MatchAndExplain(ArgsTuple args,
MatchResultListener* listener) const {
- return inner_matcher_.MatchAndExplain(GetSelectedArgs(args), listener);
+ const SelectedArgs& selected_args = GetSelectedArgs(args);
+ if (!listener->IsInterested())
+ return inner_matcher_.Matches(selected_args);
+
+ PrintIndices(listener->stream());
+ *listener << "are " << PrintToString(selected_args);
+
+ StringMatchResultListener inner_listener;
+ const bool match = inner_matcher_.MatchAndExplain(selected_args,
+ &inner_listener);
+ PrintIfNotEmpty(inner_listener.str(), listener->stream());
+ return match;
}
virtual void DescribeTo(::std::ostream* os) const {
+ *os << "are a tuple ";
PrintIndices(os);
inner_matcher_.DescribeTo(os);
}
virtual void DescribeNegationTo(::std::ostream* os) const {
+ *os << "are a tuple ";
PrintIndices(os);
inner_matcher_.DescribeNegationTo(os);
}
@@ -138,7 +151,7 @@ class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
// Prints the indices of the selected fields.
static void PrintIndices(::std::ostream* os) {
- *os << "are a tuple whose fields (";
+ *os << "whose fields (";
const int indices[$n] = { $ks };
for (int i = 0; i < $n; i++) {
if (indices[i] < 0)
« no previous file with comments | « testing/gmock/include/gmock/gmock-generated-matchers.h ('k') | testing/gmock/include/gmock/gmock-matchers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698