Lines Matching refs:listener

78 // to indicate whether the listener is interested in why the match
82 // Creates a listener object with the given underlying ostream. The
83 // listener does not own the ostream, and does not dereference it
100 // Returns true iff the listener is interested in an explanation of
146 // result to 'listener' if necessary (see the next paragraph), in
171 // that 'listener' is not NULL. This helps to simplify a matcher's
173 // can talk to 'listener' without checking its validity first.
175 // listener->stream() may be NULL.
176 virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0;
183 // A match result listener that stores the explanation in a string.
227 // A match result listener that ignores the explanation.
236 // A match result listener that forwards the explanation to a given
255 // result to 'listener'.
256 bool MatchAndExplain(T x, MatchResultListener* listener) const {
257 return impl_->MatchAndExplain(x, listener);
276 StreamMatchResultListener listener(os);
277 MatchAndExplain(x, &listener);
426 // MatchResultListener* listener) const;
461 virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
462 return impl_.MatchAndExplain(x, listener);
576 virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
577 return source_matcher_.MatchAndExplain(static_cast<U>(x), listener);
696 // the match result to the listener. Returns the match result.
697 // 'listener' must not be NULL.
702 MatchResultListener* listener) {
703 if (!listener->IsInterested()) {
704 // If the listener is not interested, we do not need to construct the
712 UniversalPrint(value, listener->stream());
716 *listener->stream() << " (of type " << type_name << ")";
718 PrintIfNotEmpty(inner_listener.str(), listener->stream());
755 StringMatchResultListener listener;
756 if (!matcher.MatchAndExplain(value, &listener)) {
768 PrintIfNotEmpty(listener.str(), os);
862 T /* x */, MatchResultListener* /* listener */) const { return true; }
907 Lhs lhs, MatchResultListener* /* listener */) const {
981 MatchResultListener* /* listener */) const {
1001 MatchResultListener* /* listener */) const {
1063 Super& x, MatchResultListener* listener) const {
1064 *listener << "which is located @" << static_cast<const void*>(&x);
1138 bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
1142 return MatchAndExplain(StringType(s), listener);
1151 MatchResultListener* /* listener */) const {
1198 bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
1199 return s != NULL && MatchAndExplain(StringType(s), listener);
1208 MatchResultListener* /* listener */) const {
1245 bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
1246 return s != NULL && MatchAndExplain(StringType(s), listener);
1255 MatchResultListener* /* listener */) const {
1291 bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
1292 return s != NULL && MatchAndExplain(StringType(s), listener);
1301 MatchResultListener* /* listener */) const {
1337 bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
1338 return s != NULL && MatchAndExplain(internal::string(s), listener);
1347 MatchResultListener* /* listener */) const {
1402 MatchResultListener* /* listener */) const {
1449 virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
1450 return !matcher_.MatchAndExplain(x, listener);
1513 virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
1518 *listener << listener1.str();
1524 *listener << listener2.str();
1533 *listener << s2;
1535 *listener << s1;
1537 *listener << ", and " << s2;
1685 virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
1690 *listener << listener1.str();
1696 *listener << listener2.str();
1705 *listener << s2;
1707 *listener << s1;
1709 *listener << ", and " << s2;
1767 MatchResultListener* /* listener */) const {
1855 StringMatchResultListener listener;
1856 if (MatchPrintAndExplain(x, matcher, &listener))
1863 ss << "\n Actual: " << listener.str();
1922 MatchResultListener* listener) const {
1947 if (listener->IsInterested()) {
1948 *listener << "which is " << diff << " from " << expected_;
2082 MatchResultListener* listener) const {
2086 *listener << "which points to ";
2087 return MatchPrintAndExplain(*pointer, matcher_, listener);
2151 bool MatchAndExplain(From from, MatchResultListener* listener) const {
2154 return MatchPrintAndExplain(to, this->matcher_, listener);
2167 bool MatchAndExplain(From& from, MatchResultListener* listener) const {
2171 *listener << "which cannot be dynamic_cast to " << this->GetToName();
2174 return MatchPrintAndExplain(*to, this->matcher_, listener);
2198 bool MatchAndExplain(const T& value, MatchResultListener* listener) const {
2202 value, listener);
2210 MatchResultListener* listener) const {
2211 *listener << "whose given field is ";
2212 return MatchPrintAndExplain(obj.*field_, matcher_, listener);
2216 MatchResultListener* listener) const {
2220 *listener << "which points to an object ";
2224 return MatchAndExplainImpl(false_type(), *p, listener);
2259 bool MatchAndExplain(const T&value, MatchResultListener* listener) const {
2263 value, listener);
2271 MatchResultListener* listener) const {
2272 *listener << "whose given property is ";
2282 return MatchPrintAndExplain(result, matcher_, listener);
2287 MatchResultListener* listener) const {
2291 *listener << "which points to an object ";
2295 return MatchAndExplainImpl(false_type(), *p, listener);
2370 virtual bool MatchAndExplain(T obj, MatchResultListener* listener) const {
2371 *listener << "which is mapped by the given callable to ";
2376 return MatchPrintAndExplain(result, matcher_, listener);
2429 MatchResultListener* listener) const {
2433 *listener
2435 PrintIfNotEmpty(size_listener.str(), listener->stream());
2483 MatchResultListener* listener) const {
2494 *listener << "whose distance between begin() and end() " << distance
2496 PrintIfNotEmpty(distance_listener.str(), listener->stream());
2548 MatchResultListener* listener) const {
2558 ::std::ostream* const os = listener->stream();
2650 MatchResultListener* listener) const {
2657 if (!listener->IsInterested()) {
2658 // If the listener is not interested, we do not need to
2663 *listener << "which is ";
2664 UniversalPrint(sorted_container, listener->stream());
2665 *listener << " when sorted";
2670 PrintIfNotEmpty(inner_listener.str(), listener->stream());
2750 MatchResultListener* listener) const {
2754 *listener << "which contains " << actual_size << " values";
2763 if (listener->IsInterested()) {
2767 *listener << "where the value pair (";
2768 UniversalPrint(*left, listener->stream());
2769 *listener << ", ";
2770 UniversalPrint(*right, listener->stream());
2771 *listener << ") at index #" << i << " don't match";
2772 PrintIfNotEmpty(inner_listener.str(), listener->stream());
2818 MatchResultListener* listener) const {
2827 *listener << "whose element #" << i
2829 PrintIfNotEmpty(inner_listener.str(), listener->stream());
2863 MatchResultListener* listener) const {
2864 return this->MatchAndExplainImpl(false, container, listener);
2892 MatchResultListener* listener) const {
2893 return this->MatchAndExplainImpl(true, container, listener);
2952 MatchResultListener* listener) const {
2958 *listener << "whose first field is a value " << explanation;
3034 MatchResultListener* listener) const {
3035 if (!listener->IsInterested()) {
3036 // If the listener is not interested, we don't need to construct the
3044 *listener << "whose first field does not match";
3045 PrintIfNotEmpty(first_inner_listener.str(), listener->stream());
3051 *listener << "whose second field does not match";
3052 PrintIfNotEmpty(second_inner_listener.str(), listener->stream());
3056 listener);
3063 MatchResultListener* listener) const {
3064 *listener << "whose both fields match";
3066 *listener << ", where the first field is a value " << first_explanation;
3069 *listener << ", ";
3071 *listener << "and ";
3073 *listener << "where ";
3075 *listener << "the second field is a value " << second_explanation;
3162 MatchResultListener* listener) const {
3166 const bool listener_interested = listener->IsInterested();
3209 *listener << "which has " << Elements(actual_count);
3217 *listener << "whose element #" << exam_pos << " doesn't match";
3218 PrintIfNotEmpty(explanations[exam_pos], listener->stream());
3231 *listener << ",\nand ";
3233 *listener << "whose element #" << i << " matches, " << s;
3306 MatchResultListener* listener);
3327 MatchResultListener* listener) const;
3377 MatchResultListener* listener) const {
3383 listener);
3394 if (actual_count != 0 && listener->IsInterested()) {
3395 *listener << "which has " << Elements(actual_count);
3401 matrix, listener) &&
3402 FindPairing(matrix, listener);
3411 MatchResultListener* listener) const {
3416 if (listener->IsInterested()) {
3591 virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
3593 listener);
4352 // result to listener.
4355 M matcher, const T& value, MatchResultListener* listener) {
4356 return SafeMatcherCast<const T&>(matcher).MatchAndExplain(value, listener);