Lines Matching +full:nand +full:- +full:style
30 // Google Mock - a framework for writing C++ mock classes.
50 // C++ source files, we require the description to be a C-string
111 // Actual: -9
114 // printed, making the message human-friendly.
122 // support multi-parameter matchers.
127 // The last argument to MATCHER*() is a string-typed expression. The
129 // special bool-typed variable named 'negation'. When 'negation' is
249 // See googletest/include/gtest/gtest-matchers.h for the definition of class
274 #include "gmock/internal/gmock-internal-utils.h"
275 #include "gmock/internal/gmock-port.h"
276 #include "gmock/internal/gmock-pp.h"
287 4251 GMOCK_MAYBE_5046_ /* class A needs to have dll-interface to be used by
299 // The two-level delegation design makes it possible to allow a user
353 // a user-defined conversion from M to T if one exists (assuming M is
371 // creating Matcher<T> would require a chain of two user-defined conversions
539 // Enforce that we are not converting a non-reference type T to a reference
586 // non-const argument.
590 if (!listener->IsInterested()) {
599 UniversalPrint(value, listener->stream());
603 *listener->stream() << " (of type " << type_name << ")";
605 PrintIfNotEmpty(inner_listener.str(), listener->stream());
610 // An internal helper class for doing compile-time loop on a tuple's
621 return TuplePrefix<N - 1>::Matches(matcher_tuple, value_tuple) &&
622 std::get<N - 1>(matcher_tuple).Matches(std::get<N - 1>(value_tuple));
633 // First, describes failures in the first N - 1 fields.
634 TuplePrefix<N - 1>::ExplainMatchFailuresTo(matchers, values, os);
636 // Then describes the failure (if any) in the (N - 1)-th (0-based)
638 typename std::tuple_element<N - 1, MatcherTuple>::type matcher =
639 std::get<N - 1>(matchers);
640 typedef typename std::tuple_element<N - 1, ValueTuple>::type Value;
641 const Value& value = std::get<N - 1>(values);
644 *os << " Expected arg #" << N - 1 << ": ";
645 std::get<N - 1>(matchers).DescribeTo(os);
721 *out++ = f(::std::get<TupleSize::value - kRemainingSize>(t));
722 return IterateOverTuple<Tup, kRemainingSize - 1>()(f, t, out);
796 // from mistakenly using Ref(x) to match a non-reference function
809 // mocking any function types, including those that take non-const
812 // non-const type.
816 // non-const reference.
824 // non-const reference, as you cannot implicitly convert a const
825 // reference to a non-const reference.
894 // Implements equality-based string matchers like StrEq, StrCaseNe, and etc.
929 // because StringView has some interfering non-explicit constructors.
994 // because StringView has some interfering non-explicit constructors.
1047 // because StringView has some interfering non-explicit constructors.
1101 // because StringView has some interfering non-explicit constructors.
1107 s2.substr(s2.length() - suffix_.length()) == suffix_;
1163 // Implements a matcher that compares the two fields of a 2-tuple
1363 values->push_back(SafeMatcherCast<T>(std::get<I>(matchers_)));
1509 // Without the if-statement, MSVC sometimes warns about converting
1576 // object to act as a predicate-formatter suitable for using with
1618 // A helper function for converting a matcher to a predicate-formatter
1621 // Implementation detail: 'matcher' is received by-value to force decaying.
1643 // two float values using ULP-based approximation or, optionally, a
1644 // user-specified epsilon. The template is meant to be instantiated with
1653 // negative max_abs_error_ term to indicate that ULP-based approximation will
1656 : expected_(expected), nan_eq_nan_(nan_eq_nan), max_abs_error_(-1) {}
1658 // Constructor that supports a user-specified max_abs_error that will be used
1659 // for comparison instead of ULP-based approximation. The max absolute
1660 // should be non-negative.
1693 // of error bounds. If the result of value - expected_ would result in
1700 const FloatType diff = value - expected_;
1705 if (listener->IsInterested()) {
1715 // os->precision() returns the previously set precision, which we
1719 os->precision(::std::numeric_limits<FloatType>::digits10 + 2);
1732 os->precision(old_precision);
1738 os->precision(::std::numeric_limits<FloatType>::digits10 + 2);
1752 os->precision(old_precision);
1789 // A 2-tuple ("binary") wrapper around FloatingEqMatcher:
1797 FloatingEq2Matcher() { Init(-1, false); }
1799 explicit FloatingEq2Matcher(bool nan_eq_nan) { Init(-1, nan_eq_nan); }
1822 return os << "an almost-equal pair";
1833 if (max_abs_error_ == -1) {
2024 return MatchPrintAndExplain(to, this->matcher_, listener);
2041 *listener << "which cannot be dynamic_cast to " << this->GetToName();
2044 return MatchPrintAndExplain(*to, this->matcher_, listener);
2113 // Property is a const-qualified member function of Class returning
2154 // which takes a non-const reference as argument.
2187 static auto Invoke(Functor f, const T& arg) -> decltype(f(arg)) {
2272 // takes a non-const reference as argument.
2274 // be a non-const reference (e.g. Matcher<Uncopyable&>).
2282 // Functors often define operator() as non-const method even though
2296 // Implements a matcher that checks the size of an STL-style container.
2331 PrintIfNotEmpty(size_listener.str(), listener->stream());
2343 // Implements a matcher that checks the begin()..end() distance of an STL-style
2387 PrintIfNotEmpty(distance_listener.str(), listener->stream());
2399 // Implements an equality matcher for any STL-style container whose elements
2403 // the other. The failure messages do not report duplicate or out-of-order
2444 ::std::ostream* const os = listener->stream();
2471 *os << (printed_header ? ",\nand" : "which")
2543 if (!listener->IsInterested()) {
2550 UniversalPrint(sorted_container, listener->stream());
2556 PrintIfNotEmpty(inner_listener.str(), listener->stream());
2638 << " where x and the i-th value of ";
2656 if (listener->IsInterested()) {
2666 UniversalPrint(*left, listener->stream());
2668 UniversalPrint(*right, listener->stream());
2670 PrintIfNotEmpty(inner_listener.str(), listener->stream());
2724 PrintIfNotEmpty(inner_listener.str(), listener->stream());
2745 if (listener->IsInterested()) {
2764 PrintIfNotEmpty(count_listener.str(), listener->stream());
2774 PrintIfNotEmpty(count_listener.str(), listener->stream());
2795 this->inner_matcher_.DescribeTo(os);
2800 this->inner_matcher_.DescribeTo(os);
2805 return this->MatchAndExplainImpl(false, container, listener);
2821 this->inner_matcher_.DescribeTo(os);
2826 this->inner_matcher_.DescribeNegationTo(os);
2831 return this->MatchAndExplainImpl(true, container, listener);
2848 this->inner_matcher_.DescribeTo(os);
2855 this->inner_matcher_.DescribeTo(os);
2862 return this->MatchAndExplainImpl(count_matcher_, container, listener);
2923 // Use go/ranked-overloads for dispatching.
2930 auto First(T& x, Rank0) -> decltype(get<0>(x)) { // NOLINT
2934 auto First(T& x, Rank1) -> decltype((x.first)) { // NOLINT
2939 auto Second(T& x, Rank0) -> decltype(get<1>(x)) { // NOLINT
2943 auto Second(T& x, Rank1) -> decltype((x.second)) { // NOLINT
3088 if (!listener->IsInterested()) {
3098 PrintIfNotEmpty(first_inner_listener.str(), listener->stream());
3105 PrintIfNotEmpty(second_inner_listener.str(), listener->stream());
3156 int) -> decltype(std::tie(get<I>(t)...)) {
3262 -> decltype((UnpackStructImpl)(t, std::make_index_sequence<I>{}, 0)) {
3267 // The array ensures left-to-right order of evaluation.
3310 if (!listener->IsInterested()) {
3330 PrintIfNotEmpty(inner_listener[failed_pos].str(), listener->stream());
3423 // To work with stream-like "containers", we must only walk
3426 const bool listener_interested = listener->IsInterested();
3456 // calling size() s.t. this code works for stream-like "containers"
3475 // The element count matches, but the exam_pos-th element doesn't match.
3478 PrintIfNotEmpty(explanations[exam_pos], listener->stream());
3491 *listener << ",\nand ";
3511 // Connectivity matrix of (elements X matchers), in element-major order.
3531 // Treating the connectivity matrix as a (LhsSize()*RhsSize())-bit number,
3549 // flattened array in lhs-major order, use 'SpaceIndex()' to translate
3661 element_printouts->clear();
3666 if (listener->IsInterested()) {
3667 element_printouts->push_back(PrintToString(*elem_first));
3796 // Given a 2-tuple matcher tm of type Tuple2Matcher and a value second
3861 // Given a 2-tuple matcher tm and a value second,
3872 // macro where the user-supplied description string is "", if
3875 // that are the print-out of the matcher's parameters.
3921 PrintIfNotEmpty(value_listener.str(), listener->stream());
3951 if (!listener->IsInterested()) {
3965 PrintIfNotEmpty(elem_listener.str(), listener->stream());
4011 if (!listener->IsInterested()) {
4026 PrintIfNotEmpty(elem_listener.str(), listener->stream());
4075 if (!listener->IsInterested()) return inner_matcher_.Matches(selected_args);
4077 PrintIndices(listener->stream());
4083 PrintIfNotEmpty(inner_listener.str(), listener->stream());
4106 // The static_cast to void is needed to silence Clang's -Wcomma warning.
4161 -> decltype(ElementsAreArray(pointer, pointer + count)) {
4167 -> decltype(ElementsAreArray(array, N)) {
4173 -> decltype(ElementsAreArray(container.begin(), container.end())) {
4179 -> decltype(ElementsAreArray(xs.begin(), xs.end())) {
4238 // 3. c-style has approved of using _ in this case.
4264 // Creates a polymorphic matcher that matches any non-NULL pointer.
4297 // considered unequal. The max absolute error bound must be non-negative.
4305 // rhs is NaN. The max absolute error bound must be non-negative.
4325 // considered unequal. The max absolute error bound must be non-negative.
4333 // rhs is NaN. The max absolute error bound must be non-negative.
4420 // The same as above but for reference-qualified member functions.
4432 // Three-argument form for reference-qualified member functions.
4513 // Matches a string that starts with 'prefix' (case-sensitive).
4521 // Matches a string that ends with 'suffix' (case-sensitive).
4568 // Matches a string that starts with 'prefix' (case-sensitive).
4575 // Matches a string that ends with 'suffix' (case-sensitive).
4584 // Creates a polymorphic matcher that matches a 2-tuple where the
4588 // Creates a polymorphic matcher that matches a 2-tuple where the
4592 // Creates a polymorphic matcher that matches a 2-tuple where the
4596 // Creates a polymorphic matcher that matches a 2-tuple where the
4600 // Creates a polymorphic matcher that matches a 2-tuple where the
4604 // Creates a polymorphic matcher that matches a 2-tuple where the
4608 // Creates a polymorphic matcher that matches a 2-tuple where
4614 // Creates a polymorphic matcher that matches a 2-tuple where
4620 // Creates a polymorphic matcher that matches a 2-tuple where
4626 // Creates a polymorphic matcher that matches a 2-tuple where
4632 // Creates a polymorphic matcher that matches a 2-tuple where
4638 // Creates a polymorphic matcher that matches a 2-tuple where
4644 // Creates a polymorphic matcher that matches a 2-tuple where
4652 // Creates a polymorphic matcher that matches a 2-tuple where
4677 // support both size() and size_type which all STL-like containers provide.
4729 // Matches an STL-style container or a native array that contains the
4730 // same number of elements as in rhs, where its i-th element and rhs's
4731 // i-th element (as a pair) satisfy the given pair matcher, for all i.
4750 // UnorderedPointwise(pair_matcher, rhs) matches an STL-style
4753 // i-th element and rhs's i-th element (as a pair) satisfy the given
4770 // STL-style container and it being a native C-style array.
4797 // Matches an STL-style container or a native array that contains at
4846 // - {1, 2, 3} matches IsSupersetOf({Ge(3), Ne(0)}), as 3 matches Ge(3) and
4848 // - {1, 2} doesn't match IsSupersetOf({Eq(1), Lt(2)}), even though 1 matches
4851 // - {1, 1, 2} matches IsSupersetOf({Eq(1), Lt(2)}), as (the first) 1 matches
4853 // - {1, 2, 3} matches IsSupersetOf(Gt(1), Gt(1)), as 2 matches (the first)
4906 // - {1} matches IsSubsetOf({Gt(0), Lt(0)}), as 1 matches Gt(0).
4907 // - {1, -1} matches IsSubsetOf({Lt(0), Gt(0)}), as 1 matches Gt(0) and -1
4909 // - {1, 2} doesn't matches IsSubsetOf({Gt(0), Lt(0)}), even though 1 and 2 both
4951 // Matches an STL-style container or a native array that contains only
5368 *listener << "throws an std::exception-derived type ";
5429 "expected an std::exception-derived type");
5468 /* NOLINTNEXTLINE readability-redundant-string-init */ \
5479 GMOCK_INTERNAL_WARNING_CLANG(ignored, "-Wunused-function") \
5480 GMOCK_INTERNAL_WARNING_CLANG(ignored, "-Wunused-member-function") \
5622 #include "gmock/internal/custom/gmock-matchers.h"